Merge pull request #85 from vikulin/master

NPE fix in class loader
This commit is contained in:
Vadym Vikulin 2022-12-21 12:54:35 +02:00 committed by GitHub
commit 91ddb4f991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -11,8 +11,8 @@ android {
applicationId "io.github.chronosx88.yggdrasil"
minSdkVersion 15
targetSdkVersion 33
versionCode 41
versionName "2.1.5"
versionCode 42
versionName "2.1.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", project.getParent().name+"-"+versionName)

View File

@ -212,8 +212,10 @@ class MainActivity : AppCompatActivity() {
val sourceDir: String = this.applicationInfo.sourceDir
val dexFile = DexFile(sourceDir)
val cl = classLoader
if (cl != null) {
try {
val c: Class<*> = dexFile.loadClass("dummy/Dummy", cl)
} catch (_: NullPointerException){
//there is nothing we can do
}
}
val versionName = findViewById<Button>(R.id.about)