Skip to content

Commit

Permalink
Preload more google package.
Browse files Browse the repository at this point in the history
  • Loading branch information
asLody committed Aug 13, 2016
1 parent bb68dd8 commit ea0f6d8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
22 changes: 16 additions & 6 deletions VirtualApp/app/src/main/java/io/virtualapp/VApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@
*/
public class VApp extends Application {

private static final String[] GMS_PKG = {
"com.android.vending",

"com.google.android.gsf",
"com.google.android.gsf.login",
"com.google.android.gms",

"com.google.android.backuptransport",
"com.google.android.backup",
"com.google.android.configupdater",
"com.google.android.syncadapters.contacts",
"com.google.android.feedback",
"com.google.android.onetimeinitializer",
"com.google.android.partnersetup",
"com.google.android.setupwizard",
"com.google.android.syncadapters.calendar",};
private static VApp gDefault;

public static VApp getApp() {
Expand Down Expand Up @@ -43,12 +59,6 @@ public void onCreate() {
}
}

private static final String[] GMS_PKG = {
"com.google.android.gsf",
"com.google.android.gsf.login",
"com.google.android.gms",
"com.android.vending"
};
private void installGms() {
PackageManager pm = VirtualCore.getCore().getUnHookPackageManager();
for (String pkg : GMS_PKG) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.lody.virtual.client.hook.patchs.pm;

import java.lang.reflect.Method;
import android.content.pm.PackageInfo;

import com.lody.virtual.client.fixer.ComponentFixer;
import com.lody.virtual.client.hook.base.Hook;
import com.lody.virtual.client.local.VPackageManager;
import com.lody.virtual.helper.utils.ComponentUtils;

import android.content.pm.PackageInfo;
import java.lang.reflect.Method;
/**
* @author Lody
*
Expand Down Expand Up @@ -40,6 +40,9 @@ public Object onHook(Object who, Method method, Object... args) throws Throwable
}
packageInfo = (PackageInfo) method.invoke(who, args);
if (packageInfo != null) {
if (packageInfo.packageName.startsWith("com.google")) {
return null;
}
if (getHostPkg().equals(packageInfo.packageName) || ComponentUtils.isSystemApp(packageInfo)) {
return packageInfo;
}
Expand Down

0 comments on commit ea0f6d8

Please sign in to comment.