@SuppressLint("WrongConstant") @Override public void inject() throws Throwable { super.inject(); try { Object AutoFillManagerInstance = getContext().getSystemService(AUTO_FILL_NAME); if (AutoFillManagerInstance == null) { throw new NullPointerException("AutoFillManagerInstance is null."); } Object AutoFillManagerProxy = getInvocationStub().getProxyInterface(); if (AutoFillManagerProxy == null) { throw new NullPointerException("AutoFillManagerProxy is null."); } Field AutoFillManagerServiceField = AutoFillManagerInstance.getClass().getDeclaredField("mService"); AutoFillManagerServiceField.setAccessible(true); AutoFillManagerServiceField.set(AutoFillManagerInstance, AutoFillManagerProxy); } catch (Throwable tr) { Log.e(TAG, "AutoFillManagerStub inject error.", tr); return; } addMethodProxy(new ReplacePkgAndComponentProxy("startSession")); addMethodProxy(new ReplacePkgAndComponentProxy("updateOrRestartSession")); addMethodProxy(new ReplaceLastPkgMethodProxy("isServiceEnabled")); }
@SuppressLint("WrongConstant") @Override public void inject() throws Throwable { super.inject(); try { Object AutoFillManagerInstance = getContext().getSystemService(AUTO_FILL_NAME); if (AutoFillManagerInstance == null) { throw new NullPointerException("AutoFillManagerInstance is null."); } Object AutoFillManagerProxy = getInvocationStub().getProxyInterface(); if (AutoFillManagerProxy == null) { throw new NullPointerException("AutoFillManagerProxy is null."); } Field AutoFillManagerServiceField = AutoFillManagerInstance.getClass().getDeclaredField("mService"); AutoFillManagerServiceField.setAccessible(true); AutoFillManagerServiceField.set(AutoFillManagerInstance, AutoFillManagerProxy); } catch (Throwable tr) { Log.e(TAG, "AutoFillManagerStub inject error.", tr); return; } addMethodProxy(new ReplacePkgAndComponentProxy("startSession")); addMethodProxy(new ReplacePkgAndComponentProxy("updateOrRestartSession")); addMethodProxy(new ReplaceLastPkgMethodProxy("isServiceEnabled")); }
@Override public boolean beforeCall(Object who, Method method, Object... args) { replaceLastAppComponent(args, getHostPkg()); return super.beforeCall(who, method, args); }