Search in sources :

Example 1 with ResultStaticHook

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

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

the class UserManagerPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ReplaceCallingPkgHook("setApplicationRestrictions"));
    addHook(new ReplaceCallingPkgHook("getApplicationRestrictions"));
    addHook(new ReplaceCallingPkgHook("getApplicationRestrictionsForUser"));
    addHook(new ResultStaticHook("getProfileParent", null));
    addHook(new ResultStaticHook("getUserIcon", null));
    addHook(new ResultStaticHook("getUserInfo", null));
    addHook(new ResultStaticHook("getDefaultGuestRestrictions", null));
    addHook(new ResultStaticHook("setDefaultGuestRestrictions", null));
    addHook(new ResultStaticHook("removeRestrictions", null));
    addHook(new ResultStaticHook("getUsers", Collections.EMPTY_LIST));
    addHook(new ResultStaticHook("createUser", null));
    addHook(new ResultStaticHook("createProfileForUser", null));
    addHook(new ResultStaticHook("getProfiles", Collections.EMPTY_LIST));
}
Also used : ReplaceCallingPkgHook(com.lody.virtual.client.hook.base.ReplaceCallingPkgHook) ResultStaticHook(com.lody.virtual.client.hook.base.ResultStaticHook)

Example 3 with ResultStaticHook

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

the class BackupManagerPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ResultStaticHook("dataChanged", null));
    addHook(new ResultStaticHook("clearBackupData", null));
    addHook(new ResultStaticHook("agentConnected", null));
    addHook(new ResultStaticHook("agentDisconnected", null));
    addHook(new ResultStaticHook("restoreAtInstall", null));
    addHook(new ResultStaticHook("setBackupEnabled", null));
    addHook(new ResultStaticHook("setBackupProvisioned", null));
    addHook(new ResultStaticHook("backupNow", null));
    addHook(new ResultStaticHook("fullBackup", null));
    addHook(new ResultStaticHook("fullTransportBackup", null));
    addHook(new ResultStaticHook("fullRestore", null));
    addHook(new ResultStaticHook("acknowledgeFullBackupOrRestore", null));
    addHook(new ResultStaticHook("getCurrentTransport", null));
    addHook(new ResultStaticHook("listAllTransports", new String[0]));
    addHook(new ResultStaticHook("selectBackupTransport", null));
    addHook(new ResultStaticHook("isBackupEnabled", false));
    addHook(new ResultStaticHook("setBackupPassword", true));
    addHook(new ResultStaticHook("hasBackupPassword", false));
    addHook(new ResultStaticHook("beginRestoreSession", null));
}
Also used : ResultStaticHook(com.lody.virtual.client.hook.base.ResultStaticHook)

Example 4 with ResultStaticHook

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

the class PersistentDataBlockServicePatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ResultStaticHook("write", -1));
    addHook(new ResultStaticHook("read", new byte[0]));
    addHook(new ResultStaticHook("wipe", null));
    addHook(new ResultStaticHook("getDataBlockSize", 0));
    addHook(new ResultStaticHook("getMaximumDataBlockSize", 0));
    addHook(new ResultStaticHook("setOemUnlockEnabled", 0));
    addHook(new ResultStaticHook("getOemUnlockEnabled", false));
}
Also used : ResultStaticHook(com.lody.virtual.client.hook.base.ResultStaticHook)

Example 5 with ResultStaticHook

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

the class PackageManagerPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ResultStaticHook("addPermissionAsync", true));
    addHook(new ResultStaticHook("addPermission", true));
}
Also used : ResultStaticHook(com.lody.virtual.client.hook.base.ResultStaticHook)

Aggregations

ResultStaticHook (com.lody.virtual.client.hook.base.ResultStaticHook)8 ReplaceCallingPkgHook (com.lody.virtual.client.hook.base.ReplaceCallingPkgHook)2 Method (java.lang.reflect.Method)2 ActivityManager (android.app.ActivityManager)1 ReplaceLastPkgHook (com.lody.virtual.client.hook.base.ReplaceLastPkgHook)1 ReplaceLastUidHook (com.lody.virtual.client.hook.base.ReplaceLastUidHook)1 ReplaceSequencePkgHook (com.lody.virtual.client.hook.base.ReplaceSequencePkgHook)1 StaticHook (com.lody.virtual.client.hook.base.StaticHook)1 VActivityManager (com.lody.virtual.client.ipc.VActivityManager)1 AppTaskInfo (com.lody.virtual.remote.AppTaskInfo)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 List (java.util.List)1 IActivityManager (mirror.android.app.IActivityManager)1