Target API 31 on Google variant

This commit is contained in:
Mygod
2021-10-23 17:02:52 -04:00
parent 79bade2fe9
commit c1ae7857eb
7 changed files with 40 additions and 26 deletions

View File

@@ -0,0 +1,13 @@
package be.mygod.vpnhotspot.util
import android.content.Context
import java.lang.reflect.Method
fun UnblockHelper(context: Context) {
val getDeclaredMethod = Class::class.java.getDeclaredMethod("getDeclaredMethod",
String::class.java, arrayOf<Class<*>>()::class.java)
val clazz = Class.forName("dalvik.system.VMRuntime")
val setHiddenApiExemptions = getDeclaredMethod(clazz, "setHiddenApiExemptions",
arrayOf(Array<String>::class.java)) as Method
setHiddenApiExemptions(clazz.getDeclaredMethod("getRuntime")(null), arrayOf(""))
}