Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (packageParam.packageName.equalsIgnoreCase("com.android.vending.billing.InAppBillingService.LACK")) {
- //XposedBridge.log("In Lucky patcher!");
- //if there is no app database
- XposedHelpers.findAndHookMethod("com.android.vending.billing.InAppBillingService.LACK.listAppsFragment", packageParam.classLoader, "getPackages", new XC_MethodHook() {
- @Override
- protected void afterHookedMethod(MethodHookParam param) throws Throwable {
- String[] old = (String[]) param.getResult();
- String[] newOne = new String[old.length - 1];//probably there is better way to just subtract one element from this array
- boolean notFound = true;
- for (int i = 0; i < old.length; i++) {
- String p = old[i];
- if (p.equalsIgnoreCase("com.marz.snapprefs")) notFound = false;
- else {
- if (notFound) newOne[i] = p;
- else newOne[i - 1] = p;
- }
- }
- if (!notFound) param.setResult(newOne);
- }
- });
- //if there is database
- XposedHelpers.findAndHookMethod("com.android.vending.billing.InAppBillingService.LACK.DatabaseHelper", packageParam.classLoader, "getPackage", boolean.class, boolean.class, new XC_MethodHook() {
- @Override
- protected void afterHookedMethod(MethodHookParam param) throws Throwable {
- ArrayList list = (ArrayList) param.getResult();
- Iterator it = list.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (((String) XposedHelpers.getObjectField(o, "pkgName")).equalsIgnoreCase("com.marz.snapprefs")) it.remove();
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement