Search in sources :

Example 1 with ReplaceSequencePkgHook

use of com.lody.virtual.client.hook.base.ReplaceSequencePkgHook in project VirtualApp by asLody.

the class PowerManagerPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ReplaceSequencePkgHook("acquireWakeLock", 2) {

        @Override
        public Object call(Object who, Method method, Object... args) throws Throwable {
            try {
                return super.call(who, method, args);
            } catch (InvocationTargetException e) {
                return onHandleError(e);
            }
        }
    });
    addHook(new ReplaceLastPkgHook("acquireWakeLockWithUid") {

        @Override
        public Object call(Object who, Method method, Object... args) throws Throwable {
            try {
                return super.call(who, method, args);
            } catch (InvocationTargetException e) {
                return onHandleError(e);
            }
        }
    });
    addHook(new ResultStaticHook("updateWakeLockWorkSource", 0));
}
Also used : ReplaceSequencePkgHook(com.lody.virtual.client.hook.base.ReplaceSequencePkgHook) ReplaceLastPkgHook(com.lody.virtual.client.hook.base.ReplaceLastPkgHook) ResultStaticHook(com.lody.virtual.client.hook.base.ResultStaticHook) Method(java.lang.reflect.Method) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 2 with ReplaceSequencePkgHook

use of com.lody.virtual.client.hook.base.ReplaceSequencePkgHook in project VirtualApp by asLody.

the class TelephonyRegistryPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ReplaceCallingPkgHook("listen"));
    addHook(new ReplaceSequencePkgHook("listenForSubscriber", 1));
}
Also used : ReplaceSequencePkgHook(com.lody.virtual.client.hook.base.ReplaceSequencePkgHook) ReplaceCallingPkgHook(com.lody.virtual.client.hook.base.ReplaceCallingPkgHook)

Aggregations

ReplaceSequencePkgHook (com.lody.virtual.client.hook.base.ReplaceSequencePkgHook)2 ReplaceCallingPkgHook (com.lody.virtual.client.hook.base.ReplaceCallingPkgHook)1 ReplaceLastPkgHook (com.lody.virtual.client.hook.base.ReplaceLastPkgHook)1 ResultStaticHook (com.lody.virtual.client.hook.base.ResultStaticHook)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1