Fix hiddenapibypass

This commit is contained in:
Mygod
2023-06-08 21:51:13 -04:00
parent 26fbbc36e5
commit c72b4c4f27
2 changed files with 3 additions and 4 deletions

View File

@@ -5,8 +5,7 @@ import android.net.MacAddress
import android.net.wifi.SoftApConfiguration
import android.net.wifi.p2p.WifiP2pConfig
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.App.Companion.app
import me.weishu.reflection.Reflection
import org.lsposed.hiddenapibypass.HiddenApiBypass
/**
* The central object for accessing all the useful blocked APIs. Thanks Google!
@@ -19,7 +18,7 @@ object UnblockCentral {
/**
* Retrieve this property before doing dangerous shit.
*/
private val init by lazy { if (needInit) check(Reflection.unseal(app.deviceStorage) == 0) }
private val init by lazy { if (needInit) check(HiddenApiBypass.setHiddenApiExemptions("")) }
@RequiresApi(33)
fun getCountryCode(clazz: Class<*>) = init.let { clazz.getDeclaredMethod("getCountryCode") }