From d12923089890d8cd19e644ef44b4b0e00df7cc8a Mon Sep 17 00:00:00 2001 From: vadym Date: Fri, 7 Aug 2020 00:07:24 -0700 Subject: [PATCH] 1. added dex loader --- app/build.gradle | 2 +- .../io/github/chronosx88/yggdrasil/MainActivity.kt | 13 +++++++++++++ build.gradle | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index a9c54d2..80c0a92 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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' diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt index 78225f8..702e1c5 100644 --- a/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt @@ -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(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(){ diff --git a/build.gradle b/build.gradle index 8c88b8c..bbc207a 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ buildscript { ext.kotlin_version = '1.3.72' repositories { google() + mavenCentral() jcenter() } dependencies {