From 206f9e22114ab924c242325b75cdd5546e7cb34b Mon Sep 17 00:00:00 2001 From: vadym Date: Wed, 21 Dec 2022 10:36:30 +0200 Subject: [PATCH] class loader fix for https://github.com/yggdrasil-network/crispa-android/issues/83 libraries upgrade --- app/build.gradle | 32 +++++++++---------- app/src/main/AndroidManifest.xml | 3 +- .../org/yggdrasil/app/crispa/MainActivity.kt | 4 ++- build.gradle | 2 +- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4542bf8..33b9100 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,11 +10,9 @@ android { defaultConfig { applicationId "io.github.chronosx88.yggdrasil" minSdkVersion 15 - targetSdkVersion 33 - - versionCode 40 - versionName "2.1.4" + versionCode 41 + versionName "2.1.5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" setProperty("archivesBaseName", project.getParent().name+"-"+versionName) @@ -38,7 +36,7 @@ android { signingConfig signingConfigs.release } } - ndkVersion "21.2.6472646" + ndkVersion "23.2.8568313" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -46,19 +44,19 @@ android { kotlinOptions { jvmTarget = '1.8' } - lintOptions { - checkReleaseBuilds false - // Or, if you prefer, you can continue to check for errors in release builds, - // but continue the build even when errors are found: - abortOnError false - } packagingOptions { - exclude 'META-INF/LICENSE' - exclude 'META-INF/NOTICE' + resources { + excludes += ['META-INF/LICENSE', 'META-INF/NOTICE'] + } } buildFeatures { viewBinding true } + lint { + abortOnError false + checkReleaseBuilds false + } + namespace 'org.yggdrasil.app.crispa' } @@ -84,8 +82,8 @@ dependencies { implementation 'androidx.preference:preference-ktx:1.2.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2' - implementation 'com.google.android.material:material:1.8.0-alpha03' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1' + implementation 'com.google.android.material:material:1.8.0-beta01' implementation 'com.google.code.gson:gson:2.9.0' implementation 'com.hbb20:ccp:2.4.0' implementation 'com.vincentbrison.openlibraries.android:dualcache:3.1.1' @@ -94,6 +92,6 @@ dependencies { implementation 'androidx.work:work-runtime-ktx:2.7.1' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test:runner:1.4.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + androidTestImplementation 'androidx.test:runner:1.5.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1308830..d56565a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/app/src/main/java/org/yggdrasil/app/crispa/MainActivity.kt b/app/src/main/java/org/yggdrasil/app/crispa/MainActivity.kt index d9e8d23..6e551c3 100644 --- a/app/src/main/java/org/yggdrasil/app/crispa/MainActivity.kt +++ b/app/src/main/java/org/yggdrasil/app/crispa/MainActivity.kt @@ -212,7 +212,9 @@ class MainActivity : AppCompatActivity() { val sourceDir: String = this.applicationInfo.sourceDir val dexFile = DexFile(sourceDir) val cl = classLoader - val c: Class<*> = dexFile.loadClass("dummy/Dummy", cl) + if (cl != null) { + val c: Class<*> = dexFile.loadClass("dummy/Dummy", cl) + } } val versionName = findViewById