(misc) test java 20

Signed-off-by: androidacy-user <opensource@androidacy.com>
master
androidacy-user 1 year ago
parent 702048e6c8
commit 6d0ac44950

@ -28,10 +28,10 @@ jobs:
with:
submodules: true
- name: Set up Java 17
- name: Set up Java 20
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 20
distribution: 'temurin'
- name: Setup Android SDK

@ -288,8 +288,8 @@ android {
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_20
targetCompatibility = JavaVersion.VERSION_20
}
lint {
@ -416,7 +416,17 @@ dependencies {
// google guava, maybe fix a bug
implementation("com.google.guava:guava:31.1-android")
implementation("com.github.topjohnwu.libsu:io:5.0.5")
val libsuVersion = "5.0.5"
// The core module that provides APIs to a shell
implementation("com.github.topjohnwu.libsu:core:${libsuVersion}")
// Optional: APIs for creating root services. Depends on ":core"
implementation("com.github.topjohnwu.libsu:service:${libsuVersion}")
// Optional: Provides remote file system support
implementation("com.github.topjohnwu.libsu:io:${libsuVersion}")
implementation("com.github.Fox2Code:RosettaX:1.0.9")
implementation("com.github.Fox2Code:AndroidANSI:1.0.1")
@ -442,9 +452,6 @@ dependencies {
// timber
implementation("com.jakewharton.timber:timber:5.0.1")
// ksp
implementation("com.google.devtools.ksp:symbol-processing-api:1.8.20-1.0.10")
// encryption
implementation("androidx.security:security-crypto:1.1.0-alpha06")
@ -475,11 +482,6 @@ android {
viewBinding = true
buildConfig = true
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
}
}
//noinspection GrDeprecatedAPIUsage
buildToolsVersion = "34.0.0 rc3"
@Suppress("DEPRECATION") packagingOptions {
@ -489,15 +491,8 @@ android {
}
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(20))
}
}

@ -106,7 +106,7 @@ public class MainApplication extends FoxApplication implements androidx.work.Con
public static String updateCheckBg;
static {
Shell.setDefaultBuilder(shellBuilder = Shell.Builder.create().setFlags(Shell.FLAG_REDIRECT_STDERR).setTimeout(10).setInitializers(InstallerInitializer.class));
Shell.setDefaultBuilder(shellBuilder = Shell.Builder.create().setFlags(Shell.FLAG_REDIRECT_STDERR).setTimeout(10).setContext(MainApplication.getINSTANCE().getApplicationContext()).setInitializers(InstallerInitializer.class));
Random random = new Random();
do {
secret = random.nextLong();

@ -140,8 +140,21 @@ public class InstallerInitializer extends Shell.Initializer {
public boolean onInit(@NonNull Context context, @NonNull Shell shell) {
// open a new shell
shell.newJob().add("id").exec().getOut();
if (!Boolean.TRUE.equals(Shell.isAppGrantedRoot())) {
Timber.w("No root access!");
// if Shell.isAppGrantedRoot() returns null, loop until it doesn't
if (Shell.isAppGrantedRoot() == null) {
Timber.w("Waiting for root access...");
while (Shell.isAppGrantedRoot() == null) {
try {
//noinspection BusyWait
Thread.sleep(100);
} catch (InterruptedException e) {
Timber.e(e);
}
}
}
boolean hasRoot = Boolean.TRUE.equals(Shell.isAppGrantedRoot());
if (!hasRoot) {
Timber.w("No root access, or libsu is misreporting");
return false;
}
// switch to global namespace

@ -15,7 +15,7 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle:8.0.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:10.6.2")
// NOTE: Do not place your application dependencies here; they belong
@ -32,8 +32,8 @@ tasks.register("clean", Delete::class) {
afterEvaluate {
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
sourceCompatibility = JavaVersion.VERSION_20.toString()
targetCompatibility = JavaVersion.VERSION_20.toString()
}
}

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-milestone-1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Loading…
Cancel
Save