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