@Override public Object invoke(Object proxy, Method method, Object... args) throws Throwable { try { processArgs(method, args); } catch (Throwable e) { e.printStackTrace(); String arg = (String) args[start + 1]; Bundle extras = (Bundle) args[start + 2]; return call(methodBox, methodName, arg, extras); } else if ("insert".equals(name)) { Uri url = (Uri) args[start]; ContentValues initialValues = (ContentValues) args[start + 1]; return insert(methodBox, url, initialValues); } else if ("getType".equals(name)) { return getType(methodBox, (Uri) args[0]); } else if ("delete".equals(name)) { Uri url = (Uri) args[start]; String selection = (String) args[start + 1]; String[] selectionArgs = (String[]) args[start + 2]; return delete(methodBox, url, selection, selectionArgs); } else if ("bulkInsert".equals(name)) { Uri url = (Uri) args[start]; ContentValues[] initialValues = (ContentValues[]) args[start + 1]; return bulkInsert(methodBox, url, initialValues); } else if ("update".equals(name)) { Uri url = (Uri) args[start]; String selection = (String) args[start + 2]; String[] selectionArgs = (String[]) args[start + 3];
public static IInterface createProxy(boolean external, String authority, IInterface provider) { if (provider instanceof Proxy && Proxy.getInvocationHandler(provider) instanceof ProviderHook) { return provider; } ProviderHook.HookFetcher fetcher = ProviderHook.fetchHook(authority); if (fetcher != null) { ProviderHook hook = fetcher.fetch(external, provider); IInterface proxyProvider = ProviderHook.createProxy(provider, hook); if (proxyProvider != null) { provider = proxyProvider; } } return provider; }
provider = ProviderHook.createProxy(true, info.authority, provider); ActivityThread.ProviderClientRecordJB.mProvider.set(clientRecord, provider); ContentProviderHolderOreo.provider.set(holder, provider); provider = ProviderHook.createProxy(true, info.authority, provider); ActivityThread.ProviderClientRecordJB.mProvider.set(clientRecord, provider); IActivityManager.ContentProviderHolder.provider.set(holder, provider); IInterface provider = ActivityThread.ProviderClientRecord.mProvider.get(clientRecord); if (provider != null && !authority.startsWith(VASettings.STUB_CP_AUTHORITY)) { provider = ProviderHook.createProxy(true, authority, provider); ActivityThread.ProviderClientRecord.mProvider.set(clientRecord, provider);
@Override public Uri insert(MethodBox methodBox, Uri url, ContentValues initialValues) throws InvocationTargetException { if (!(MediaStore.Audio.Media.INTERNAL_CONTENT_URI.equals(url) || MediaStore.Audio.Media.EXTERNAL_CONTENT_URI.equals(url)) || MediaStore.Video.Media.INTERNAL_CONTENT_URI.equals(url) || MediaStore.Video.Media.EXTERNAL_CONTENT_URI.equals(url) || MediaStore.Images.Media.INTERNAL_CONTENT_URI.equals(url) || MediaStore.Images.Media.EXTERNAL_CONTENT_URI.equals(url) ) { return super.insert(methodBox, url, initialValues); } Object v2 = initialValues.get(COLUMN_NAME); if (!(v2 instanceof String)) { return super.insert(methodBox, url, initialValues); } String path = NativeEngine.getEscapePath((String) v2); initialValues.put(COLUMN_NAME, path); return super.insert(methodBox, url, initialValues); }
info = ContentProviderHolderOreo.info.get(holder); if (provider != null) { provider = ProviderHook.createProxy(true, info.authority, provider); info = IActivityManager.ContentProviderHolder.info.get(holder); if (provider != null) { provider = ProviderHook.createProxy(true, info.authority, provider);
@Override public Uri insert(MethodBox methodBox, Uri url, ContentValues initialValues) throws InvocationTargetException { if (!(MediaStore.Audio.Media.INTERNAL_CONTENT_URI.equals(url) || MediaStore.Audio.Media.EXTERNAL_CONTENT_URI.equals(url)) || MediaStore.Video.Media.INTERNAL_CONTENT_URI.equals(url) || MediaStore.Video.Media.EXTERNAL_CONTENT_URI.equals(url) || MediaStore.Images.Media.INTERNAL_CONTENT_URI.equals(url) || MediaStore.Images.Media.EXTERNAL_CONTENT_URI.equals(url) ) { return super.insert(methodBox, url, initialValues); } Object v2 = initialValues.get(COLUMN_NAME); if (!(v2 instanceof String)) { return super.insert(methodBox, url, initialValues); } String path = NativeEngine.getEscapePath((String) v2); initialValues.put(COLUMN_NAME, path); return super.insert(methodBox, url, initialValues); }
@Override public Object invoke(Object proxy, Method method, Object... args) throws Throwable { try { processArgs(method, args); } catch (Throwable e) { e.printStackTrace(); String arg = (String) args[start + 1]; Bundle extras = (Bundle) args[start + 2]; return call(methodBox, methodName, arg, extras); } else if ("insert".equals(name)) { Uri url = (Uri) args[start]; ContentValues initialValues = (ContentValues) args[start + 1]; return insert(methodBox, url, initialValues); } else if ("getType".equals(name)) { return getType(methodBox, (Uri) args[0]); } else if ("delete".equals(name)) { Uri url = (Uri) args[start]; String selection = (String) args[start + 1]; String[] selectionArgs = (String[]) args[start + 2]; return delete(methodBox, url, selection, selectionArgs); } else if ("bulkInsert".equals(name)) { Uri url = (Uri) args[start]; ContentValues[] initialValues = (ContentValues[]) args[start + 1]; return bulkInsert(methodBox, url, initialValues); } else if ("update".equals(name)) { Uri url = (Uri) args[start]; String selection = (String) args[start + 2]; String[] selectionArgs = (String[]) args[start + 3];
public static IInterface createProxy(boolean external, String authority, IInterface provider) { if (provider instanceof Proxy && Proxy.getInvocationHandler(provider) instanceof ProviderHook) { return provider; } ProviderHook.HookFetcher fetcher = ProviderHook.fetchHook(authority); if (fetcher != null) { ProviderHook hook = fetcher.fetch(external, provider); IInterface proxyProvider = ProviderHook.createProxy(provider, hook); if (proxyProvider != null) { provider = proxyProvider; } } return provider; }
provider = ProviderHook.createProxy(true, info.authority, provider); ActivityThread.ProviderClientRecordJB.mProvider.set(clientRecord, provider); ContentProviderHolderOreo.provider.set(holder, provider); provider = ProviderHook.createProxy(true, info.authority, provider); ActivityThread.ProviderClientRecordJB.mProvider.set(clientRecord, provider); IActivityManager.ContentProviderHolder.provider.set(holder, provider); IInterface provider = ActivityThread.ProviderClientRecord.mProvider.get(clientRecord); if (provider != null && !authority.startsWith(VASettings.STUB_CP_AUTHORITY)) { provider = ProviderHook.createProxy(true, authority, provider); ActivityThread.ProviderClientRecord.mProvider.set(clientRecord, provider);
@Override public Object invoke(Object proxy, Method method, Object... args) throws Throwable { try { processArgs(method, args); } catch (Throwable e) { e.printStackTrace(); String arg = (String) args[start + 1]; Bundle extras = (Bundle) args[start + 2]; return call(methodBox, methodName, arg, extras); } else if ("insert".equals(name)) { Uri url = (Uri) args[start]; ContentValues initialValues = (ContentValues) args[start + 1]; return insert(methodBox, url, initialValues); } else if ("getType".equals(name)) { return getType(methodBox, (Uri) args[0]); } else if ("delete".equals(name)) { Uri url = (Uri) args[start]; String selection = (String) args[start + 1]; String[] selectionArgs = (String[]) args[start + 2]; return delete(methodBox, url, selection, selectionArgs); } else if ("bulkInsert".equals(name)) { Uri url = (Uri) args[start]; ContentValues[] initialValues = (ContentValues[]) args[start + 1]; return bulkInsert(methodBox, url, initialValues); } else if ("update".equals(name)) { Uri url = (Uri) args[start]; String selection = (String) args[start + 2]; String[] selectionArgs = (String[]) args[start + 3];
public static IInterface createProxy(boolean external, String authority, IInterface provider) { if (provider instanceof Proxy && Proxy.getInvocationHandler(provider) instanceof ProviderHook) { return provider; } ProviderHook.HookFetcher fetcher = ProviderHook.fetchHook(authority); if (fetcher != null) { ProviderHook hook = fetcher.fetch(external, provider); IInterface proxyProvider = ProviderHook.createProxy(provider, hook); if (proxyProvider != null) { provider = proxyProvider; } } return provider; }
provider = ProviderHook.createProxy(true, info.authority, provider); ActivityThread.ProviderClientRecordJB.mProvider.set(clientRecord, provider); ContentProviderHolderOreo.provider.set(holder, provider); provider = ProviderHook.createProxy(true, info.authority, provider); ActivityThread.ProviderClientRecordJB.mProvider.set(clientRecord, provider); IActivityManager.ContentProviderHolder.provider.set(holder, provider); IInterface provider = ActivityThread.ProviderClientRecord.mProvider.get(clientRecord); if (provider != null && !authority.startsWith(VASettings.STUB_CP_AUTHORITY)) { provider = ProviderHook.createProxy(true, authority, provider); ActivityThread.ProviderClientRecord.mProvider.set(clientRecord, provider);
info = ContentProviderHolderOreo.info.get(holder); if (provider != null) { provider = ProviderHook.createProxy(true, info.authority, provider); info = IActivityManager.ContentProviderHolder.info.get(holder); if (provider != null) { provider = ProviderHook.createProxy(true, info.authority, provider);
info = ContentProviderHolderOreo.info.get(holder); if (provider != null) { provider = ProviderHook.createProxy(true, info.authority, provider); info = IActivityManager.ContentProviderHolder.info.get(holder); if (provider != null) { provider = ProviderHook.createProxy(true, info.authority, provider);