Search in sources :

Example 6 with ReplaceCallingPkgHook

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

the class MmsPatch method onBindHooks.

@Override
protected void onBindHooks() {
    addHook(new ReplaceSpecPkgHook("sendMessage", 1));
    addHook(new ReplaceSpecPkgHook("downloadMessage", 1));
    addHook(new ReplaceCallingPkgHook("importTextMessage"));
    addHook(new ReplaceCallingPkgHook("importMultimediaMessage"));
    addHook(new ReplaceCallingPkgHook("deleteStoredMessage"));
    addHook(new ReplaceCallingPkgHook("deleteStoredConversation"));
    addHook(new ReplaceCallingPkgHook("updateStoredMessageStatus"));
    addHook(new ReplaceCallingPkgHook("archiveStoredConversation"));
    addHook(new ReplaceCallingPkgHook("addTextMessageDraft"));
    addHook(new ReplaceCallingPkgHook("addMultimediaMessageDraft"));
    addHook(new ReplaceSpecPkgHook("sendStoredMessage", 1));
    addHook(new ReplaceCallingPkgHook("setAutoPersisting"));
}
Also used : ReplaceCallingPkgHook(com.lody.virtual.client.hook.base.ReplaceCallingPkgHook) ReplaceSpecPkgHook(com.lody.virtual.client.hook.base.ReplaceSpecPkgHook)

Example 7 with ReplaceCallingPkgHook

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

the class PhoneSubInfoPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ReplaceLastPkgHook("getNaiForSubscriber"));
    addHook(new ReplaceLastPkgHook("getImeiForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getDeviceSvn"));
    addHook(new ReplaceLastPkgHook("getDeviceSvnUsingSubId"));
    addHook(new ReplaceCallingPkgHook("getSubscriberId"));
    addHook(new ReplaceLastPkgHook("getSubscriberIdForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getGroupIdLevel1"));
    addHook(new ReplaceLastPkgHook("getGroupIdLevel1ForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getLine1Number"));
    addHook(new ReplaceLastPkgHook("getLine1NumberForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getLine1AlphaTag"));
    addHook(new ReplaceLastPkgHook("getLine1AlphaTagForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getMsisdn"));
    addHook(new ReplaceLastPkgHook("getMsisdnForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getVoiceMailNumber"));
    addHook(new ReplaceLastPkgHook("getVoiceMailNumberForSubscriber"));
    addHook(new ReplaceCallingPkgHook("getVoiceMailAlphaTag"));
    addHook(new ReplaceLastPkgHook("getVoiceMailAlphaTagForSubscriber"));
    // The following method maybe need to fake
    //addHook(new ReplaceCallingPkgHook("getDeviceId"));
    addHook(new ReplaceCallingPkgHook("getIccSerialNumber"));
    addHook(new ReplaceLastPkgHook("getIccSerialNumberForSubscriber"));
}
Also used : ReplaceCallingPkgHook(com.lody.virtual.client.hook.base.ReplaceCallingPkgHook) ReplaceLastPkgHook(com.lody.virtual.client.hook.base.ReplaceLastPkgHook)

Example 8 with ReplaceCallingPkgHook

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

the class ISmsPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        addHook(new ReplaceSpecPkgHook("getAllMessagesFromIccEfForSubscriber", 1));
        addHook(new ReplaceSpecPkgHook("updateMessageOnIccEfForSubscriber", 1));
        addHook(new ReplaceSpecPkgHook("copyMessageToIccEfForSubscriber", 1));
        addHook(new ReplaceSpecPkgHook("sendDataForSubscriber", 1));
        addHook(new ReplaceSpecPkgHook("sendDataForSubscriberWithSelfPermissions", 1));
        addHook(new ReplaceSpecPkgHook("sendTextForSubscriber", 1));
        addHook(new ReplaceSpecPkgHook("sendTextForSubscriberWithSelfPermissions", 1));
        addHook(new ReplaceSpecPkgHook("sendMultipartTextForSubscriber", 1));
        addHook(new ReplaceSpecPkgHook("sendStoredText", 1));
        addHook(new ReplaceSpecPkgHook("sendStoredMultipartText", 1));
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        addHook(new ReplaceCallingPkgHook("getAllMessagesFromIccEf"));
        addHook(new ReplaceSpecPkgHook("getAllMessagesFromIccEfForSubscriber", 1));
        addHook(new ReplaceCallingPkgHook("updateMessageOnIccEf"));
        addHook(new ReplaceSpecPkgHook("updateMessageOnIccEfForSubscriber", 1));
        addHook(new ReplaceCallingPkgHook("copyMessageToIccEf"));
        addHook(new ReplaceSpecPkgHook("copyMessageToIccEfForSubscriber", 1));
        addHook(new ReplaceCallingPkgHook("sendData"));
        addHook(new ReplaceSpecPkgHook("sendDataForSubscriber", 1));
        addHook(new ReplaceCallingPkgHook("sendText"));
        addHook(new ReplaceSpecPkgHook("sendTextForSubscriber", 1));
        addHook(new ReplaceCallingPkgHook("sendMultipartText"));
        addHook(new ReplaceSpecPkgHook("sendMultipartTextForSubscriber", 1));
        addHook(new ReplaceSpecPkgHook("sendStoredText", 1));
        addHook(new ReplaceSpecPkgHook("sendStoredMultipartText", 1));
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        addHook(new ReplaceCallingPkgHook("getAllMessagesFromIccEf"));
        addHook(new ReplaceCallingPkgHook("updateMessageOnIccEf"));
        addHook(new ReplaceCallingPkgHook("copyMessageToIccEf"));
        addHook(new ReplaceCallingPkgHook("sendData"));
        addHook(new ReplaceCallingPkgHook("sendText"));
        addHook(new ReplaceCallingPkgHook("sendMultipartText"));
    }
}
Also used : ReplaceCallingPkgHook(com.lody.virtual.client.hook.base.ReplaceCallingPkgHook) ReplaceSpecPkgHook(com.lody.virtual.client.hook.base.ReplaceSpecPkgHook)

Example 9 with ReplaceCallingPkgHook

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

the class ActivityManagerPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    if (VirtualCore.get().isVAppProcess()) {
        addHook(new ReplaceLastUidHook("checkPermissionWithToken"));
        addHook(new isUserRunning());
        addHook(new ResultStaticHook("updateConfiguration", 0));
        addHook(new ReplaceCallingPkgHook("setAppLockedVerifying"));
        addHook(new StaticHook("checkUriPermission") {

            @Override
            public Object afterCall(Object who, Method method, Object[] args, Object result) throws Throwable {
                return PackageManager.PERMISSION_GRANTED;
            }
        });
        addHook(new StaticHook("getRecentTasks") {

            @Override
            public Object call(Object who, Method method, Object... args) throws Throwable {
                Object _infos = method.invoke(who, args);
                //noinspection unchecked
                List<ActivityManager.RecentTaskInfo> infos = ParceledListSliceCompat.isReturnParceledListSlice(method) ? ParceledListSlice.getList.call(_infos) : (List) _infos;
                for (ActivityManager.RecentTaskInfo info : infos) {
                    AppTaskInfo taskInfo = VActivityManager.get().getTaskInfo(info.id);
                    if (taskInfo == null) {
                        continue;
                    }
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                        info.baseActivity = taskInfo.baseActivity;
                        info.topActivity = taskInfo.topActivity;
                    }
                    info.origActivity = taskInfo.baseActivity;
                    info.baseIntent = taskInfo.baseIntent;
                }
                return _infos;
            }
        });
    }
}
Also used : ReplaceLastUidHook(com.lody.virtual.client.hook.base.ReplaceLastUidHook) ReplaceCallingPkgHook(com.lody.virtual.client.hook.base.ReplaceCallingPkgHook) StaticHook(com.lody.virtual.client.hook.base.StaticHook) ResultStaticHook(com.lody.virtual.client.hook.base.ResultStaticHook) Method(java.lang.reflect.Method) ActivityManager(android.app.ActivityManager) IActivityManager(mirror.android.app.IActivityManager) VActivityManager(com.lody.virtual.client.ipc.VActivityManager) AppTaskInfo(com.lody.virtual.remote.AppTaskInfo) ResultStaticHook(com.lody.virtual.client.hook.base.ResultStaticHook) List(java.util.List)

Example 10 with ReplaceCallingPkgHook

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

the class ISubPatch method onBindHooks.

@Override
protected void onBindHooks() {
    super.onBindHooks();
    addHook(new ReplaceCallingPkgHook("getAllSubInfoList"));
    addHook(new ReplaceCallingPkgHook("getAllSubInfoCount"));
    addHook(new ReplaceLastPkgHook("getActiveSubscriptionInfo"));
    addHook(new ReplaceLastPkgHook("getActiveSubscriptionInfoForIccId"));
    addHook(new ReplaceLastPkgHook("getActiveSubscriptionInfoForSimSlotIndex"));
    addHook(new ReplaceLastPkgHook("getActiveSubscriptionInfoList"));
    addHook(new ReplaceLastPkgHook("getActiveSubInfoCount"));
    addHook(new ReplaceLastPkgHook("getSubscriptionProperty"));
}
Also used : ReplaceCallingPkgHook(com.lody.virtual.client.hook.base.ReplaceCallingPkgHook) ReplaceLastPkgHook(com.lody.virtual.client.hook.base.ReplaceLastPkgHook)

Aggregations

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