private static RefStaticMethod<IInterface> getInterfaceMethod() { if (BuildCompat.isOreo()) { return IStorageManager.Stub.asInterface; } else { return IMountService.Stub.asInterface; } } }
private static boolean isOreo() { return BuildCompat.isOreo() && !DeviceUtil.isSamsung() || ClipboardManager.getService == null; } }
public static IInterface asInterface(IBinder binder) { if (BuildCompat.isOreo()) { return IApplicationThreadOreo.Stub.asInterface.call(binder); } return ApplicationThreadNative.asInterface.call(binder); } }
private static void clearContentProvider(Object cache) { if (BuildCompat.isOreo()) { Object holder = Settings.NameValueCacheOreo.mProviderHolder.get(cache); if (holder != null) { Settings.ContentProviderHolder.mContentProvider.set(holder, null); } } else { Settings.NameValueCache.mContentProvider.set(cache, null); } }
Map clientMap = ActivityThread.mProviderMap.get(VirtualCore.mainThread()); for (Object clientRecord : clientMap.values()) { if (BuildCompat.isOreo()) { IInterface provider = ActivityThread.ProviderClientRecordJB.mProvider.get(clientRecord); Object holder = ActivityThread.ProviderClientRecordJB.mHolder.get(clientRecord);
@Override public void inject() throws Throwable { if (BuildCompat.isOreo()) { //Android Oreo(8.X) Object singleton = ActivityManagerOreo.IActivityManagerSingleton.get(); Singleton.mInstance.set(singleton, getInvocationStub().getProxyInterface()); } else { if (ActivityManagerNative.gDefault.type() == IActivityManager.TYPE) { ActivityManagerNative.gDefault.set(getInvocationStub().getProxyInterface()); } else if (ActivityManagerNative.gDefault.type() == Singleton.TYPE) { Object gDefault = ActivityManagerNative.gDefault.get(); Singleton.mInstance.set(gDefault, getInvocationStub().getProxyInterface()); } } BinderInvocationStub hookAMBinder = new BinderInvocationStub(getInvocationStub().getBaseInterface()); hookAMBinder.copyMethodProxies(getInvocationStub()); ServiceManager.sCache.get().put(Context.ACTIVITY_SERVICE, hookAMBinder); }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ResultStaticMethodProxy("addPermissionAsync", true)); addMethodProxy(new ResultStaticMethodProxy("addPermission", true)); addMethodProxy(new ResultStaticMethodProxy("performDexOpt", true)); addMethodProxy(new ResultStaticMethodProxy("performDexOptIfNeeded", false)); addMethodProxy(new ResultStaticMethodProxy("performDexOptSecondary", true)); addMethodProxy(new ResultStaticMethodProxy("addOnPermissionsChangeListener", 0)); addMethodProxy(new ResultStaticMethodProxy("removeOnPermissionsChangeListener", 0)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { addMethodProxy(new ResultStaticMethodProxy("checkPackageStartable", 0)); } if (BuildCompat.isOreo()) { addMethodProxy(new ResultStaticMethodProxy("notifyDexLoad", 0)); addMethodProxy(new ResultStaticMethodProxy("notifyPackageUse", 0)); addMethodProxy(new ResultStaticMethodProxy("setInstantAppCookie", false)); addMethodProxy(new ResultStaticMethodProxy("isInstantApp", false)); } }
private static RefStaticMethod<IInterface> getInterfaceMethod() { if (BuildCompat.isOreo()) { return IStorageManager.Stub.asInterface; } else { return IMountService.Stub.asInterface; } } }
private static RefStaticMethod<IInterface> getInterfaceMethod() { if (BuildCompat.isOreo()) { return IStorageManager.Stub.asInterface; } else { return IMountService.Stub.asInterface; } } }
private static boolean isOreo() { return BuildCompat.isOreo() && !DeviceUtil.isSamsung() || ClipboardManager.getService == null; } }
public static IInterface asInterface(IBinder binder) { if (BuildCompat.isOreo()) { return IApplicationThreadOreo.Stub.asInterface.call(binder); } return ApplicationThreadNative.asInterface.call(binder); } }
public static IInterface asInterface(IBinder binder) { if (BuildCompat.isOreo()) { return IApplicationThreadOreo.Stub.asInterface.call(binder); } return ApplicationThreadNative.asInterface.call(binder); } }
private static void clearContentProvider(Object cache) { if (BuildCompat.isOreo()) { Object holder = Settings.NameValueCacheOreo.mProviderHolder.get(cache); if (holder != null) { Settings.ContentProviderHolder.mContentProvider.set(holder, null); } } else { Settings.NameValueCache.mContentProvider.set(cache, null); } }
private static IInterface getInterface() { if (BuildCompat.isOreo()) { android.content.ClipboardManager cm = (android.content.ClipboardManager) VirtualCore.get().getContext().getSystemService(Context.CLIPBOARD_SERVICE); return ClipboardManagerOreo.mService.get(cm); } else { return ClipboardManager.getService.call(); } }
private static void clearContentProvider(Object cache) { if (BuildCompat.isOreo()) { Object holder = Settings.NameValueCacheOreo.mProviderHolder.get(cache); if (holder != null) { Settings.ContentProviderHolder.mContentProvider.set(holder, null); } } else { Settings.NameValueCache.mContentProvider.set(cache, null); } }
@Override public void inject() throws Throwable { super.inject(); if (BuildCompat.isOreo()) { android.content.ClipboardManager cm = (android.content.ClipboardManager) VirtualCore.get().getContext().getSystemService(Context.CLIPBOARD_SERVICE); ClipboardManagerOreo.mService.set(cm, getInvocationStub().getProxyInterface()); } else { ClipboardManager.sService.set(getInvocationStub().getProxyInterface()); } } }
@Override public void inject() throws Throwable { if (BuildCompat.isOreo()) { //Android Oreo(8.X) Object singleton = ActivityManagerOreo.IActivityManagerSingleton.get(); Singleton.mInstance.set(singleton, getInvocationStub().getProxyInterface()); } else { if (ActivityManagerNative.gDefault.type() == IActivityManager.TYPE) { ActivityManagerNative.gDefault.set(getInvocationStub().getProxyInterface()); } else if (ActivityManagerNative.gDefault.type() == Singleton.TYPE) { Object gDefault = ActivityManagerNative.gDefault.get(); Singleton.mInstance.set(gDefault, getInvocationStub().getProxyInterface()); } } BinderInvocationStub hookAMBinder = new BinderInvocationStub(getInvocationStub().getBaseInterface()); hookAMBinder.copyMethodProxies(getInvocationStub()); ServiceManager.sCache.get().put(Context.ACTIVITY_SERVICE, hookAMBinder); }
@Override public void inject() throws Throwable { if (BuildCompat.isOreo()) { //Android Oreo(8.X) Object singleton = ActivityManagerOreo.IActivityManagerSingleton.get(); Singleton.mInstance.set(singleton, getInvocationStub().getProxyInterface()); } else { if (ActivityManagerNative.gDefault.type() == IActivityManager.TYPE) { ActivityManagerNative.gDefault.set(getInvocationStub().getProxyInterface()); } else if (ActivityManagerNative.gDefault.type() == Singleton.TYPE) { Object gDefault = ActivityManagerNative.gDefault.get(); Singleton.mInstance.set(gDefault, getInvocationStub().getProxyInterface()); } } BinderInvocationStub hookAMBinder = new BinderInvocationStub(getInvocationStub().getBaseInterface()); hookAMBinder.copyMethodProxies(getInvocationStub()); ServiceManager.sCache.get().put(Context.ACTIVITY_SERVICE, hookAMBinder); }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ResultStaticMethodProxy("addPermissionAsync", true)); addMethodProxy(new ResultStaticMethodProxy("addPermission", true)); addMethodProxy(new ResultStaticMethodProxy("performDexOpt", true)); addMethodProxy(new ResultStaticMethodProxy("performDexOptIfNeeded", false)); addMethodProxy(new ResultStaticMethodProxy("performDexOptSecondary", true)); addMethodProxy(new ResultStaticMethodProxy("addOnPermissionsChangeListener", 0)); addMethodProxy(new ResultStaticMethodProxy("removeOnPermissionsChangeListener", 0)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { addMethodProxy(new ResultStaticMethodProxy("checkPackageStartable", 0)); } if (BuildCompat.isOreo()) { addMethodProxy(new ResultStaticMethodProxy("notifyDexLoad", 0)); addMethodProxy(new ResultStaticMethodProxy("notifyPackageUse", 0)); addMethodProxy(new ResultStaticMethodProxy("setInstantAppCookie", false)); addMethodProxy(new ResultStaticMethodProxy("isInstantApp", false)); } }