Last active
February 4, 2018 19:41
-
-
Save davethomas11/1204f65345d17d9b3ba90f11be283cf6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
text_view.text = loadDexFile("dm.dex").text | |
textView2.text = loadDexFile("dm2.dex").text | |
} | |
fun sourceFile(name: String) = packageManager.getPackageInfo(packageName, 0) | |
.applicationInfo.dataDir + "/files/" + name | |
fun copyDexFile(name: String) = FileUtils.copyToFile(assets.open(name), File(sourceFile(name))) | |
.let { File(sourceFile(name)) } | |
fun loadDexFile(name: String) = ModuleLoader(cacheDir.absolutePath).load(copyDexFile(name)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment