Skip to content

Commit 5f0a433

Browse files
committed
Update for Play Services 12.5.21 #13
1 parent 146a199 commit 5f0a433

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="org.brainkiller.xposed.denylocationconsent"
4-
android:versionCode="4"
5-
android:versionName="0.4" >
4+
android:versionCode="5"
5+
android:versionName="0.5" >
66

77
<uses-sdk
88
android:minSdkVersion="14"

src/org/brainkiller/xposed/denylocationconsent/DenyLocationConsent.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import android.content.Context;
44
import android.location.LocationManager;
55
import android.os.Build;
6+
import android.provider.Settings.Secure;
7+
import android.util.Log;
68

79
import de.robv.android.xposed.IXposedHookLoadPackage;
810
import de.robv.android.xposed.XC_MethodReplacement;
@@ -14,15 +16,15 @@ public class DenyLocationConsent implements IXposedHookLoadPackage {
1416
public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
1517
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
1618
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);
1820

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() {
2022
@Override
2123
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+
2628
return null;
2729
}
2830
});

0 commit comments

Comments
 (0)