1. added dex loader

This commit is contained in:
vadym 2020-08-07 00:07:24 -07:00
parent 2786d8f8ca
commit d129230898
3 changed files with 15 additions and 1 deletions

View File

@ -67,7 +67,7 @@ dependencies {
implementation 'com.google.android.material:material:1.3.0-alpha02'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.hbb20:ccp:2.4.0'
implementation "app.artyomd.injector:injector-android:{latest-version}"
implementation 'app.artyomd.injector:injector-android:0.5.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'

View File

@ -11,6 +11,8 @@ import android.view.View
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.preference.PreferenceManager
import app.artyomd.injector.DexUtils
import dalvik.system.DexFile
import io.github.chronosx88.yggdrasil.models.DNSInfo
import io.github.chronosx88.yggdrasil.models.PeerInfo
import io.github.chronosx88.yggdrasil.models.config.DNSInfoListAdapter
@ -22,6 +24,7 @@ import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.deserializeS
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.deserializeStringSet2PeerInfoSet
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.serializeDNSInfoSet2StringList
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.serializePeerInfoSet2StringList
import java.io.File
import java.lang.reflect.Method
import kotlin.concurrent.thread
@ -149,6 +152,16 @@ class MainActivity : AppCompatActivity() {
showToast("The method is: " + m.toString())
}
}
val sourceDir = listOf<File>(File(this.applicationInfo.sourceDir))
DexUtils.loadDex(this, sourceDir)
showToast("Getting dummy.Dummy class methods list")
if(methods.isEmpty()){
showToast("No class methods found in dummy.Dummy")
} else {
for (m in methods) {
showToast("The method is: " + m.toString())
}
}
}
private fun stopVpn(){

View File

@ -4,6 +4,7 @@ buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {