Search in sources :

Example 1 with ReplaceLastPkgHook

use of com.lody.virtual.client.hook.base.ReplaceLastPkgHook 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 ReplaceLastPkgHook

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

the class TelephonyPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    //addHook(new ReplaceCallingPkgHook("getDeviceId"));
    addHook(new ReplaceCallingPkgHook("getNeighboringCellInfo"));
    addHook(new ReplaceCallingPkgHook("getAllCellInfo"));
    addHook(new ReplaceCallingPkgHook("getCellLocation"));
    addHook(new ReplaceCallingPkgHook("isOffhook"));
    addHook(new ReplaceLastPkgHook("getLine1NumberForDisplay"));
    addHook(new ReplaceLastPkgHook("isOffhookForSubscriber"));
    addHook(new ReplaceLastPkgHook("isRingingForSubscriber"));
    addHook(new ReplaceCallingPkgHook("call"));
    addHook(new ReplaceCallingPkgHook("isRinging"));
    addHook(new ReplaceCallingPkgHook("isIdle"));
    addHook(new ReplaceLastPkgHook("isIdleForSubscriber"));
    addHook(new ReplaceCallingPkgHook("isRadioOn"));
    addHook(new ReplaceLastPkgHook("isRadioOnForSubscriber"));
    addHook(new ReplaceLastPkgHook("isSimPinEnabled"));
    addHook(new ReplaceLastPkgHook("getCdmaEriIconIndex"));
    addHook(new ReplaceLastPkgHook("getCdmaEriIconIndexForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getCdmaEriIconMode"));
    addHook(new ReplaceLastPkgHook("getCdmaEriIconModeForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getCdmaEriText"));
    addHook(new ReplaceLastPkgHook("getCdmaEriTextForSubscriber"));
    addHook(new ReplaceLastPkgHook("getNetworkTypeForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getDataNetworkType"));
    addHook(new ReplaceLastPkgHook("getDataNetworkTypeForSubscriber"));
    addHook(new ReplaceLastPkgHook("getVoiceNetworkTypeForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getLteOnCdmaMode"));
    addHook(new ReplaceLastPkgHook("getLteOnCdmaModeForSubscriber"));
    addHook(new ReplaceLastPkgHook("getCalculatedPreferredNetworkType"));
    addHook(new ReplaceLastPkgHook("getPcscfAddress"));
    addHook(new ReplaceLastPkgHook("getLine1AlphaTagForDisplay"));
    addHook(new ReplaceCallingPkgHook("getMergedSubscriberIds"));
    addHook(new ReplaceLastPkgHook("getRadioAccessFamily"));
    addHook(new ReplaceCallingPkgHook("isVideoCallingEnabled"));
}
Also used : ReplaceCallingPkgHook(com.lody.virtual.client.hook.base.ReplaceCallingPkgHook) ReplaceLastPkgHook(com.lody.virtual.client.hook.base.ReplaceLastPkgHook)

Example 3 with ReplaceLastPkgHook

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

the class AppOpsManagerPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new BaseHook("checkOperation", 1, 2));
    addHook(new BaseHook("noteOperation", 1, 2));
    addHook(new BaseHook("startOperation", 2, 3));
    addHook(new BaseHook("finishOperation", 2, 3));
    addHook(new BaseHook("startWatchingMode", -1, 1));
    addHook(new BaseHook("checkPackage", 0, 1));
    addHook(new BaseHook("getOpsForPackage", 0, 1));
    addHook(new BaseHook("setMode", 1, 2));
    addHook(new BaseHook("checkAudioOperation", 2, 3));
    addHook(new BaseHook("setAudioRestriction", 2, -1));
    addHook(new BaseHook("noteProxyOperation", 2, 3));
    addHook(new ReplaceLastPkgHook("resetAllModes"));
}
Also used : ReplaceLastPkgHook(com.lody.virtual.client.hook.base.ReplaceLastPkgHook)

Example 4 with ReplaceLastPkgHook

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

the class AudioManagerPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ReplaceLastPkgHook("adjustVolume"));
    addHook(new ReplaceLastPkgHook("adjustLocalOrRemoteStreamVolume"));
    addHook(new ReplaceLastPkgHook("adjustSuggestedStreamVolume"));
    addHook(new ReplaceLastPkgHook("adjustStreamVolume"));
    addHook(new ReplaceLastPkgHook("adjustMasterVolume"));
    addHook(new ReplaceLastPkgHook("setStreamVolume"));
    addHook(new ReplaceLastPkgHook("setMasterVolume"));
    addHook(new ReplaceLastPkgHook("setMicrophoneMute"));
    addHook(new ReplaceLastPkgHook("setRingerModeExternal"));
    addHook(new ReplaceLastPkgHook("setRingerModeInternal"));
    addHook(new ReplaceLastPkgHook("setMode"));
    addHook(new ReplaceLastPkgHook("avrcpSupportsAbsoluteVolume"));
    addHook(new ReplaceLastPkgHook("abandonAudioFocus"));
    addHook(new ReplaceLastPkgHook("requestAudioFocus"));
    addHook(new ReplaceLastPkgHook("setWiredDeviceConnectionState"));
    addHook(new ReplaceLastPkgHook("setSpeakerphoneOn"));
    addHook(new ReplaceLastPkgHook("setBluetoothScoOn"));
    addHook(new ReplaceLastPkgHook("stopBluetoothSco"));
    addHook(new ReplaceLastPkgHook("startBluetoothSco"));
    addHook(new ReplaceLastPkgHook("disableSafeMediaVolume"));
    addHook(new ReplaceLastPkgHook("registerRemoteControlClient"));
    addHook(new ReplaceLastPkgHook("unregisterAudioFocusClient"));
}
Also used : ReplaceLastPkgHook(com.lody.virtual.client.hook.base.ReplaceLastPkgHook)

Example 5 with ReplaceLastPkgHook

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

the class ClipBoardPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ReplaceLastPkgHook("getPrimaryClip"));
    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR1) {
        addHook(new ReplaceLastPkgHook("setPrimaryClip"));
        addHook(new ReplaceLastPkgHook("getPrimaryClipDescription"));
        addHook(new ReplaceLastPkgHook("hasPrimaryClip"));
        addHook(new ReplaceLastPkgHook("addPrimaryClipChangedListener"));
        addHook(new ReplaceLastPkgHook("removePrimaryClipChangedListener"));
        addHook(new ReplaceLastPkgHook("hasClipboardText"));
    }
}
Also used : ReplaceLastPkgHook(com.lody.virtual.client.hook.base.ReplaceLastPkgHook)

Aggregations

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