コード例 #1
0
 @Override
 public Object onHook(Object who, Method method, Object... args) throws Throwable {
   HookUtils.replaceLastAppPkg(args);
   Intent service = (Intent) args[0];
   String resolvedType = (String) args[1];
   return LocalServiceManager.getInstance().peekService(service, resolvedType);
 }
コード例 #2
0
 @Override
 public Object onHook(Object who, Method method, Object... args) throws Throwable {
   IApplicationThread appThread = (IApplicationThread) args[0];
   Intent service = (Intent) args[1];
   String resolvedType = (String) args[2];
   if (service != null
       && service.getComponent() != null
       && getHostPkg().equals(service.getComponent().getPackageName())) {
     // for server process
     return method.invoke(who, args);
   }
   ServiceInfo serviceInfo = VirtualCore.getCore().resolveServiceInfo(service);
   if (serviceInfo != null) {
     String pkgName = serviceInfo.packageName;
     if (pkgName.equals(getHostPkg())) {
       return method.invoke(who, args);
     }
     if (isAppPkg(pkgName)) {
       return LocalServiceManager.getInstance()
           .startService(appThread.asBinder(), service, resolvedType);
     }
   }
   return method.invoke(who, args);
 }