3
3
import android .content .Context ;
4
4
import android .location .LocationManager ;
5
5
import android .os .Build ;
6
+ import android .provider .Settings .Secure ;
7
+ import android .util .Log ;
6
8
7
9
import de .robv .android .xposed .IXposedHookLoadPackage ;
8
10
import de .robv .android .xposed .XC_MethodReplacement ;
@@ -14,15 +16,15 @@ public class DenyLocationConsent implements IXposedHookLoadPackage {
14
16
public void handleLoadPackage (LoadPackageParam lpparam ) throws Throwable {
15
17
if (android .os .Build .VERSION .SDK_INT >= Build .VERSION_CODES .KITKAT ) {
16
18
if (lpparam .packageName .equals ("com.google.android.gms" )) {
17
- final Class <?> NetworkLocationChimeraService = XposedHelpers .findClass ("com.google.android.location.network.NetworkLocationChimeraService " , lpparam .classLoader );
19
+ final Class <?> NetworkLocationProvider = XposedHelpers .findClass ("com.google.android.location.network.NetworkLocationProvider " , lpparam .classLoader );
18
20
19
- XposedHelpers .findAndHookMethod ("com.google.android.location.network.NetworkLocationChimeraService " , lpparam .classLoader , "a" , Context . class , new XC_MethodReplacement () {
21
+ XposedHelpers .findAndHookMethod ("com.google.android.location.network.NetworkLocationProvider " , lpparam .classLoader , "a" , new XC_MethodReplacement () {
20
22
@ Override
21
23
protected Object replaceHookedMethod (MethodHookParam param ) throws Throwable {
22
- Context context = (Context ) param .args [ 0 ] ;
23
-
24
- XposedHelpers . callStaticMethod ( NetworkLocationChimeraService , "b " , context , false );
25
-
24
+ Context context = (Context ) XposedHelpers . getObjectField ( param .thisObject , "a" ) ;
25
+ Secure . setLocationProviderEnabled ( context . getContentResolver (), "network" , false );
26
+ Log . wtf ( "GmsNetworkLocationProvi " , "Don't be evil" );
27
+
26
28
return null ;
27
29
}
28
30
});
0 commit comments