mirror of
https://github.com/yggdrasil-network/crispa-android.git
synced 2024-11-09 12:01:01 +00:00
1. code refactoring
This commit is contained in:
parent
470e4094a6
commit
f5fcd68984
@ -4,6 +4,7 @@ import android.app.Activity
|
||||
import android.app.ActivityManager
|
||||
import android.content.*
|
||||
import android.net.VpnService
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
@ -140,19 +141,11 @@ class MainActivity : AppCompatActivity() {
|
||||
ipLayout.visibility = View.VISIBLE
|
||||
findViewById<TextView>(R.id.ip).text = address
|
||||
}
|
||||
|
||||
val sourceDir: String = this.applicationInfo.sourceDir
|
||||
val dexFile = DexFile(sourceDir)
|
||||
val cl = classLoader
|
||||
val c: Class<*> = dexFile.loadClass("dummy/Dummy", cl)
|
||||
val methods: Array<Method> = c.declaredMethods
|
||||
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())
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
val sourceDir: String = this.applicationInfo.sourceDir
|
||||
val dexFile = DexFile(sourceDir)
|
||||
val cl = classLoader
|
||||
val c: Class<*> = dexFile.loadClass("dummy/Dummy", cl)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,6 @@ class YggdrasilTunService : VpnService() {
|
||||
} else {
|
||||
Builder()
|
||||
.addAddress(address, 7)
|
||||
//.addAddress("1.1.1.1", 32)
|
||||
//.addRoute("200::", 7)
|
||||
.setMtu(MAX_PACKET_SIZE)
|
||||
}
|
||||
if (dns.size > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user