NPE fix in class loader

This commit is contained in:
vadym 2022-12-21 12:53:25 +02:00
parent 206f9e2211
commit 95d48cfeb0
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)