This repository has been archived by the owner on Sep 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package biz.bokhorst.xprivacy; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import android.os.Binder; | ||
import android.util.Log; | ||
|
||
import de.robv.android.xposed.XC_MethodHook.MethodHookParam; | ||
|
||
public class XAdvertisingIdClientInfo extends XHook { | ||
private Methods mMethod; | ||
|
||
private XAdvertisingIdClientInfo(Methods method, String restrictionName, String specifier) { | ||
super(restrictionName, method.name(), specifier); | ||
mMethod = method; | ||
} | ||
|
||
public String getClassName() { | ||
return "com.google.android.gms.ads.identifier.AdvertisingIdClient$Info"; | ||
} | ||
|
||
// @formatter:off | ||
|
||
// String getId() | ||
// http://developer.android.com/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info.html | ||
|
||
// @formatter:on | ||
|
||
private enum Methods { | ||
getId | ||
}; | ||
|
||
public static List<XHook> getInstances() { | ||
List<XHook> listHook = new ArrayList<XHook>(); | ||
listHook.add(new XAdvertisingIdClientInfo(Methods.getId, PrivacyManager.cIdentification, "AdvertisingId")); | ||
return listHook; | ||
} | ||
|
||
@Override | ||
protected void before(MethodHookParam param) throws Throwable { | ||
if (mMethod == Methods.getId) { | ||
if (isRestricted(param)) | ||
param.setResult(PrivacyManager.getDefacedProp(Binder.getCallingUid(), "AdvertisingId")); | ||
} else | ||
Util.log(this, Log.WARN, "Unknown method=" + param.method.getName()); | ||
} | ||
|
||
@Override | ||
protected void after(MethodHookParam param) throws Throwable { | ||
// Do nothing | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters