Created
May 7, 2014 04:21
-
-
Save ma34s/ab1c74311bd0c90ae82e to your computer and use it in GitHub Desktop.
LGL22のcom\android\server\pm\PackageManagerService.javaのjavaソース化
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. | |
// Jad home page: http://www.kpdus.com/jad.html | |
// Decompiler options: packimports(3) ansi | |
package com.android.server.pm; | |
import android.app.*; | |
import android.app.admin.IDevicePolicyManager; | |
import android.app.backup.IBackupManager; | |
import android.content.*; | |
import android.content.pm.*; | |
import android.content.res.Resources; | |
import android.content.thm.IThemeIconManager; | |
import android.net.Uri; | |
import android.os.*; | |
import android.os.storage.IMountService; | |
import android.security.SystemKeyStore; | |
import android.util.*; | |
import android.view.Display; | |
import android.view.WindowManager; | |
import com.android.internal.app.IMediaContainerService; | |
import com.android.internal.app.ResolverActivity; | |
import com.android.internal.content.NativeLibraryHelper; | |
import com.android.internal.content.PackageHelper; | |
import com.android.internal.util.*; | |
import com.android.server.*; | |
import com.android.services.SecurityBridge.api.PackageManagerMonitor; | |
import com.lge.cappuccino.IMdm; | |
import com.lge.cappuccino.Mdm; | |
import com.lge.config.ConfigBuildFlags; | |
import com.lge.config.ThreelmMdmConfig; | |
import com.lguplus.common_api.permission.PermissionsProxy; | |
import dalvik.system.DexFile; | |
import dalvik.system.StaleDexCacheError; | |
import java.io.*; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.PublicKey; | |
import java.security.cert.CertificateException; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.*; | |
import libcore.io.*; | |
import org.xmlpull.v1.*; | |
// Referenced classes of package com.android.server.pm: | |
// Settings, UserManagerService, Installer, PackageSetting, | |
// GrantedPermissions, PackageSettingBase, BasePermission, PackageSignatures, | |
// SharedUserSetting, PackageVerificationState, PackageScanState, PreferredActivity, | |
// PreferredIntentResolver, PackageVerificationResponse | |
public class PackageManagerService extends android.content.pm.IPackageManager.Stub | |
{ | |
private final class ActivityIntentResolver extends IntentResolver | |
{ | |
public final void addActivity(android.content.pm.PackageParser.Activity activity, String s) | |
{ | |
boolean flag = PackageManagerService.isSystemApp(((ComponentInfo) (activity.info)).applicationInfo); | |
mActivities.put(activity.getComponentName(), activity); | |
int i = ((android.content.pm.PackageParser.Component) (activity)).intents.size(); | |
for(int j = 0; j < i; j++) | |
{ | |
android.content.pm.PackageParser.ActivityIntentInfo activityintentinfo = (android.content.pm.PackageParser.ActivityIntentInfo)((android.content.pm.PackageParser.Component) (activity)).intents.get(j); | |
if(!flag && activityintentinfo.getPriority() > 0 && "activity".equals(s)) | |
{ | |
activityintentinfo.setPriority(0); | |
Log.w("PackageManager", (new StringBuilder()).append("Package ").append(((PackageItemInfo) (((ComponentInfo) (activity.info)).applicationInfo)).packageName).append(" has activity ").append(((android.content.pm.PackageParser.Component) (activity)).className).append(" with priority > 0, forcing to 0").toString()); | |
} | |
if(!activityintentinfo.debugCheck()) | |
Log.w("PackageManager", (new StringBuilder()).append("==> For Activity ").append(((PackageItemInfo) (activity.info)).name).toString()); | |
addFilter(activityintentinfo); | |
} | |
} | |
protected volatile boolean allowFilterResult(IntentFilter intentfilter, List list) | |
{ | |
return allowFilterResult((android.content.pm.PackageParser.ActivityIntentInfo)intentfilter, list); | |
} | |
protected boolean allowFilterResult(android.content.pm.PackageParser.ActivityIntentInfo activityintentinfo, List list) | |
{ | |
ActivityInfo activityinfo = activityintentinfo.activity.info; | |
for(int i = -1 + list.size(); i >= 0; i--) | |
{ | |
ActivityInfo activityinfo1 = ((ResolveInfo)list.get(i)).activityInfo; | |
if(((PackageItemInfo) (activityinfo1)).name == ((PackageItemInfo) (activityinfo)).name && ((PackageItemInfo) (activityinfo1)).packageName == ((PackageItemInfo) (activityinfo)).packageName) | |
return false; | |
} | |
return true; | |
} | |
protected volatile void dumpFilter(PrintWriter printwriter, String s, IntentFilter intentfilter) | |
{ | |
dumpFilter(printwriter, s, (android.content.pm.PackageParser.ActivityIntentInfo)intentfilter); | |
} | |
protected void dumpFilter(PrintWriter printwriter, String s, android.content.pm.PackageParser.ActivityIntentInfo activityintentinfo) | |
{ | |
printwriter.print(s); | |
printwriter.print(Integer.toHexString(System.identityHashCode(activityintentinfo.activity))); | |
printwriter.print(' '); | |
printwriter.print(activityintentinfo.activity.getComponentShortName()); | |
printwriter.print(" filter "); | |
printwriter.println(Integer.toHexString(System.identityHashCode(activityintentinfo))); | |
} | |
protected volatile boolean isFilterStopped(IntentFilter intentfilter, int i) | |
{ | |
return isFilterStopped((android.content.pm.PackageParser.ActivityIntentInfo)intentfilter, i); | |
} | |
protected boolean isFilterStopped(android.content.pm.PackageParser.ActivityIntentInfo activityintentinfo, int i) | |
{ | |
if(PackageManagerService.sUserManager.exists(i)) goto _L2; else goto _L1 | |
_L1: | |
return true; | |
_L2: | |
android.content.pm.PackageParser.Package package1 = ((android.content.pm.PackageParser.Component) (activityintentinfo.activity)).owner; | |
if(package1 == null) | |
break; /* Loop/switch isn't completed */ | |
PackageSetting packagesetting = (PackageSetting)package1.mExtras; | |
if(packagesetting == null) | |
break; /* Loop/switch isn't completed */ | |
if((1 & ((GrantedPermissions) (packagesetting)).pkgFlags) != 0 || !packagesetting.getStopped(i)) | |
return false; | |
if(true) goto _L1; else goto _L3 | |
_L3: | |
return false; | |
} | |
protected volatile IntentFilter[] newArray(int i) | |
{ | |
return newArray(i); | |
} | |
protected android.content.pm.PackageParser.ActivityIntentInfo[] newArray(int i) | |
{ | |
return new android.content.pm.PackageParser.ActivityIntentInfo[i]; | |
} | |
protected ResolveInfo newResult(android.content.pm.PackageParser.ActivityIntentInfo activityintentinfo, int i, int j) | |
{ | |
if(PackageManagerService.sUserManager.exists(j) && mSettings.isEnabledLPr(activityintentinfo.activity.info, mFlags, j)) | |
{ | |
android.content.pm.PackageParser.Activity activity = activityintentinfo.activity; | |
if(!mSafeMode || (1 & ((ComponentInfo) (activity.info)).applicationInfo.flags) != 0) | |
{ | |
PackageSetting packagesetting = (PackageSetting)((android.content.pm.PackageParser.Component) (activity)).owner.mExtras; | |
if(packagesetting != null) | |
{ | |
ActivityInfo activityinfo = PackageParser.generateActivityInfo(activity, mFlags, packagesetting.readUserState(j), j); | |
if(activityinfo != null) | |
{ | |
ResolveInfo resolveinfo = new ResolveInfo(); | |
resolveinfo.activityInfo = activityinfo; | |
if((0x40 & mFlags) != 0) | |
resolveinfo.filter = activityintentinfo; | |
resolveinfo.priority = activityintentinfo.getPriority(); | |
resolveinfo.preferredOrder = ((android.content.pm.PackageParser.Component) (activity)).owner.mPreferredOrder; | |
resolveinfo.match = i; | |
resolveinfo.isDefault = ((android.content.pm.PackageParser.IntentInfo) (activityintentinfo)).hasDefault; | |
resolveinfo.labelRes = ((android.content.pm.PackageParser.IntentInfo) (activityintentinfo)).labelRes; | |
resolveinfo.nonLocalizedLabel = ((android.content.pm.PackageParser.IntentInfo) (activityintentinfo)).nonLocalizedLabel; | |
resolveinfo.icon = ((android.content.pm.PackageParser.IntentInfo) (activityintentinfo)).icon; | |
resolveinfo.system = PackageManagerService.isSystemApp(((ComponentInfo) (resolveinfo.activityInfo)).applicationInfo); | |
return resolveinfo; | |
} | |
} | |
} | |
} | |
return null; | |
} | |
protected volatile Object newResult(IntentFilter intentfilter, int i, int j) | |
{ | |
return newResult((android.content.pm.PackageParser.ActivityIntentInfo)intentfilter, i, j); | |
} | |
protected volatile String packageForFilter(IntentFilter intentfilter) | |
{ | |
return packageForFilter((android.content.pm.PackageParser.ActivityIntentInfo)intentfilter); | |
} | |
protected String packageForFilter(android.content.pm.PackageParser.ActivityIntentInfo activityintentinfo) | |
{ | |
return ((android.content.pm.PackageParser.Component) (activityintentinfo.activity)).owner.packageName; | |
} | |
public List queryIntent(Intent intent, String s, int i, int j) | |
{ | |
if(!PackageManagerService.sUserManager.exists(j)) | |
return null; | |
mFlags = i; | |
boolean flag; | |
if((0x10000 & i) != 0) | |
flag = true; | |
else | |
flag = false; | |
return super.queryIntent(intent, s, flag, j); | |
} | |
public List queryIntent(Intent intent, String s, boolean flag, int i) | |
{ | |
if(!PackageManagerService.sUserManager.exists(i)) | |
return null; | |
int j; | |
if(flag) | |
j = 0x10000; | |
else | |
j = 0; | |
mFlags = j; | |
return super.queryIntent(intent, s, flag, i); | |
} | |
public List queryIntentForPackage(Intent intent, String s, int i, ArrayList arraylist, int j) | |
{ | |
while(!PackageManagerService.sUserManager.exists(j) || arraylist == null) | |
return null; | |
mFlags = i; | |
boolean flag; | |
int k; | |
ArrayList arraylist1; | |
if((0x10000 & i) != 0) | |
flag = true; | |
else | |
flag = false; | |
k = arraylist.size(); | |
arraylist1 = new ArrayList(k); | |
for(int l = 0; l < k; l++) | |
{ | |
ArrayList arraylist2 = ((android.content.pm.PackageParser.Component) ((android.content.pm.PackageParser.Activity)arraylist.get(l))).intents; | |
if(arraylist2 != null && arraylist2.size() > 0) | |
{ | |
android.content.pm.PackageParser.ActivityIntentInfo aactivityintentinfo[] = new android.content.pm.PackageParser.ActivityIntentInfo[arraylist2.size()]; | |
arraylist2.toArray(aactivityintentinfo); | |
arraylist1.add(aactivityintentinfo); | |
} | |
} | |
return super.queryIntentFromList(intent, s, flag, arraylist1, j); | |
} | |
public final void removeActivity(android.content.pm.PackageParser.Activity activity, String s) | |
{ | |
mActivities.remove(activity.getComponentName()); | |
int i = ((android.content.pm.PackageParser.Component) (activity)).intents.size(); | |
for(int j = 0; j < i; j++) | |
removeFilter((android.content.pm.PackageParser.ActivityIntentInfo)((android.content.pm.PackageParser.Component) (activity)).intents.get(j)); | |
} | |
protected void sortResults(List list) | |
{ | |
Collections.sort(list, PackageManagerService.mResolvePrioritySorter); | |
} | |
private final HashMap mActivities; | |
private int mFlags; | |
final PackageManagerService this$0; | |
private ActivityIntentResolver() | |
{ | |
this$0 = PackageManagerService.this; | |
super(); | |
mActivities = new HashMap(); | |
} | |
} | |
private final class AppDirObserver extends FileObserver | |
{ | |
public void onEvent(int i, String s) | |
{ | |
int j; | |
int k; | |
j = -1; | |
k = -1; | |
Object obj = mInstallLock; | |
obj; | |
JVM INSTR monitorenter ; | |
File file; | |
String s1; | |
file = null; | |
s1 = null; | |
if(s == null) | |
break MISSING_BLOCK_LABEL_56; | |
File file1 = new File(mRootDir, s); | |
String s5 = file1.getPath(); | |
s1 = s5; | |
file = file1; | |
if(PackageManagerService.isPackageFilename(s)) | |
break MISSING_BLOCK_LABEL_67; | |
obj; | |
JVM INSTR monitorexit ; | |
return; | |
if(!PackageManagerService.ignoreCodePath(s1)) goto _L2; else goto _L1 | |
_L1: | |
obj; | |
JVM INSTR monitorexit ; | |
return; | |
_L5: | |
obj; | |
JVM INSTR monitorexit ; | |
Exception exception; | |
throw exception; | |
_L2: | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mAppDirs.get(s1); | |
int ai[]; | |
PackageSetting packagesetting; | |
ai = null; | |
packagesetting = null; | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_174; | |
packagesetting = (PackageSetting)mSettings.mPackages.get(((PackageItemInfo) (package1.applicationInfo)).packageName); | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_488; | |
int ai1[] = PackageManagerService.sUserManager.getUserIds(); | |
ai = packagesetting.queryInstalledUsers(ai1, true); | |
_L3: | |
int ai2[] = PackageManagerService.sUserManager.getUserIds(); | |
hashmap; | |
JVM INSTR monitorexit ; | |
String s2; | |
int l = i & 0x248; | |
s2 = null; | |
if(l == 0) | |
break MISSING_BLOCK_LABEL_231; | |
s2 = null; | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_231; | |
removePackageLI(packagesetting, true); | |
s2 = ((PackageSettingBase) (packagesetting)).name; | |
j = packagesetting.appId; | |
String s3; | |
int i1 = i & 0x88; | |
s3 = null; | |
if(i1 == 0) | |
break MISSING_BLOCK_LABEL_378; | |
s3 = null; | |
if(package1 != null) | |
break MISSING_BLOCK_LABEL_378; | |
PackageManagerService packagemanagerservice = PackageManagerService.this; | |
byte byte0; | |
android.content.pm.PackageParser.Package package2; | |
HashMap hashmap1; | |
PackageManagerService packagemanagerservice1; | |
String s4; | |
int j1; | |
if(mIsRom) | |
byte0 = 65; | |
else | |
byte0 = 0; | |
package2 = packagemanagerservice.scanPackageLI(file, 4 | (byte0 | 2), 97, System.currentTimeMillis(), UserHandle.ALL); | |
s3 = null; | |
if(package2 == null) | |
break MISSING_BLOCK_LABEL_378; | |
hashmap1 = mPackages; | |
hashmap1; | |
JVM INSTR monitorenter ; | |
packagemanagerservice1 = PackageManagerService.this; | |
s4 = package2.packageName; | |
if(package2.permissions.size() > 0) | |
j1 = 1; | |
else | |
j1 = 0; | |
packagemanagerservice1.updatePermissionsLPw(s4, package2, j1); | |
hashmap1; | |
JVM INSTR monitorexit ; | |
s3 = ((PackageItemInfo) (package2.applicationInfo)).packageName; | |
k = UserHandle.getAppId(package2.applicationInfo.uid); | |
synchronized(mPackages) | |
{ | |
mSettings.writeLPr(); | |
} | |
obj; | |
JVM INSTR monitorexit ; | |
if(s2 != null) | |
{ | |
Bundle bundle = new Bundle(1); | |
bundle.putInt("android.intent.extra.UID", j); | |
bundle.putBoolean("android.intent.extra.DATA_REMOVED", false); | |
PackageManagerService.sendPackageBroadcast("android.intent.action.PACKAGE_REMOVED", s2, bundle, null, null, ai); | |
} | |
Exception exception1; | |
Exception exception2; | |
if(s3 != null) | |
{ | |
Bundle bundle1 = new Bundle(1); | |
bundle1.putInt("android.intent.extra.UID", k); | |
PackageManagerService.sendPackageBroadcast("android.intent.action.PACKAGE_ADDED", s3, bundle1, null, null, ai2); | |
return; | |
} else | |
{ | |
return; | |
} | |
ai = PackageManagerService.sUserManager.getUserIds(); | |
goto _L3 | |
exception1; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
exception2; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception2; | |
exception3; | |
hashmap2; | |
JVM INSTR monitorexit ; | |
throw exception3; | |
exception; | |
continue; /* Loop/switch isn't completed */ | |
exception; | |
if(true) goto _L5; else goto _L4 | |
_L4: | |
} | |
private final boolean mIsRom; | |
private final String mRootDir; | |
final PackageManagerService this$0; | |
public AppDirObserver(String s, int i, boolean flag) | |
{ | |
this$0 = PackageManagerService.this; | |
super(s, i); | |
mRootDir = s; | |
mIsRom = flag; | |
} | |
} | |
class AsecInstallArgs extends InstallArgs | |
{ | |
private void cleanUp() | |
{ | |
PackageHelper.destroySdDir(cid); | |
} | |
private final boolean isExternal() | |
{ | |
return (8 & super.flags) != 0; | |
} | |
private void setCachePath(String s) | |
{ | |
File file = new File(s); | |
libraryPath = (new File(file, "lib")).getPath(); | |
packagePath = (new File(file, "pkg.apk")).getPath(); | |
if(isFwdLocked()) | |
{ | |
resourcePath = (new File(file, "res.zip")).getPath(); | |
return; | |
} else | |
{ | |
resourcePath = packagePath; | |
return; | |
} | |
} | |
boolean checkFreeStorage(IMediaContainerService imediacontainerservice) | |
throws RemoteException | |
{ | |
boolean flag; | |
mContext.grantUriPermission("com.android.defcontainer", super.packageURI, 1); | |
flag = imediacontainerservice.checkExternalFreeStorage(super.packageURI, isFwdLocked()); | |
mContext.revokeUriPermission(super.packageURI, 1); | |
return flag; | |
Exception exception; | |
exception; | |
mContext.revokeUriPermission(super.packageURI, 1); | |
throw exception; | |
} | |
void cleanUpResourcesLI() | |
{ | |
String s = getCodePath(); | |
int i = mInstaller.rmdex(s); | |
if(i < 0) | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't remove dex file for package: at location ").append(s.toString()).append(", retcode=").append(i).toString()); | |
cleanUp(); | |
} | |
int copyApk(IMediaContainerService imediacontainerservice, boolean flag) | |
throws RemoteException | |
{ | |
String s; | |
if(flag) | |
createCopyFile(); | |
else | |
PackageHelper.destroySdDir(cid); | |
mContext.grantUriPermission("com.android.defcontainer", super.packageURI, 1); | |
s = imediacontainerservice.copyResourceToContainer(super.packageURI, cid, getEncryptKey(), "pkg.apk", "res.zip", isExternal(), isFwdLocked()); | |
mContext.revokeUriPermission(super.packageURI, 1); | |
Exception exception; | |
if(s != null) | |
{ | |
setCachePath(s); | |
return 1; | |
} else | |
{ | |
return -18; | |
} | |
exception; | |
mContext.revokeUriPermission(super.packageURI, 1); | |
throw exception; | |
} | |
void createCopyFile() | |
{ | |
cid = PackageManagerService.getTempContainerId(); | |
} | |
int doPostCopy(int i) | |
{ | |
if(isFwdLocked() && (i < 10000 || !PackageHelper.fixSdPermissions(cid, UserHandle.getSharedAppGid(i), "pkg.apk"))) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to finalize ").append(cid).toString()); | |
PackageHelper.destroySdDir(cid); | |
return -18; | |
} else | |
{ | |
return 1; | |
} | |
} | |
boolean doPostDeleteLI(boolean flag) | |
{ | |
boolean flag1 = PackageHelper.isContainerMounted(cid); | |
boolean flag2 = false; | |
if(flag1) | |
flag2 = PackageHelper.unMountSdDir(cid); | |
if(flag2 && flag) | |
cleanUpResourcesLI(); | |
return flag2; | |
} | |
int doPostInstall(int i, int j) | |
{ | |
if(i != 1) | |
{ | |
cleanUp(); | |
} else | |
{ | |
int k; | |
String s; | |
if(isFwdLocked()) | |
{ | |
k = UserHandle.getSharedAppGid(j); | |
s = "pkg.apk"; | |
} else | |
{ | |
k = -1; | |
s = null; | |
} | |
if(j < 10000 || !PackageHelper.fixSdPermissions(cid, k, s)) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to finalize ").append(cid).toString()); | |
PackageHelper.destroySdDir(cid); | |
return -18; | |
} | |
if(!PackageHelper.isContainerMounted(cid)) | |
{ | |
PackageHelper.mountSdDir(cid, getEncryptKey(), Process.myUid()); | |
return i; | |
} | |
} | |
return i; | |
} | |
int doPreCopy() | |
{ | |
return !isFwdLocked() || PackageHelper.fixSdPermissions(cid, getPackageUid("com.android.defcontainer", 0), "pkg.apk") ? 1 : -18; | |
} | |
int doPreInstall(int i) | |
{ | |
if(i != 1) | |
PackageHelper.destroySdDir(cid); | |
else | |
if(!PackageHelper.isContainerMounted(cid)) | |
{ | |
String s = PackageHelper.mountSdDir(cid, getEncryptKey(), 1000); | |
if(s != null) | |
{ | |
setCachePath(s); | |
return i; | |
} else | |
{ | |
return -18; | |
} | |
} | |
return i; | |
} | |
boolean doRename(int i, String s, String s1) | |
{ | |
String s2 = PackageManagerService.getNextCodePath(s1, s, "/pkg.apk"); | |
if(PackageHelper.isContainerMounted(cid) && !PackageHelper.unMountSdDir(cid)) | |
{ | |
Slog.i("PackageManager", (new StringBuilder()).append("Failed to unmount ").append(cid).append(" before renaming").toString()); | |
return false; | |
} | |
if(!PackageHelper.renameSdDir(cid, s2)) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to rename ").append(cid).append(" to ").append(s2).append(" which might be stale. Will try to clean up.").toString()); | |
if(!PackageHelper.destroySdDir(s2)) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Very strange. Cannot clean up stale container ").append(s2).toString()); | |
return false; | |
} | |
if(!PackageHelper.renameSdDir(cid, s2)) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to rename ").append(cid).append(" to ").append(s2).append(" inspite of cleaning it up.").toString()); | |
return false; | |
} | |
} | |
String s3; | |
if(!PackageHelper.isContainerMounted(s2)) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Mounting container ").append(s2).toString()); | |
s3 = PackageHelper.mountSdDir(s2, getEncryptKey(), 1000); | |
} else | |
{ | |
s3 = PackageHelper.getSdDir(s2); | |
} | |
if(s3 == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Failed to get cache path for ").append(s2).toString()); | |
return false; | |
} else | |
{ | |
Log.i("PackageManager", (new StringBuilder()).append("Succesfully renamed ").append(cid).append(" to ").append(s2).append(" at new path: ").append(s3).toString()); | |
cid = s2; | |
setCachePath(s3); | |
return true; | |
} | |
} | |
String getCodePath() | |
{ | |
return packagePath; | |
} | |
String getNativeLibraryPath() | |
{ | |
return libraryPath; | |
} | |
String getPackageName() | |
{ | |
return PackageManagerService.getAsecPackageName(cid); | |
} | |
String getResourcePath() | |
{ | |
return resourcePath; | |
} | |
boolean matchContainer(String s) | |
{ | |
return cid.startsWith(s); | |
} | |
static final String PUBLIC_RES_FILE_NAME = "res.zip"; | |
static final String RES_FILE_NAME = "pkg.apk"; | |
String cid; | |
String libraryPath; | |
String packagePath; | |
String resourcePath; | |
final PackageManagerService this$0; | |
AsecInstallArgs(Uri uri, String s, boolean flag, boolean flag1) | |
{ | |
this$0 = PackageManagerService.this; | |
byte byte0; | |
boolean flag2; | |
if(flag) | |
byte0 = 8; | |
else | |
byte0 = 0; | |
flag2 = false; | |
if(flag1) | |
flag2 = true; | |
super(uri, null, byte0 | flag2, null, null, null, null); | |
cid = s; | |
} | |
AsecInstallArgs(InstallParams installparams) | |
{ | |
this$0 = PackageManagerService.this; | |
super(installparams.getPackageUri(), installparams.observer, installparams.flags, installparams.installerPackageName, installparams.installerSourcePackageName, installparams.getManifestDigest(), installparams.getUser()); | |
} | |
AsecInstallArgs(String s, String s1, String s2, boolean flag, boolean flag1) | |
{ | |
this$0 = PackageManagerService.this; | |
byte byte0; | |
boolean flag2; | |
int i; | |
String s3; | |
if(flag) | |
byte0 = 8; | |
else | |
byte0 = 0; | |
if(flag1) | |
flag2 = true; | |
else | |
flag2 = false; | |
super(null, null, byte0 | flag2, null, null, null, null); | |
i = s.lastIndexOf("/"); | |
s3 = s.substring(0, i); | |
cid = s3.substring(1 + s3.lastIndexOf("/"), i); | |
setCachePath(s3); | |
} | |
AsecInstallArgs(String s, boolean flag) | |
{ | |
this$0 = PackageManagerService.this; | |
byte byte0; | |
boolean flag1; | |
if(isAsecExternal(s)) | |
byte0 = 8; | |
else | |
byte0 = 0; | |
flag1 = false; | |
if(flag) | |
flag1 = true; | |
super(null, null, byte0 | flag1, null, null, null, null); | |
cid = s; | |
setCachePath(PackageHelper.getSdDir(s)); | |
} | |
} | |
private final class ClearStorageConnection | |
implements ServiceConnection | |
{ | |
public void onServiceConnected(ComponentName componentname, IBinder ibinder) | |
{ | |
this; | |
JVM INSTR monitorenter ; | |
mContainerService = com.android.internal.app.IMediaContainerService.Stub.asInterface(ibinder); | |
notifyAll(); | |
this; | |
JVM INSTR monitorexit ; | |
return; | |
Exception exception; | |
exception; | |
this; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public void onServiceDisconnected(ComponentName componentname) | |
{ | |
} | |
IMediaContainerService mContainerService; | |
final PackageManagerService this$0; | |
private ClearStorageConnection() | |
{ | |
this$0 = PackageManagerService.this; | |
super(); | |
} | |
} | |
class DefaultContainerConnection | |
implements ServiceConnection | |
{ | |
public void onServiceConnected(ComponentName componentname, IBinder ibinder) | |
{ | |
IMediaContainerService imediacontainerservice = com.android.internal.app.IMediaContainerService.Stub.asInterface(ibinder); | |
mHandler.sendMessage(mHandler.obtainMessage(3, imediacontainerservice)); | |
} | |
public void onServiceDisconnected(ComponentName componentname) | |
{ | |
} | |
final PackageManagerService this$0; | |
DefaultContainerConnection() | |
{ | |
this$0 = PackageManagerService.this; | |
super(); | |
} | |
} | |
static class DumpState | |
{ | |
public SharedUserSetting getSharedUser() | |
{ | |
return mSharedUser; | |
} | |
public boolean getTitlePrinted() | |
{ | |
return mTitlePrinted; | |
} | |
public boolean isDumping(int i) | |
{ | |
while(mTypes == 0 && i != 1024 || (i & mTypes) != 0) | |
return true; | |
return false; | |
} | |
public boolean isOptionEnabled(int i) | |
{ | |
return (i & mOptions) != 0; | |
} | |
public boolean onTitlePrinted() | |
{ | |
boolean flag = mTitlePrinted; | |
mTitlePrinted = true; | |
return flag; | |
} | |
public void setDump(int i) | |
{ | |
mTypes = i | mTypes; | |
} | |
public void setOptionEnabled(int i) | |
{ | |
mOptions = i | mOptions; | |
} | |
public void setSharedUser(SharedUserSetting sharedusersetting) | |
{ | |
mSharedUser = sharedusersetting; | |
} | |
public void setTitlePrinted(boolean flag) | |
{ | |
mTitlePrinted = flag; | |
} | |
public static final int DUMP_FEATURES = 2; | |
public static final int DUMP_LIBS = 1; | |
public static final int DUMP_MESSAGES = 64; | |
public static final int DUMP_PACKAGES = 16; | |
public static final int DUMP_PERMISSIONS = 8; | |
public static final int DUMP_PREFERRED = 512; | |
public static final int DUMP_PREFERRED_XML = 1024; | |
public static final int DUMP_PROVIDERS = 128; | |
public static final int DUMP_RESOLVERS = 4; | |
public static final int DUMP_SHARED_USERS = 32; | |
public static final int DUMP_VERIFIERS = 256; | |
public static final int OPTION_SHOW_FILTERS = 1; | |
private int mOptions; | |
private SharedUserSetting mSharedUser; | |
private boolean mTitlePrinted; | |
private int mTypes; | |
DumpState() | |
{ | |
} | |
} | |
class FileInstallArgs extends InstallArgs | |
{ | |
private boolean cleanUp() | |
{ | |
boolean flag = true; | |
String s = getCodePath(); | |
String s1 = getResourcePath(); | |
if(s != null) | |
{ | |
File file = new File(s); | |
if(!file.exists()) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package source ").append(s).append(" does not exist.").toString()); | |
flag = false; | |
} | |
file.delete(); | |
} | |
if(s1 != null && !s1.equals(s)) | |
{ | |
File file2 = new File(s1); | |
if(!file2.exists()) | |
Slog.w("PackageManager", (new StringBuilder()).append("Package public source ").append(file2).append(" does not exist.").toString()); | |
if(file2.exists()) | |
file2.delete(); | |
} | |
if(libraryPath != null) | |
{ | |
File file1 = new File(libraryPath); | |
NativeLibraryHelper.removeNativeBinariesFromDirLI(file1); | |
if(!file1.delete()) | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't delete native library directory ").append(libraryPath).toString()); | |
} | |
return flag; | |
} | |
private String getLibraryPathFromCodePath() | |
{ | |
return (new File(mAppLibInstallDir, PackageManagerService.getApkName(getCodePath()))).getPath(); | |
} | |
private String getResourcePathFromCodePath() | |
{ | |
String s = getCodePath(); | |
if(isFwdLocked()) | |
{ | |
StringBuilder stringbuilder = new StringBuilder(); | |
stringbuilder.append(mAppInstallDir.getPath()); | |
stringbuilder.append('/'); | |
stringbuilder.append(PackageManagerService.getApkName(s)); | |
stringbuilder.append(".zip"); | |
if(s.endsWith(".tmp")) | |
stringbuilder.append(".tmp"); | |
s = stringbuilder.toString(); | |
} | |
return s; | |
} | |
private boolean isForcedSystemApp() | |
{ | |
return (0x10000000 & super.flags) != 0; | |
} | |
private boolean setPermissions() | |
{ | |
boolean flag = true; | |
if(!isFwdLocked()) | |
{ | |
int i = FileUtils.setPermissions(getCodePath(), 420, -1, -1); | |
if(i != 0) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Couldn't set new package file permissions for ").append(getCodePath()).append(". The return code was: ").append(i).toString()); | |
flag = false; | |
} | |
} | |
return flag; | |
} | |
boolean checkFreeStorage(IMediaContainerService imediacontainerservice) | |
throws RemoteException | |
{ | |
DeviceStorageMonitorService devicestoragemonitorservice = (DeviceStorageMonitorService)ServiceManager.getService("devicestoragemonitor"); | |
long l; | |
boolean flag; | |
if(devicestoragemonitorservice == null) | |
{ | |
Log.w("PackageManager", "Couldn't get low memory threshold; no free limit imposed"); | |
l = 0L; | |
} else | |
{ | |
if(devicestoragemonitorservice.isMemoryLow()) | |
{ | |
Log.w("PackageManager", "Memory is reported as being too low; aborting package install"); | |
return false; | |
} | |
l = devicestoragemonitorservice.getMemoryLowThreshold(); | |
} | |
mContext.grantUriPermission("com.android.defcontainer", super.packageURI, 1); | |
flag = imediacontainerservice.checkInternalFreeStorage(super.packageURI, isFwdLocked(), l); | |
mContext.revokeUriPermission(super.packageURI, 1); | |
return flag; | |
Exception exception; | |
exception; | |
mContext.revokeUriPermission(super.packageURI, 1); | |
throw exception; | |
} | |
void cleanUpResourcesLI() | |
{ | |
String s = getCodePath(); | |
if(cleanUp()) | |
{ | |
int i = mInstaller.rmdex(s); | |
if(i < 0) | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't remove dex file for package: at location ").append(s).append(", retcode=").append(i).toString()); | |
} | |
} | |
int copyApk(IMediaContainerService imediacontainerservice, boolean flag) | |
throws RemoteException | |
{ | |
int i; | |
File file; | |
i = -4; | |
if(flag) | |
createCopyFile(); | |
file = new File(codeFileName); | |
if(created) goto _L2; else goto _L1 | |
_L1: | |
boolean flag1; | |
try | |
{ | |
file.createNewFile(); | |
flag1 = setPermissions(); | |
} | |
catch(IOException ioexception2) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Failed to create file ").append(file).toString()); | |
return i; | |
} | |
if(flag1) goto _L2; else goto _L3 | |
_L3: | |
return i; | |
_L2: | |
ParcelFileDescriptor parcelfiledescriptor; | |
int j; | |
int k; | |
try | |
{ | |
parcelfiledescriptor = ParcelFileDescriptor.open(file, 0x30000000); | |
} | |
catch(FileNotFoundException filenotfoundexception) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to create file descriptor for : ").append(codeFileName).toString()); | |
return i; | |
} | |
mContext.grantUriPermission("com.android.defcontainer", super.packageURI, 1); | |
j = imediacontainerservice.copyResource(super.packageURI, null, parcelfiledescriptor); | |
k = j; | |
IoUtils.closeQuietly(parcelfiledescriptor); | |
mContext.revokeUriPermission(super.packageURI, 1); | |
if(isFwdLocked()) | |
{ | |
File file1 = new File(getResourcePath()); | |
Exception exception; | |
File file2; | |
int l; | |
try | |
{ | |
PackageHelper.extractPublicFiles(codeFileName, file1); | |
} | |
catch(IOException ioexception) | |
{ | |
Slog.e("PackageManager", "Couldn't create a new zip file for the public parts of a forward-locked app."); | |
file1.delete(); | |
return i; | |
} | |
} | |
file2 = new File(getNativeLibraryPath()); | |
Slog.i("PackageManager", (new StringBuilder()).append("Copying native libraries to ").append(file2.getPath()).toString()); | |
if(file2.exists()) | |
{ | |
NativeLibraryHelper.removeNativeBinariesFromDirLI(file2); | |
file2.delete(); | |
} | |
l = PackageManagerService.copyNativeLibrariesForInternalApp(file, file2); | |
i = l; | |
if(i != 1) goto _L3; else goto _L4 | |
_L4: | |
return k; | |
exception; | |
IoUtils.closeQuietly(parcelfiledescriptor); | |
mContext.revokeUriPermission(super.packageURI, 1); | |
throw exception; | |
IOException ioexception1; | |
ioexception1; | |
Slog.e("PackageManager", "Copying native libraries failed", ioexception1); | |
k = -110; | |
if(true) goto _L4; else goto _L5 | |
_L5: | |
} | |
void createCopyFile() | |
{ | |
File file; | |
if(isFwdLocked()) | |
file = mDrmAppPrivateInstallDir; | |
else | |
file = mAppInstallDir; | |
installDir = file; | |
if(isForcedSystemApp()) | |
installDir = mForcedSystemAppInstallDir; | |
codeFileName = createTempPackageFile(installDir).getPath(); | |
resourceFileName = getResourcePathFromCodePath(); | |
libraryPath = getLibraryPathFromCodePath(); | |
created = true; | |
} | |
boolean doPostDeleteLI(boolean flag) | |
{ | |
cleanUpResourcesLI(); | |
return true; | |
} | |
int doPostInstall(int i, int j) | |
{ | |
if(i != 1) | |
cleanUp(); | |
return i; | |
} | |
int doPreInstall(int i) | |
{ | |
if(i != 1) | |
cleanUp(); | |
return i; | |
} | |
boolean doRename(int i, String s, String s1) | |
{ | |
if(i != 1) | |
{ | |
cleanUp(); | |
} else | |
{ | |
File file = new File(getCodePath()); | |
File file1 = new File(getResourcePath()); | |
File file2 = new File(getNativeLibraryPath()); | |
String s2 = PackageManagerService.getNextCodePath(s1, s, ".apk"); | |
File file3 = new File(installDir, (new StringBuilder()).append(s2).append(".apk").toString()); | |
if(file.renameTo(file3)) | |
{ | |
codeFileName = file3.getPath(); | |
File file4 = new File(getResourcePathFromCodePath()); | |
if(!isFwdLocked() || file1.renameTo(file4)) | |
{ | |
resourceFileName = file4.getPath(); | |
File file5 = new File(getLibraryPathFromCodePath()); | |
if(file5.exists()) | |
{ | |
NativeLibraryHelper.removeNativeBinariesFromDirLI(file5); | |
file5.delete(); | |
} | |
if(!file2.renameTo(file5)) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Cannot rename native library directory ").append(file2.getPath()).append(" to ").append(file5.getPath()).toString()); | |
return false; | |
} | |
libraryPath = file5.getPath(); | |
if(setPermissions() && SELinux.restorecon(file3)) | |
return true; | |
} | |
} | |
} | |
return false; | |
} | |
String getCodePath() | |
{ | |
return codeFileName; | |
} | |
String getNativeLibraryPath() | |
{ | |
if(libraryPath == null) | |
libraryPath = getLibraryPathFromCodePath(); | |
return libraryPath; | |
} | |
String getResourcePath() | |
{ | |
return resourceFileName; | |
} | |
String codeFileName; | |
boolean created; | |
File installDir; | |
String libraryPath; | |
String resourceFileName; | |
final PackageManagerService this$0; | |
FileInstallArgs(Uri uri, String s, String s1) | |
{ | |
this$0 = PackageManagerService.this; | |
super(uri, null, 0, null, null, null, null); | |
created = false; | |
File file; | |
String s2; | |
if(isFwdLocked()) | |
file = mDrmAppPrivateInstallDir; | |
else | |
file = mAppInstallDir; | |
installDir = file; | |
if(isForcedSystemApp()) | |
installDir = mForcedSystemAppInstallDir; | |
s2 = PackageManagerService.getNextCodePath(null, s, ".apk"); | |
codeFileName = (new File(installDir, (new StringBuilder()).append(s2).append(".apk").toString())).getPath(); | |
resourceFileName = getResourcePathFromCodePath(); | |
libraryPath = (new File(mAppLibInstallDir, s)).getPath(); | |
} | |
FileInstallArgs(InstallParams installparams) | |
{ | |
this$0 = PackageManagerService.this; | |
super(installparams.getPackageUri(), installparams.observer, installparams.flags, installparams.installerPackageName, installparams.installerSourcePackageName, installparams.getManifestDigest(), installparams.getUser()); | |
created = false; | |
} | |
FileInstallArgs(String s, String s1, String s2) | |
{ | |
this$0 = PackageManagerService.this; | |
super(null, null, 0, null, null, null, null); | |
created = false; | |
installDir = (new File(s)).getParentFile(); | |
codeFileName = s; | |
resourceFileName = s1; | |
libraryPath = s2; | |
} | |
} | |
private abstract class HandlerParams | |
{ | |
UserHandle getUser() | |
{ | |
return mUser; | |
} | |
abstract void handleReturnCode(); | |
abstract void handleServiceError(); | |
abstract void handleStartCopy() | |
throws RemoteException; | |
final void serviceError() | |
{ | |
handleServiceError(); | |
handleReturnCode(); | |
} | |
final boolean startCopy() | |
{ | |
int i; | |
i = 1 + mRetries; | |
mRetries = i; | |
if(i <= 4) | |
break MISSING_BLOCK_LABEL_47; | |
Slog.w("PackageManager", "Failed to invoke remote methods on default container service. Giving up"); | |
mHandler.sendEmptyMessage(11); | |
handleServiceError(); | |
return false; | |
handleStartCopy(); | |
boolean flag = true; | |
_L2: | |
handleReturnCode(); | |
return flag; | |
RemoteException remoteexception; | |
remoteexception; | |
mHandler.sendEmptyMessage(10); | |
flag = false; | |
if(true) goto _L2; else goto _L1 | |
_L1: | |
} | |
private static final int MAX_RETRIES = 4; | |
private int mRetries; | |
private final UserHandle mUser; | |
final PackageManagerService this$0; | |
HandlerParams(UserHandle userhandle) | |
{ | |
this$0 = PackageManagerService.this; | |
super(); | |
mRetries = 0; | |
mUser = userhandle; | |
} | |
} | |
static abstract class InstallArgs | |
{ | |
abstract boolean checkFreeStorage(IMediaContainerService imediacontainerservice) | |
throws RemoteException; | |
abstract void cleanUpResourcesLI(); | |
abstract int copyApk(IMediaContainerService imediacontainerservice, boolean flag) | |
throws RemoteException; | |
abstract void createCopyFile(); | |
int doPostCopy(int i) | |
{ | |
return 1; | |
} | |
abstract boolean doPostDeleteLI(boolean flag); | |
abstract int doPostInstall(int i, int j); | |
int doPreCopy() | |
{ | |
return 1; | |
} | |
abstract int doPreInstall(int i); | |
abstract boolean doRename(int i, String s, String s1); | |
abstract String getCodePath(); | |
abstract String getNativeLibraryPath(); | |
abstract String getResourcePath(); | |
UserHandle getUser() | |
{ | |
return user; | |
} | |
protected boolean isFwdLocked() | |
{ | |
return (1 & flags) != 0; | |
} | |
final int flags; | |
final String installerPackageName; | |
final String installerSourcePackageName; | |
final ManifestDigest manifestDigest; | |
final IPackageInstallObserver observer; | |
final Uri packageURI; | |
final UserHandle user; | |
InstallArgs(Uri uri, IPackageInstallObserver ipackageinstallobserver, int i, String s, String s1, ManifestDigest manifestdigest, UserHandle userhandle) | |
{ | |
packageURI = uri; | |
flags = i; | |
observer = ipackageinstallobserver; | |
installerPackageName = s; | |
installerSourcePackageName = s1; | |
manifestDigest = manifestdigest; | |
user = userhandle; | |
} | |
} | |
class InstallParams extends HandlerParams | |
{ | |
private int installLocationPolicy(PackageInfoLite packageinfolite, int i) | |
{ | |
int j; | |
String s = packageinfolite.packageName; | |
j = packageinfolite.installLocation; | |
boolean flag; | |
HashMap hashmap; | |
Exception exception; | |
android.content.pm.PackageParser.Package package1; | |
if((i & 8) != 0) | |
flag = true; | |
else | |
flag = false; | |
hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 == null) goto _L2; else goto _L1 | |
_L1: | |
if((i & 2) == 0) goto _L4; else goto _L3 | |
_L3: | |
if((i & 0x80) != 0) | |
break MISSING_BLOCK_LABEL_136; | |
if(packageinfolite.versionCode >= package1.mVersionCode) | |
break MISSING_BLOCK_LABEL_136; | |
Slog.w("PackageManager", (new StringBuilder()).append("Can't install update of ").append(s).append(" update version ").append(packageinfolite.versionCode).append(" is older than installed version ").append(package1.mVersionCode).toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -7; | |
if((1 & package1.applicationInfo.flags) == 0) | |
break MISSING_BLOCK_LABEL_181; | |
if(!flag) | |
break MISSING_BLOCK_LABEL_176; | |
Slog.w("PackageManager", "Cannot install update to system app on sdcard"); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -3; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 1; | |
if(!flag) | |
break MISSING_BLOCK_LABEL_191; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 2; | |
if(j != 1) goto _L6; else goto _L5 | |
_L5: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 1; | |
_L2: | |
hashmap; | |
JVM INSTR monitorexit ; | |
if(flag) | |
return 2; | |
else | |
return packageinfolite.recommendedInstallLocation; | |
_L7: | |
if(PackageManagerService.isExternal(package1)) | |
return 2; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 1; | |
_L4: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -4; | |
_L6: | |
if(j != 2) goto _L7; else goto _L2 | |
} | |
public ManifestDigest getManifestDigest() | |
{ | |
if(verificationParams == null) | |
return null; | |
else | |
return verificationParams.getManifestDigest(); | |
} | |
public Uri getPackageUri() | |
{ | |
if(mTempPackage != null) | |
return Uri.fromFile(mTempPackage); | |
else | |
return mPackageURI; | |
} | |
void handleReturnCode() | |
{ | |
if(mArgs != null) | |
{ | |
processPendingInstall(mArgs, mRet); | |
if(mTempPackage != null && !mTempPackage.delete()) | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't delete temporary file: ").append(mTempPackage.getAbsolutePath()).toString()); | |
} | |
} | |
void handleServiceError() | |
{ | |
mArgs = createInstallArgs(this); | |
mRet = -110; | |
} | |
public void handleStartCopy() | |
throws RemoteException | |
{ | |
int i; | |
boolean flag; | |
boolean flag1; | |
PackageInfoLite packageinfolite; | |
i = 1; | |
int i1; | |
List list; | |
int j1; | |
PackageVerificationState packageverificationstate; | |
ComponentName componentname; | |
if((8 & flags) != 0) | |
flag = true; | |
else | |
flag = false; | |
if((0x10 & flags) != 0) | |
flag1 = true; | |
else | |
flag1 = false; | |
packageinfolite = null; | |
if(!flag1 || !flag) goto _L2; else goto _L1 | |
_L1: | |
Slog.w("PackageManager", "Conflicting flags specified for installing on both internal and external"); | |
i = -19; | |
_L7: | |
InstallArgs installargs; | |
if(i == 1 && packageinfolite != null) | |
{ | |
int i2 = packageinfolite.recommendedInstallLocation; | |
DeviceStorageMonitorService devicestoragemonitorservice; | |
long l; | |
Exception exception; | |
Exception exception1; | |
Context context; | |
Uri uri; | |
SecurityException securityexception; | |
File file; | |
File file1; | |
String s; | |
long l2; | |
FileNotFoundException filenotfoundexception; | |
ParcelFileDescriptor parcelfiledescriptor; | |
ParcelFileDescriptor parcelfiledescriptor1; | |
String s1; | |
if(i2 == -3) | |
i = -19; | |
else | |
if(i2 == -4) | |
i = -1; | |
else | |
if(i2 == -1) | |
i = -4; | |
else | |
if(i2 == -2) | |
i = -2; | |
else | |
if(i2 == -6) | |
i = -3; | |
else | |
if(i2 == -5) | |
{ | |
i = -20; | |
} else | |
{ | |
int j2 = flags; | |
int k2 = installLocationPolicy(packageinfolite, j2); | |
if(k2 == -7) | |
i = -25; | |
else | |
if(!flag && !flag1) | |
if(k2 == 2) | |
{ | |
flags = 8 | flags; | |
flags = 0xffffffef & flags; | |
} else | |
{ | |
flags = 0x10 | flags; | |
flags = -9 & flags; | |
} | |
} | |
} | |
installargs = createInstallArgs(this); | |
mArgs = installargs; | |
if(i == 1 && packageinfolite != null) | |
{ | |
int j = getUser().getIdentifier(); | |
if(j == -1 && (0x20 & flags) != 0) | |
j = 0; | |
int k; | |
if(mRequiredVerifierPackage == null) | |
k = -1; | |
else | |
k = getPackageUid(mRequiredVerifierPackage, j); | |
i1 = -1; | |
if(installerPackageName != null) | |
i1 = checkPermission("com.lge.permission.TRUSTED_INSTALLER", installerPackageName); | |
if(k != -1 && isVerificationEnabled(flags) && i1 != 0) | |
{ | |
Intent intent = new Intent("android.intent.action.PACKAGE_NEEDS_VERIFICATION"); | |
intent.setDataAndType(getPackageUri(), "application/vnd.android.package-archive"); | |
intent.addFlags(1); | |
list = queryIntentReceivers(intent, "application/vnd.android.package-archive", 512, 0); | |
j1 = int i = ((IMediaContainerService) (this)).calculateInstalledSize; | |
intent.putExtra("android.content.pm.extra.VERIFICATION_ID", j1); | |
intent.putExtra("android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE", installerPackageName); | |
intent.putExtra("android.content.pm.extra.VERIFICATION_INSTALL_FLAGS", flags); | |
intent.putExtra("android.content.pm.extra.VERIFICATION_PACKAGE_NAME", packageinfolite.packageName); | |
intent.putExtra("android.content.pm.extra.VERIFICATION_VERSION_CODE", packageinfolite.versionCode); | |
if(verificationParams != null) | |
{ | |
if(verificationParams.getVerificationURI() != null) | |
intent.putExtra("android.content.pm.extra.VERIFICATION_URI", verificationParams.getVerificationURI()); | |
if(verificationParams.getOriginatingURI() != null) | |
intent.putExtra("android.intent.extra.ORIGINATING_URI", verificationParams.getOriginatingURI()); | |
if(verificationParams.getReferrer() != null) | |
intent.putExtra("android.intent.extra.REFERRER", verificationParams.getReferrer()); | |
if(verificationParams.getOriginatingUid() >= 0) | |
intent.putExtra("android.intent.extra.ORIGINATING_UID", verificationParams.getOriginatingUid()); | |
if(verificationParams.getInstallerUid() >= 0) | |
intent.putExtra("android.content.pm.extra.VERIFICATION_INSTALLER_UID", verificationParams.getInstallerUid()); | |
} | |
packageverificationstate = new PackageVerificationState(k, installargs); | |
mPendingVerification.append(j1, packageverificationstate); | |
List list1 = matchVerifiers(packageinfolite, list, packageverificationstate); | |
if(list1 != null) | |
{ | |
int k1 = list1.size(); | |
if(k1 == 0) | |
{ | |
Slog.i("PackageManager", "Additional verifiers required, but none installed."); | |
i = -22; | |
} else | |
{ | |
int l1 = 0; | |
while(l1 < k1) | |
{ | |
ComponentName componentname1 = (ComponentName)list1.get(l1); | |
Intent intent1 = new Intent(intent); | |
intent1.setComponent(componentname1); | |
mContext.sendBroadcastAsUser(intent1, getUser()); | |
l1++; | |
} | |
} | |
} | |
componentname = matchComponentForVerifier(mRequiredVerifierPackage, list); | |
if(i == 1 && mRequiredVerifierPackage != null) | |
{ | |
intent.setComponent(componentname); | |
mContext.sendOrderedBroadcastAsUser(intent, getUser(), "android.permission.PACKAGE_VERIFICATION_AGENT", j1. new BroadcastReceiver() { | |
public void onReceive(Context context, Intent intent) | |
{ | |
Message message = mHandler.obtainMessage(16); | |
message.arg1 = verificationId; | |
mHandler.sendMessageDelayed(message, getVerificationTimeout()); | |
} | |
final InstallParams this$1; | |
final int val$verificationId; | |
{ | |
this$1 = final_installparams; | |
verificationId = I.this; | |
super(); | |
} | |
} | |
, null, 0, null, null); | |
mArgs = null; | |
} | |
} else | |
if(ThreelmMdmConfig.THREELM_MDM && mTempPackage == null && willScanFor3LM(installargs, mTempPackage)) | |
mArgs = null; | |
else | |
i = installargs.copyApk(mContainerService, true); | |
} | |
mRet = i; | |
return; | |
_L2: | |
devicestoragemonitorservice = (DeviceStorageMonitorService)ServiceManager.getService("devicestoragemonitor"); | |
if(devicestoragemonitorservice == null) | |
{ | |
Log.w("PackageManager", "Couldn't get low memory threshold; no free limit imposed"); | |
l = 0L; | |
} else | |
{ | |
l = devicestoragemonitorservice.getMemoryLowThreshold(); | |
} | |
mContext.grantUriPermission("com.android.defcontainer", mPackageURI, 1); | |
if(encryptionParams == null && "file".equals(mPackageURI.getScheme())) goto _L4; else goto _L3 | |
_L3: | |
mTempPackage = createTempPackageFile(mDrmAppPrivateInstallDir); | |
file = mTempPackage; | |
if(file == null) goto _L6; else goto _L5 | |
_L5: | |
parcelfiledescriptor1 = ParcelFileDescriptor.open(mTempPackage, 0x30000000); | |
parcelfiledescriptor = parcelfiledescriptor1; | |
_L8: | |
i = mContainerService.copyResource(mPackageURI, encryptionParams, parcelfiledescriptor); | |
IoUtils.closeQuietly(parcelfiledescriptor); | |
file1 = mTempPackage; | |
FileUtils.setPermissions(file1.getAbsolutePath(), 420, -1, -1); | |
_L10: | |
packageinfolite = null; | |
if(file1 == null) | |
break MISSING_BLOCK_LABEL_895; | |
s = file1.getAbsolutePath(); | |
packageinfolite = mContainerService.getMinimalPackageInfo(s, flags, l); | |
if(packageinfolite.recommendedInstallLocation == -1) | |
{ | |
l2 = mContainerService.calculateInstalledSize(s, isForwardLocked()); | |
if(mInstaller.freeCache(l2 + l) >= 0) | |
packageinfolite = mContainerService.getMinimalPackageInfo(s, flags, l); | |
if(packageinfolite.recommendedInstallLocation == -6) | |
packageinfolite.recommendedInstallLocation = -1; | |
} | |
context = mContext; | |
uri = mPackageURI; | |
_L9: | |
context.revokeUriPermission(uri, 1); | |
if(packageinfolite == null) | |
i = -102; | |
goto _L7 | |
filenotfoundexception; | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to create temporary file for : ").append(mPackageURI).toString()); | |
parcelfiledescriptor = null; | |
goto _L8 | |
securityexception; | |
Slog.e("PackageManager", "Failed to gain UriPermission!!"); | |
securityexception.printStackTrace(); | |
context = mContext; | |
uri = mPackageURI; | |
goto _L9 | |
_L6: | |
file1 = null; | |
goto _L10 | |
_L4: | |
s1 = mPackageURI.getPath(); | |
file1 = new File(s1); | |
goto _L10 | |
exception1; | |
exception1.printStackTrace(); | |
context = mContext; | |
uri = mPackageURI; | |
goto _L9 | |
exception; | |
mContext.revokeUriPermission(mPackageURI, 1); | |
throw exception; | |
goto _L8 | |
} | |
public boolean isForwardLocked() | |
{ | |
return (1 & flags) != 0; | |
} | |
final ContainerEncryptionParams encryptionParams; | |
int flags; | |
final String installerPackageName; | |
final String installerSourcePackageName; | |
private InstallArgs mArgs; | |
private final Uri mPackageURI; | |
private int mRet; | |
private File mTempPackage; | |
final IPackageInstallObserver observer; | |
final PackageManagerService this$0; | |
final VerificationParams verificationParams; | |
InstallParams(Uri uri, IPackageInstallObserver ipackageinstallobserver, int i, String s, String s1, VerificationParams verificationparams, | |
ContainerEncryptionParams containerencryptionparams, UserHandle userhandle) | |
{ | |
this$0 = PackageManagerService.this; | |
super(userhandle); | |
mPackageURI = uri; | |
flags = i; | |
observer = ipackageinstallobserver; | |
installerPackageName = s; | |
verificationParams = verificationparams; | |
installerSourcePackageName = s1; | |
encryptionParams = containerencryptionparams; | |
} | |
} | |
class MeasureParams extends HandlerParams | |
{ | |
void handleReturnCode() | |
{ | |
if(mObserver == null) | |
break MISSING_BLOCK_LABEL_24; | |
mObserver.onGetStatsCompleted(mStats, mSuccess); | |
return; | |
RemoteException remoteexception; | |
remoteexception; | |
Slog.i("PackageManager", "Observer no longer exists."); | |
return; | |
} | |
void handleServiceError() | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Could not measure application ").append(mStats.packageName).append(" external storage").toString()); | |
} | |
void handleStartCopy() | |
throws RemoteException | |
{ | |
synchronized(mInstallLock) | |
{ | |
mSuccess = getPackageSizeInfoLI(mStats.packageName, mStats.userHandle, mStats); | |
} | |
boolean flag; | |
if(Environment.isExternalStorageEmulated()) | |
{ | |
flag = true; | |
} else | |
{ | |
String s = Environment.getExternalStorageState(); | |
if("mounted".equals(s) || "mounted_ro".equals(s)) | |
flag = true; | |
else | |
flag = false; | |
} | |
if(flag) | |
{ | |
android.os.Environment.UserEnvironment userenvironment = new android.os.Environment.UserEnvironment(mStats.userHandle); | |
File file = userenvironment.getExternalStorageAppCacheDirectory(mStats.packageName); | |
long l = mContainerService.calculateDirectorySize(file.getPath()); | |
mStats.externalCacheSize = l; | |
File file1 = userenvironment.getExternalStorageAppDataDirectory(mStats.packageName); | |
long l1 = mContainerService.calculateDirectorySize(file1.getPath()); | |
if(file.getParentFile().equals(file1)) | |
l1 -= l; | |
mStats.externalDataSize = l1; | |
File file2 = userenvironment.getExternalStorageAppMediaDirectory(mStats.packageName); | |
mStats.externalMediaSize = mContainerService.calculateDirectorySize(file2.getPath()); | |
File file3 = userenvironment.getExternalStorageAppObbDirectory(mStats.packageName); | |
mStats.externalObbSize = mContainerService.calculateDirectorySize(file3.getPath()); | |
} | |
return; | |
exception; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
private final IPackageStatsObserver mObserver; | |
private final PackageStats mStats; | |
private boolean mSuccess; | |
final PackageManagerService this$0; | |
public MeasureParams(PackageStats packagestats, IPackageStatsObserver ipackagestatsobserver) | |
{ | |
this$0 = PackageManagerService.this; | |
super(new UserHandle(packagestats.userHandle)); | |
mObserver = ipackagestatsobserver; | |
mStats = packagestats; | |
} | |
} | |
class MoveParams extends HandlerParams | |
{ | |
void handleReturnCode() | |
{ | |
byte byte0; | |
targetArgs.doPostInstall(mRet, uid); | |
byte0 = -6; | |
if(mRet != 1) goto _L2; else goto _L1 | |
_L1: | |
byte0 = 1; | |
_L4: | |
processPendingMove(this, byte0); | |
return; | |
_L2: | |
if(mRet == -4) | |
byte0 = -1; | |
if(true) goto _L4; else goto _L3 | |
_L3: | |
} | |
void handleServiceError() | |
{ | |
mRet = -110; | |
} | |
public void handleStartCopy() | |
throws RemoteException | |
{ | |
mRet = -4; | |
if(!targetArgs.checkFreeStorage(mContainerService)) | |
{ | |
Log.w("PackageManager", "Insufficient storage to install"); | |
} else | |
{ | |
mRet = srcArgs.doPreCopy(); | |
if(mRet == 1) | |
{ | |
mRet = targetArgs.copyApk(mContainerService, false); | |
if(mRet != 1) | |
{ | |
srcArgs.doPostCopy(uid); | |
return; | |
} | |
mRet = srcArgs.doPostCopy(uid); | |
if(mRet == 1) | |
{ | |
mRet = targetArgs.doPreInstall(mRet); | |
if(mRet != 1) | |
return; | |
} | |
} | |
} | |
} | |
final int flags; | |
int mRet; | |
final IPackageMoveObserver observer; | |
final String packageName; | |
final InstallArgs srcArgs; | |
final InstallArgs targetArgs; | |
final PackageManagerService this$0; | |
int uid; | |
MoveParams(InstallArgs installargs, IPackageMoveObserver ipackagemoveobserver, int i, String s, String s1, int j, | |
UserHandle userhandle) | |
{ | |
this$0 = PackageManagerService.this; | |
super(userhandle); | |
srcArgs = installargs; | |
observer = ipackagemoveobserver; | |
flags = i; | |
packageName = s; | |
uid = j; | |
if(installargs != null) | |
{ | |
targetArgs = createInstallArgs(Uri.fromFile(new File(installargs.getCodePath())), i, s, s1); | |
return; | |
} else | |
{ | |
targetArgs = null; | |
return; | |
} | |
} | |
} | |
class PackageHandler extends Handler | |
{ | |
private boolean connectToService() | |
{ | |
Intent intent = (new Intent()).setComponent(PackageManagerService.DEFAULT_CONTAINER_COMPONENT); | |
Process.setThreadPriority(0); | |
if(mContext.bindService(intent, mDefContainerConn, 1, 0)) | |
{ | |
Process.setThreadPriority(10); | |
mBound = true; | |
return true; | |
} else | |
{ | |
Process.setThreadPriority(10); | |
return false; | |
} | |
} | |
private void disconnectService() | |
{ | |
mContainerService = null; | |
mBound = false; | |
Process.setThreadPriority(0); | |
mContext.unbindService(mDefContainerConn); | |
Process.setThreadPriority(10); | |
} | |
void doHandleMessage(Message message) | |
{ | |
message.what; | |
JVM INSTR tableswitch 1 19: default 96 | |
// 1 606 | |
// 2 96 | |
// 3 184 | |
// 4 96 | |
// 5 97 | |
// 6 461 | |
// 7 876 | |
// 8 96 | |
// 9 1029 | |
// 10 382 | |
// 11 596 | |
// 12 1599 | |
// 13 1695 | |
// 14 1760 | |
// 15 2133 | |
// 16 1861 | |
// 17 2370 | |
// 18 2370 | |
// 19 2587; | |
goto _L1 _L2 _L1 _L3 _L1 _L4 _L5 _L6 _L1 _L7 _L8 _L9 _L10 _L11 _L12 _L13 _L14 _L15 _L15 _L16 | |
_L1: | |
return; | |
_L4: | |
HandlerParams handlerparams1 = (HandlerParams)message.obj; | |
int j7 = mPendingInstalls.size(); | |
if(!mBound) | |
if(!connectToService()) | |
{ | |
Slog.e("PackageManager", "Failed to bind to media container service"); | |
handlerparams1.serviceError(); | |
return; | |
} else | |
{ | |
mPendingInstalls.add(j7, handlerparams1); | |
return; | |
} | |
mPendingInstalls.add(j7, handlerparams1); | |
if(j7 == 0) | |
{ | |
mHandler.sendEmptyMessage(3); | |
return; | |
} | |
continue; /* Loop/switch isn't completed */ | |
_L3: | |
if(message.obj != null) | |
mContainerService = (IMediaContainerService)message.obj; | |
if(mContainerService == null) | |
{ | |
Slog.e("PackageManager", "Cannot bind to media container service"); | |
for(Iterator iterator3 = mPendingInstalls.iterator(); iterator3.hasNext(); ((HandlerParams)iterator3.next()).serviceError()); | |
mPendingInstalls.clear(); | |
return; | |
} | |
if(mPendingInstalls.size() > 0) | |
{ | |
HandlerParams handlerparams = (HandlerParams)mPendingInstalls.get(0); | |
if(handlerparams != null && handlerparams.startCopy()) | |
{ | |
if(mPendingInstalls.size() > 0) | |
mPendingInstalls.remove(0); | |
if(mPendingInstalls.size() == 0) | |
{ | |
if(mBound) | |
{ | |
removeMessages(6); | |
sendMessageDelayed(obtainMessage(6), 10000L); | |
return; | |
} | |
} else | |
{ | |
mHandler.sendEmptyMessage(3); | |
return; | |
} | |
} | |
} else | |
{ | |
Slog.w("PackageManager", "Empty queue"); | |
return; | |
} | |
if(true) goto _L1; else goto _L8 | |
_L8: | |
if(mPendingInstalls.size() > 0) | |
{ | |
if(mBound) | |
disconnectService(); | |
if(!connectToService()) | |
{ | |
Slog.e("PackageManager", "Failed to bind to media container service"); | |
for(Iterator iterator2 = mPendingInstalls.iterator(); iterator2.hasNext(); ((HandlerParams)iterator2.next()).serviceError()); | |
mPendingInstalls.clear(); | |
return; | |
} | |
} | |
if(true) goto _L1; else goto _L5 | |
_L5: | |
if(!ThreelmMdmConfig.THREELM_MDM) | |
break MISSING_BLOCK_LABEL_538; | |
if(mPendingInstalls.size() != 0 || mPendingVerification.size() != 0 || mPendingScans.size() != 0) | |
continue; /* Loop/switch isn't completed */ | |
if(!mBound) goto _L1; else goto _L17 | |
_L17: | |
disconnectService(); | |
return; | |
if(mPendingInstalls.size() <= 0) goto _L1; else goto _L18 | |
_L18: | |
mHandler.sendEmptyMessage(3); | |
return; | |
if(mPendingInstalls.size() != 0 || mPendingVerification.size() != 0) | |
continue; /* Loop/switch isn't completed */ | |
if(!mBound) goto _L1; else goto _L19 | |
_L19: | |
disconnectService(); | |
return; | |
if(mPendingInstalls.size() <= 0) goto _L1; else goto _L20 | |
_L20: | |
mHandler.sendEmptyMessage(3); | |
return; | |
_L9: | |
mPendingInstalls.remove(0); | |
return; | |
_L2: | |
Process.setThreadPriority(0); | |
synchronized(mPackages) | |
{ | |
if(mPendingBroadcasts != null) | |
break MISSING_BLOCK_LABEL_644; | |
} | |
return; | |
exception4; | |
hashmap3; | |
JVM INSTR monitorexit ; | |
throw exception4; | |
int i6 = mPendingBroadcasts.size(); | |
if(i6 > 0) | |
break MISSING_BLOCK_LABEL_665; | |
hashmap3; | |
JVM INSTR monitorexit ; | |
return; | |
String as[]; | |
ArrayList aarraylist[]; | |
int ai5[]; | |
Iterator iterator1; | |
as = new String[i6]; | |
aarraylist = new ArrayList[i6]; | |
ai5 = new int[i6]; | |
iterator1 = mPendingBroadcasts.entrySet().iterator(); | |
int j6 = 0; | |
_L25: | |
if(!iterator1.hasNext() || j6 >= i6) goto _L22; else goto _L21 | |
_L21: | |
PackageSetting packagesetting; | |
java.util.Map.Entry entry = (java.util.Map.Entry)iterator1.next(); | |
as[j6] = (String)entry.getKey(); | |
aarraylist[j6] = (ArrayList)entry.getValue(); | |
packagesetting = (PackageSetting)mSettings.mPackages.get(entry.getKey()); | |
if(packagesetting == null) goto _L24; else goto _L23 | |
_L23: | |
int k6 = packagesetting.appId; | |
_L54: | |
ai5[j6] = k6; | |
j6++; | |
goto _L25 | |
_L22: | |
int l6 = j6; | |
mPendingBroadcasts.clear(); | |
hashmap3; | |
JVM INSTR monitorexit ; | |
for(int i7 = 0; i7 < l6; i7++) | |
sendPackageChangedBroadcast(as[i7], true, aarraylist[i7], ai5[i7]); | |
Process.setThreadPriority(10); | |
return; | |
_L6: | |
Process.setThreadPriority(0); | |
String s = (String)message.obj; | |
int i5 = message.arg1; | |
int i; | |
PackageScanState packagescanstate; | |
int j; | |
InstallArgs installargs; | |
int k; | |
File file; | |
RemoteException remoteexception; | |
int l; | |
int i1; | |
PackageScanState packagescanstate1; | |
InstallArgs installargs1; | |
int j1; | |
RemoteException remoteexception1; | |
File file1; | |
int k1; | |
int l1; | |
PackageVerificationState packageverificationstate; | |
PackageVerificationResponse packageverificationresponse; | |
InstallArgs installargs2; | |
int i2; | |
RemoteException remoteexception2; | |
int j2; | |
int k2; | |
PackageVerificationState packageverificationstate1; | |
InstallArgs installargs3; | |
int l2; | |
RemoteException remoteexception3; | |
int i3; | |
HashMap hashmap; | |
Exception exception; | |
Iterator iterator; | |
int j3; | |
boolean flag; | |
boolean flag1; | |
RemoteException remoteexception4; | |
Set set; | |
PostInstallData postinstalldata; | |
InstallArgs installargs4; | |
PackageInstalledInfo packageinstalledinfo; | |
int k3; | |
boolean flag2; | |
RemoteException remoteexception5; | |
Bundle bundle; | |
int ai[]; | |
int ai1[]; | |
boolean flag3; | |
InstallArgs installargs5; | |
int l3; | |
int i4; | |
int j4; | |
boolean flag4; | |
int k4; | |
int l4; | |
int ai2[]; | |
int ai3[]; | |
boolean flag5; | |
HashMap hashmap2; | |
Exception exception3; | |
int ai4[]; | |
int j5; | |
int k5; | |
int l5; | |
if(message.arg2 != 0) | |
flag5 = true; | |
else | |
flag5 = false; | |
hashmap2 = mPackages; | |
hashmap2; | |
JVM INSTR monitorenter ; | |
if(i5 != -1) goto _L27; else goto _L26 | |
_L26: | |
ai4 = PackageManagerService.sUserManager.getUserIds(); | |
j5 = ai4.length; | |
k5 = 0; | |
_L29: | |
if(k5 >= j5) | |
break; /* Loop/switch isn't completed */ | |
l5 = ai4[k5]; | |
mSettings.addPackageToCleanLPw(new PackageCleanItem(l5, s, flag5)); | |
k5++; | |
if(true) goto _L29; else goto _L28 | |
_L27: | |
mSettings.addPackageToCleanLPw(new PackageCleanItem(i5, s, flag5)); | |
_L28: | |
hashmap2; | |
JVM INSTR monitorexit ; | |
Process.setThreadPriority(10); | |
startCleaningPackages(); | |
return; | |
exception3; | |
hashmap2; | |
JVM INSTR monitorexit ; | |
throw exception3; | |
_L7: | |
postinstalldata = (PostInstallData)mRunningInstalls.get(message.arg1); | |
mRunningInstalls.delete(message.arg1); | |
if(postinstalldata == null) | |
break MISSING_BLOCK_LABEL_1569; | |
installargs4 = postinstalldata.args; | |
packageinstalledinfo = postinstalldata.res; | |
k3 = packageinstalledinfo.returnCode; | |
flag2 = false; | |
if(k3 != 1) goto _L31; else goto _L30 | |
_L30: | |
packageinstalledinfo.removedInfo.sendBroadcast(false, true, false); | |
bundle = new Bundle(1); | |
bundle.putInt("android.intent.extra.UID", packageinstalledinfo.uid); | |
ai = new int[0]; | |
if(packageinstalledinfo.origUsers != null && packageinstalledinfo.origUsers.length != 0) goto _L33; else goto _L32 | |
_L32: | |
ai1 = packageinstalledinfo.newUsers; | |
_L35: | |
PackageManagerService.sendPackageBroadcast("android.intent.action.PACKAGE_ADDED", ((PackageItemInfo) (packageinstalledinfo.pkg.applicationInfo)).packageName, bundle, null, null, ai1); | |
if(packageinstalledinfo.removedInfo.removedPackage != null) | |
flag3 = true; | |
else | |
flag3 = false; | |
if(flag3) | |
bundle.putBoolean("android.intent.extra.REPLACING", true); | |
PackageManagerService.sendPackageBroadcast("android.intent.action.PACKAGE_ADDED", ((PackageItemInfo) (packageinstalledinfo.pkg.applicationInfo)).packageName, bundle, null, null, ai); | |
if(flag3) | |
{ | |
PackageManagerService.sendPackageBroadcast("android.intent.action.PACKAGE_REPLACED", ((PackageItemInfo) (packageinstalledinfo.pkg.applicationInfo)).packageName, bundle, null, null, ai); | |
PackageManagerService.sendPackageBroadcast("android.intent.action.MY_PACKAGE_REPLACED", null, null, ((PackageItemInfo) (packageinstalledinfo.pkg.applicationInfo)).packageName, null, ai); | |
} | |
installargs5 = packageinstalledinfo.removedInfo.args; | |
flag2 = false; | |
if(installargs5 != null) | |
flag2 = true; | |
EventLog.writeEvent(3110, getUnknownSourcesSettings()); | |
_L31: | |
Runtime.getRuntime().gc(); | |
if(flag2) | |
synchronized(mInstallLock) | |
{ | |
packageinstalledinfo.removedInfo.args.doPostDeleteLI(true); | |
} | |
if(installargs4.observer != null) | |
{ | |
try | |
{ | |
installargs4.observer.packageInstalled(packageinstalledinfo.name, packageinstalledinfo.returnCode); | |
return; | |
} | |
// Misplaced declaration of an exception variable | |
catch(RemoteException remoteexception5) | |
{ | |
Slog.i("PackageManager", "Observer no longer exists."); | |
} | |
return; | |
} | |
goto _L1 | |
_L33: | |
ai1 = new int[0]; | |
l3 = 0; | |
_L37: | |
i4 = packageinstalledinfo.newUsers.length; | |
if(l3 >= i4) goto _L35; else goto _L34 | |
_L34: | |
j4 = packageinstalledinfo.newUsers[l3]; | |
flag4 = true; | |
k4 = 0; | |
_L38: | |
label0: | |
{ | |
l4 = packageinstalledinfo.origUsers.length; | |
if(k4 < l4) | |
{ | |
if(packageinstalledinfo.origUsers[k4] != j4) | |
break label0; | |
flag4 = false; | |
} | |
if(flag4) | |
{ | |
ai3 = new int[1 + ai1.length]; | |
System.arraycopy(ai1, 0, ai3, 0, ai1.length); | |
ai3[ai1.length] = j4; | |
ai1 = ai3; | |
} else | |
{ | |
ai2 = new int[1 + ai.length]; | |
System.arraycopy(ai, 0, ai2, 0, ai.length); | |
ai2[ai.length] = j4; | |
ai = ai2; | |
} | |
l3++; | |
} | |
if(true) goto _L37; else goto _L36 | |
_L36: | |
k4++; | |
goto _L38 | |
exception2; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception2; | |
Slog.e("PackageManager", (new StringBuilder()).append("Bogus post-install token ").append(message.arg1).toString()); | |
return; | |
_L10: | |
if(message.arg1 == 1) | |
flag = true; | |
else | |
flag = false; | |
if(message.arg2 == 1) | |
flag1 = true; | |
else | |
flag1 = false; | |
if(flag1) | |
Runtime.getRuntime().gc(); | |
if(message.obj != null) | |
{ | |
set = (Set)message.obj; | |
unloadAllContainers(set); | |
} | |
if(flag) | |
{ | |
try | |
{ | |
PackageHelper.getMountService().finishMediaUpdate(); | |
return; | |
} | |
// Misplaced declaration of an exception variable | |
catch(RemoteException remoteexception4) | |
{ | |
Log.e("PackageManager", "MountService not running?"); | |
} | |
return; | |
} | |
goto _L1 | |
_L11: | |
Process.setThreadPriority(0); | |
synchronized(mPackages) | |
{ | |
removeMessages(13); | |
removeMessages(14); | |
mSettings.writeLPr(); | |
mDirtyUsers.clear(); | |
} | |
Process.setThreadPriority(10); | |
return; | |
exception1; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
_L12: | |
Process.setThreadPriority(0); | |
hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
removeMessages(14); | |
for(iterator = mDirtyUsers.iterator(); iterator.hasNext(); mSettings.writePackageRestrictionsLPr(j3)) | |
j3 = ((Integer)iterator.next()).intValue(); | |
break MISSING_BLOCK_LABEL_1842; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
mDirtyUsers.clear(); | |
hashmap; | |
JVM INSTR monitorexit ; | |
Process.setThreadPriority(10); | |
return; | |
_L14: | |
k2 = message.arg1; | |
packageverificationstate1 = (PackageVerificationState)mPendingVerification.get(k2); | |
if(packageverificationstate1 == null || packageverificationstate1.timeoutExtended()) goto _L1; else goto _L39 | |
_L39: | |
installargs3 = packageverificationstate1.getInstallArgs(); | |
Slog.i("PackageManager", (new StringBuilder()).append("Verification timed out for ").append(installargs3.packageURI.toString()).toString()); | |
mPendingVerification.remove(k2); | |
l2 = -22; | |
if(getDefaultVerificationResponse() != 1) goto _L41; else goto _L40 | |
_L40: | |
Slog.i("PackageManager", (new StringBuilder()).append("Continuing with installation of ").append(installargs3.packageURI.toString()).toString()); | |
packageverificationstate1.setVerifierResponse(Binder.getCallingUid(), 2); | |
broadcastPackageVerified(k2, installargs3.packageURI, 1, packageverificationstate1.getInstallArgs().getUser()); | |
if(ThreelmMdmConfig.THREELM_MDM && willScanFor3LM(installargs3, null)) goto _L1; else goto _L42 | |
_L42: | |
try | |
{ | |
i3 = installargs3.copyApk(mContainerService, true); | |
} | |
// Misplaced declaration of an exception variable | |
catch(RemoteException remoteexception3) | |
{ | |
Slog.e("PackageManager", "Could not contact the ContainerService"); | |
continue; /* Loop/switch isn't completed */ | |
} | |
l2 = i3; | |
_L43: | |
processPendingInstall(installargs3, l2); | |
mHandler.sendEmptyMessage(6); | |
return; | |
_L41: | |
broadcastPackageVerified(k2, installargs3.packageURI, -1, packageverificationstate1.getInstallArgs().getUser()); | |
if(true) goto _L43; else goto _L13 | |
_L13: | |
l1 = message.arg1; | |
packageverificationstate = (PackageVerificationState)mPendingVerification.get(l1); | |
if(packageverificationstate == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Invalid verification token ").append(l1).append(" received").toString()); | |
return; | |
} | |
packageverificationresponse = (PackageVerificationResponse)message.obj; | |
packageverificationstate.setVerifierResponse(packageverificationresponse.callerUid, packageverificationresponse.code); | |
if(!packageverificationstate.isVerificationComplete()) goto _L1; else goto _L44 | |
_L44: | |
mPendingVerification.remove(l1); | |
installargs2 = packageverificationstate.getInstallArgs(); | |
if(!packageverificationstate.isInstallAllowed()) goto _L46; else goto _L45 | |
_L45: | |
i2 = -110; | |
broadcastPackageVerified(l1, installargs2.packageURI, packageverificationresponse.code, packageverificationstate.getInstallArgs().getUser()); | |
if(ThreelmMdmConfig.THREELM_MDM && willScanFor3LM(installargs2, null)) goto _L1; else goto _L47 | |
_L47: | |
try | |
{ | |
j2 = installargs2.copyApk(mContainerService, true); | |
} | |
// Misplaced declaration of an exception variable | |
catch(RemoteException remoteexception2) | |
{ | |
Slog.e("PackageManager", "Could not contact the ContainerService"); | |
continue; /* Loop/switch isn't completed */ | |
} | |
i2 = j2; | |
_L48: | |
processPendingInstall(installargs2, i2); | |
mHandler.sendEmptyMessage(6); | |
return; | |
_L46: | |
i2 = -22; | |
if(true) goto _L48; else goto _L15 | |
_L15: | |
i1 = message.arg1; | |
packagescanstate1 = (PackageScanState)mPendingScans.get(i1); | |
if(packagescanstate1 == null) goto _L1; else goto _L49 | |
_L49: | |
installargs1 = packagescanstate1.getInstallArgs(); | |
Slog.w("PackageManager", (new StringBuilder()).append("Scan timed out for ").append(installargs1.packageURI.toString()).toString()); | |
mPendingScans.remove(i1); | |
if(17 != message.what) goto _L51; else goto _L50 | |
_L50: | |
j1 = -21; | |
Slog.w("PackageManager", "Failing package install after timeout"); | |
_L52: | |
processPendingInstall(installargs1, j1); | |
file1 = packagescanstate1.getTempPackage(); | |
if(file1 != null && !file1.delete()) | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't delete temporary file: ").append(file1.getAbsolutePath()).toString()); | |
mHandler.sendEmptyMessage(6); | |
return; | |
_L51: | |
j1 = -110; | |
k1 = installargs1.copyApk(mContainerService, true); | |
j1 = k1; | |
continue; /* Loop/switch isn't completed */ | |
remoteexception1; | |
Slog.e("PackageManager", "Could not contact the ContainerService"); | |
if(true) goto _L52; else goto _L16 | |
_L16: | |
i = message.arg1; | |
packagescanstate = (PackageScanState)mPendingScans.get(i); | |
if(packagescanstate == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Invalid scan token ").append(i).toString()); | |
return; | |
} | |
mPendingScans.remove(i); | |
j = ((Integer)message.obj).intValue(); | |
installargs = packagescanstate.getInstallArgs(); | |
k = -22; | |
if(j != 1000) | |
break MISSING_BLOCK_LABEL_2702; | |
k = -110; | |
l = installargs.copyApk(mContainerService, true); | |
k = l; | |
_L53: | |
processPendingInstall(installargs, k); | |
file = packagescanstate.getTempPackage(); | |
if(file != null && !file.delete()) | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't delete temporary file: ").append(file.getAbsolutePath()).toString()); | |
mHandler.sendEmptyMessage(6); | |
return; | |
remoteexception; | |
Slog.e("PackageManager", "Could not contact the ContainerService"); | |
if(true) goto _L53; else goto _L24 | |
_L24: | |
k6 = -1; | |
goto _L54 | |
} | |
public void handleMessage(Message message) | |
{ | |
doHandleMessage(message); | |
Process.setThreadPriority(10); | |
return; | |
Exception exception; | |
exception; | |
Process.setThreadPriority(10); | |
throw exception; | |
} | |
private boolean mBound; | |
final ArrayList mPendingInstalls = new ArrayList(); | |
final PackageManagerService this$0; | |
PackageHandler(Looper looper) | |
{ | |
this$0 = PackageManagerService.this; | |
super(looper); | |
mBound = false; | |
} | |
} | |
class PackageInstalledInfo | |
{ | |
String name; | |
int newUsers[]; | |
int origUsers[]; | |
android.content.pm.PackageParser.Package pkg; | |
PackageRemovedInfo removedInfo; | |
int returnCode; | |
final PackageManagerService this$0; | |
int uid; | |
PackageInstalledInfo() | |
{ | |
this$0 = PackageManagerService.this; | |
super(); | |
} | |
} | |
static class PackageRemovedInfo | |
{ | |
void sendBroadcast(boolean flag, boolean flag1, boolean flag2) | |
{ | |
Bundle bundle = new Bundle(1); | |
int i; | |
if(removedAppId >= 0) | |
i = removedAppId; | |
else | |
i = uid; | |
bundle.putInt("android.intent.extra.UID", i); | |
bundle.putBoolean("android.intent.extra.DATA_REMOVED", flag); | |
if(flag1) | |
bundle.putBoolean("android.intent.extra.REPLACING", true); | |
bundle.putBoolean("android.intent.extra.REMOVED_FOR_ALL_USERS", flag2); | |
if(removedPackage != null) | |
{ | |
PackageManagerService.sendPackageBroadcast("android.intent.action.PACKAGE_REMOVED", removedPackage, bundle, null, null, removedUsers); | |
if(flag && !flag1) | |
PackageManagerService.sendPackageBroadcast("android.intent.action.PACKAGE_FULLY_REMOVED", removedPackage, bundle, null, null, removedUsers); | |
} | |
if(removedAppId >= 0) | |
PackageManagerService.sendPackageBroadcast("android.intent.action.UID_REMOVED", null, bundle, null, null, removedUsers); | |
} | |
InstallArgs args; | |
boolean isRemovedPackageSystemUpdate; | |
int removedAppId; | |
String removedPackage; | |
int removedUsers[]; | |
int uid; | |
PackageRemovedInfo() | |
{ | |
uid = -1; | |
removedAppId = -1; | |
removedUsers = null; | |
isRemovedPackageSystemUpdate = false; | |
args = null; | |
} | |
} | |
class PostInstallData | |
{ | |
public InstallArgs args; | |
public PackageInstalledInfo res; | |
final PackageManagerService this$0; | |
PostInstallData(InstallArgs installargs, PackageInstalledInfo packageinstalledinfo) | |
{ | |
this$0 = PackageManagerService.this; | |
super(); | |
args = installargs; | |
res = packageinstalledinfo; | |
} | |
} | |
private final class ServiceIntentResolver extends IntentResolver | |
{ | |
public final void addService(android.content.pm.PackageParser.Service service) | |
{ | |
mServices.put(service.getComponentName(), service); | |
int i = ((android.content.pm.PackageParser.Component) (service)).intents.size(); | |
for(int j = 0; j < i; j++) | |
{ | |
android.content.pm.PackageParser.ServiceIntentInfo serviceintentinfo = (android.content.pm.PackageParser.ServiceIntentInfo)((android.content.pm.PackageParser.Component) (service)).intents.get(j); | |
if(!serviceintentinfo.debugCheck()) | |
Log.w("PackageManager", (new StringBuilder()).append("==> For Service ").append(((PackageItemInfo) (service.info)).name).toString()); | |
addFilter(serviceintentinfo); | |
} | |
} | |
protected volatile boolean allowFilterResult(IntentFilter intentfilter, List list) | |
{ | |
return allowFilterResult((android.content.pm.PackageParser.ServiceIntentInfo)intentfilter, list); | |
} | |
protected boolean allowFilterResult(android.content.pm.PackageParser.ServiceIntentInfo serviceintentinfo, List list) | |
{ | |
ServiceInfo serviceinfo = serviceintentinfo.service.info; | |
for(int i = -1 + list.size(); i >= 0; i--) | |
{ | |
ServiceInfo serviceinfo1 = ((ResolveInfo)list.get(i)).serviceInfo; | |
if(((PackageItemInfo) (serviceinfo1)).name == ((PackageItemInfo) (serviceinfo)).name && ((PackageItemInfo) (serviceinfo1)).packageName == ((PackageItemInfo) (serviceinfo)).packageName) | |
return false; | |
} | |
return true; | |
} | |
protected volatile void dumpFilter(PrintWriter printwriter, String s, IntentFilter intentfilter) | |
{ | |
dumpFilter(printwriter, s, (android.content.pm.PackageParser.ServiceIntentInfo)intentfilter); | |
} | |
protected void dumpFilter(PrintWriter printwriter, String s, android.content.pm.PackageParser.ServiceIntentInfo serviceintentinfo) | |
{ | |
printwriter.print(s); | |
printwriter.print(Integer.toHexString(System.identityHashCode(serviceintentinfo.service))); | |
printwriter.print(' '); | |
printwriter.print(serviceintentinfo.service.getComponentShortName()); | |
printwriter.print(" filter "); | |
printwriter.println(Integer.toHexString(System.identityHashCode(serviceintentinfo))); | |
} | |
protected volatile boolean isFilterStopped(IntentFilter intentfilter, int i) | |
{ | |
return isFilterStopped((android.content.pm.PackageParser.ServiceIntentInfo)intentfilter, i); | |
} | |
protected boolean isFilterStopped(android.content.pm.PackageParser.ServiceIntentInfo serviceintentinfo, int i) | |
{ | |
if(PackageManagerService.sUserManager.exists(i)) goto _L2; else goto _L1 | |
_L1: | |
return true; | |
_L2: | |
android.content.pm.PackageParser.Package package1 = ((android.content.pm.PackageParser.Component) (serviceintentinfo.service)).owner; | |
if(package1 == null) | |
break; /* Loop/switch isn't completed */ | |
PackageSetting packagesetting = (PackageSetting)package1.mExtras; | |
if(packagesetting == null) | |
break; /* Loop/switch isn't completed */ | |
if((1 & ((GrantedPermissions) (packagesetting)).pkgFlags) != 0 || !packagesetting.getStopped(i)) | |
return false; | |
if(true) goto _L1; else goto _L3 | |
_L3: | |
return false; | |
} | |
protected volatile IntentFilter[] newArray(int i) | |
{ | |
return newArray(i); | |
} | |
protected android.content.pm.PackageParser.ServiceIntentInfo[] newArray(int i) | |
{ | |
return new android.content.pm.PackageParser.ServiceIntentInfo[i]; | |
} | |
protected ResolveInfo newResult(android.content.pm.PackageParser.ServiceIntentInfo serviceintentinfo, int i, int j) | |
{ | |
if(PackageManagerService.sUserManager.exists(j) && mSettings.isEnabledLPr(serviceintentinfo.service.info, mFlags, j)) | |
{ | |
android.content.pm.PackageParser.Service service = serviceintentinfo.service; | |
if(!mSafeMode || (1 & ((ComponentInfo) (service.info)).applicationInfo.flags) != 0) | |
{ | |
PackageSetting packagesetting = (PackageSetting)((android.content.pm.PackageParser.Component) (service)).owner.mExtras; | |
if(packagesetting != null) | |
{ | |
ServiceInfo serviceinfo = PackageParser.generateServiceInfo(service, mFlags, packagesetting.readUserState(j), j); | |
if(serviceinfo != null) | |
{ | |
ResolveInfo resolveinfo = new ResolveInfo(); | |
resolveinfo.serviceInfo = serviceinfo; | |
if((0x40 & mFlags) != 0) | |
resolveinfo.filter = serviceintentinfo; | |
resolveinfo.priority = serviceintentinfo.getPriority(); | |
resolveinfo.preferredOrder = ((android.content.pm.PackageParser.Component) (service)).owner.mPreferredOrder; | |
resolveinfo.match = i; | |
resolveinfo.isDefault = ((android.content.pm.PackageParser.IntentInfo) (serviceintentinfo)).hasDefault; | |
resolveinfo.labelRes = ((android.content.pm.PackageParser.IntentInfo) (serviceintentinfo)).labelRes; | |
resolveinfo.nonLocalizedLabel = ((android.content.pm.PackageParser.IntentInfo) (serviceintentinfo)).nonLocalizedLabel; | |
resolveinfo.icon = ((android.content.pm.PackageParser.IntentInfo) (serviceintentinfo)).icon; | |
resolveinfo.system = PackageManagerService.isSystemApp(((ComponentInfo) (resolveinfo.serviceInfo)).applicationInfo); | |
return resolveinfo; | |
} | |
} | |
} | |
} | |
return null; | |
} | |
protected volatile Object newResult(IntentFilter intentfilter, int i, int j) | |
{ | |
return newResult((android.content.pm.PackageParser.ServiceIntentInfo)intentfilter, i, j); | |
} | |
protected volatile String packageForFilter(IntentFilter intentfilter) | |
{ | |
return packageForFilter((android.content.pm.PackageParser.ServiceIntentInfo)intentfilter); | |
} | |
protected String packageForFilter(android.content.pm.PackageParser.ServiceIntentInfo serviceintentinfo) | |
{ | |
return ((android.content.pm.PackageParser.Component) (serviceintentinfo.service)).owner.packageName; | |
} | |
public List queryIntent(Intent intent, String s, int i, int j) | |
{ | |
if(!PackageManagerService.sUserManager.exists(j)) | |
return null; | |
mFlags = i; | |
boolean flag; | |
if((0x10000 & i) != 0) | |
flag = true; | |
else | |
flag = false; | |
return super.queryIntent(intent, s, flag, j); | |
} | |
public List queryIntent(Intent intent, String s, boolean flag, int i) | |
{ | |
int j; | |
if(flag) | |
j = 0x10000; | |
else | |
j = 0; | |
mFlags = j; | |
return super.queryIntent(intent, s, flag, i); | |
} | |
public List queryIntentForPackage(Intent intent, String s, int i, ArrayList arraylist, int j) | |
{ | |
while(!PackageManagerService.sUserManager.exists(j) || arraylist == null) | |
return null; | |
mFlags = i; | |
boolean flag; | |
int k; | |
ArrayList arraylist1; | |
if((0x10000 & i) != 0) | |
flag = true; | |
else | |
flag = false; | |
k = arraylist.size(); | |
arraylist1 = new ArrayList(k); | |
for(int l = 0; l < k; l++) | |
{ | |
ArrayList arraylist2 = ((android.content.pm.PackageParser.Component) ((android.content.pm.PackageParser.Service)arraylist.get(l))).intents; | |
if(arraylist2 != null && arraylist2.size() > 0) | |
{ | |
android.content.pm.PackageParser.ServiceIntentInfo aserviceintentinfo[] = new android.content.pm.PackageParser.ServiceIntentInfo[arraylist2.size()]; | |
arraylist2.toArray(aserviceintentinfo); | |
arraylist1.add(aserviceintentinfo); | |
} | |
} | |
return super.queryIntentFromList(intent, s, flag, arraylist1, j); | |
} | |
public final void removeService(android.content.pm.PackageParser.Service service) | |
{ | |
mServices.remove(service.getComponentName()); | |
int i = ((android.content.pm.PackageParser.Component) (service)).intents.size(); | |
for(int j = 0; j < i; j++) | |
removeFilter((android.content.pm.PackageParser.ServiceIntentInfo)((android.content.pm.PackageParser.Component) (service)).intents.get(j)); | |
} | |
protected void sortResults(List list) | |
{ | |
Collections.sort(list, PackageManagerService.mResolvePrioritySorter); | |
} | |
private int mFlags; | |
private final HashMap mServices; | |
final PackageManagerService this$0; | |
private ServiceIntentResolver() | |
{ | |
this$0 = PackageManagerService.this; | |
super(); | |
mServices = new HashMap(); | |
} | |
} | |
public PackageManagerService(Context context, Installer installer, boolean flag, boolean flag1) | |
{ | |
Object obj; | |
HashMap hashmap; | |
long l; | |
int i; | |
HashSet hashset; | |
boolean flag2; | |
String as[]; | |
int j; | |
mHandlerThread = new HandlerThread("PackageManager", 10); | |
mSdkVersion = android.os.Build.VERSION.SDK_INT; | |
String s; | |
String s1; | |
File file; | |
String s2; | |
int k; | |
if("REL".equals(android.os.Build.VERSION.CODENAME)) | |
s = null; | |
else | |
s = android.os.Build.VERSION.CODENAME; | |
mSdkCodename = s; | |
mInstallLock = new Object(); | |
mAppDirs = new HashMap(); | |
mPackages = new HashMap(); | |
mSystemPermissions = new SparseArray(); | |
mSharedLibraries = new HashMap(); | |
mTmpSharedLibraries = null; | |
mAvailableFeatures = new HashMap(); | |
mActivities = new ActivityIntentResolver(); | |
mReceivers = new ActivityIntentResolver(); | |
mServices = new ServiceIntentResolver(); | |
mProvidersByComponent = new HashMap(); | |
mProviders = new HashMap(); | |
mInstrumentation = new HashMap(); | |
mPermissionGroups = new HashMap(); | |
mTransferedPackages = new HashSet(); | |
mProtectedBroadcasts = new HashSet(); | |
hiddenApkList = new HashSet(); | |
mPendingVerification = new SparseArray(); | |
mPendingScans = new SparseArray(); | |
mDeferredDexOpt = new ArrayList(); | |
mPendingVerificationToken = 0; | |
mResolveActivity = new ActivityInfo(); | |
mResolveInfo = new ResolveInfo(); | |
mPendingBroadcasts = new HashMap(); | |
mContainerService = null; | |
mDirtyUsers = new HashSet(); | |
mDefContainerConn = new DefaultContainerConnection(); | |
mRunningInstalls = new SparseArray(); | |
mNextInstallToken = 1; | |
mMediaMounted = false; | |
if(ConfigBuildFlags.CAPP_UPLUSAPI) | |
mLguplusPermissions = new PermissionsProxy(this); | |
EventLog.writeEvent(3060, SystemClock.uptimeMillis()); | |
if(mSdkVersion <= 0) | |
Slog.w("PackageManager", "**** ro.build.version.sdk not set!"); | |
try | |
{ | |
mSecurityBridge = (PackageManagerMonitor)getClass().getClassLoader().loadClass("com.android.services.SecurityBridge.core.PackageManagerSB").newInstance(); | |
} | |
catch(Exception exception) | |
{ | |
Slog.w("PackageManager", "No security bridge jar found, using default"); | |
mSecurityBridge = new PackageManagerMonitor(); | |
} | |
mContext = context; | |
mFactoryTest = flag; | |
mOnlyCore = flag1; | |
mNoDexOpt = "eng".equals(SystemProperties.get("ro.build.type")); | |
mMetrics = new DisplayMetrics(); | |
mSettings = new Settings(context); | |
mSettings.addSharedUserLPw("android.uid.system", 1000, 1); | |
mSettings.addSharedUserLPw("android.uid.lg_fota", 5000, 1); | |
mSettings.addSharedUserLPw("android.uid.phone", 1001, 1, new int[] { | |
3004, 3009, 3005 | |
}); | |
mSettings.addSharedUserLPw("android.uid.log", 1007, 1); | |
mSettings.addSharedUserLPw("android.uid.nfc", 1027, 1); | |
mSettings.addSharedUserLPw("android.uid.nfclock", 1030, 1); | |
mSettings.addSharedUserLPw("android.uid.bluetooth", 1002, 1); | |
if(ThreelmMdmConfig.THREELM_MDM) | |
mDeviceManager = DeviceManager3LMService.getInstance(); | |
mSettings.addSharedUserLPw("android.uid.fm_radio", 1029, 1); | |
mSettings.addSharedUserLPw("android.uid.felica", 4009, 1); | |
mSettings.addSharedUserLPw("android.uid.felica.mfm", 4004, 1); | |
mSettings.addSharedUserLPw("android.uid.felica.mfs", 4005, 1); | |
mSettings.addSharedUserLPw("android.uid.felica.mfw", 4006, 1); | |
mSettings.addSharedUserLPw("android.uid.felica.felicalock", 4007, 1); | |
mSettings.addSharedUserLPw("uid.dixim.android.lge", 4011, 1); | |
s1 = SystemProperties.get("debug.separate_processes"); | |
if(s1 != null && s1.length() > 0) | |
{ | |
if("*".equals(s1)) | |
{ | |
mDefParseFlags = 8; | |
mSeparateProcesses = null; | |
Slog.w("PackageManager", "Running with debug.separate_processes: * (ALL)"); | |
} else | |
{ | |
mDefParseFlags = 0; | |
mSeparateProcesses = s1.split(","); | |
Slog.w("PackageManager", (new StringBuilder()).append("Running with debug.separate_processes: ").append(s1).toString()); | |
} | |
} else | |
{ | |
mDefParseFlags = 0; | |
mSeparateProcesses = null; | |
} | |
mInstaller = installer; | |
((WindowManager)context.getSystemService("window")).getDefaultDisplay().getMetrics(mMetrics); | |
obj = mInstallLock; | |
obj; | |
JVM INSTR monitorenter ; | |
hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
mHandlerThread.start(); | |
mHandler = new PackageHandler(mHandlerThread.getLooper()); | |
file = Environment.getDataDirectory(); | |
mAppDataDir = new File(file, "data"); | |
mAppInstallDir = new File(file, "app"); | |
mAppLibInstallDir = new File(file, "app-lib"); | |
mAsecInternalPath = (new File(file, "app-asec")).getPath(); | |
mUserAppDataDir = new File(file, "user"); | |
mDrmAppPrivateInstallDir = new File(file, "app-private"); | |
mForcedSystemAppInstallDir = new File(file, "app-system"); | |
mForcedSystemAppInstallDir.mkdirs(); | |
FileUtils.setPermissions(mForcedSystemAppInstallDir.getPath(), 505, -1, -1); | |
sUserManager = new UserManagerService(context, this, mInstallLock, mPackages); | |
readPermissions(); | |
mRestoredSettings = mSettings.readLPw(sUserManager.getUsers(false), mSdkVersion, mOnlyCore); | |
l = SystemClock.uptimeMillis(); | |
EventLog.writeEvent(3070, l); | |
i = 417; | |
if(!mNoDexOpt) | |
break MISSING_BLOCK_LABEL_1077; | |
Slog.w("PackageManager", "Running ENG build: no pre-dexopt!"); | |
i |= 2; | |
hashset = new HashSet(); | |
mFrameworkDir = new File(Environment.getRootDirectory(), "framework"); | |
mDalvikCacheDir = new File(file, "dalvik-cache"); | |
flag2 = false; | |
s2 = System.getProperty("java.boot.class.path"); | |
if(s2 == null) goto _L2; else goto _L1 | |
_L1: | |
as = splitString(s2, ':'); | |
j = 0; | |
_L4: | |
k = as.length; | |
if(j >= k) | |
break; /* Loop/switch isn't completed */ | |
if(!DexFile.isDexOptNeeded(as[j])) | |
break MISSING_BLOCK_LABEL_1201; | |
hashset.add(as[j]); | |
mInstaller.dexopt(as[j], 1000, true); | |
flag2 = true; | |
_L5: | |
j++; | |
if(true) goto _L4; else goto _L3 | |
FileNotFoundException filenotfoundexception2; | |
filenotfoundexception2; | |
Slog.w("PackageManager", (new StringBuilder()).append("Boot class path not found: ").append(as[j]).toString()); | |
goto _L5 | |
Exception exception2; | |
exception2; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception2; | |
Exception exception1; | |
exception1; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
IOException ioexception2; | |
ioexception2; | |
Slog.w("PackageManager", (new StringBuilder()).append("Cannot dexopt ").append(as[j]).append("; is it an APK or JAR? ").append(ioexception2.getMessage()).toString()); | |
goto _L5 | |
_L2: | |
Slog.w("PackageManager", "No BOOTCLASSPATH found!"); | |
_L3: | |
Iterator iterator2; | |
if(mSharedLibraries.size() <= 0) | |
break MISSING_BLOCK_LABEL_1569; | |
iterator2 = mSharedLibraries.values().iterator(); | |
_L7: | |
String s7; | |
if(!iterator2.hasNext()) | |
break MISSING_BLOCK_LABEL_1569; | |
s7 = (String)iterator2.next(); | |
if(!DexFile.isDexOptNeeded(s7)) goto _L7; else goto _L6 | |
_L6: | |
hashset.add(s7); | |
mInstaller.dexopt(s7, 1000, true); | |
flag2 = true; | |
goto _L7 | |
FileNotFoundException filenotfoundexception1; | |
filenotfoundexception1; | |
Slog.w("PackageManager", (new StringBuilder()).append("Library not found: ").append(s7).toString()); | |
goto _L7 | |
IOException ioexception1; | |
ioexception1; | |
Slog.w("PackageManager", (new StringBuilder()).append("Cannot dexopt ").append(s7).append("; is it an APK or JAR? ").append(ioexception1.getMessage()).toString()); | |
goto _L7 | |
String as1[]; | |
hashset.add((new StringBuilder()).append(mFrameworkDir.getPath()).append("/framework-res.apk").toString()); | |
if(ConfigBuildFlags.CAPP_RESOURCE) | |
hashset.add((new StringBuilder()).append(mFrameworkDir.getPath()).append("/lge-res.apk").toString()); | |
as1 = mFrameworkDir.list(); | |
if(as1 == null) goto _L9; else goto _L8 | |
_L8: | |
int i2 = 0; | |
_L27: | |
int j2 = as1.length; | |
if(i2 >= j2) goto _L9; else goto _L10 | |
_L10: | |
String s6; | |
File file1 = new File(mFrameworkDir, as1[i2]); | |
s6 = file1.getPath(); | |
if(!hashset.contains(s6)) goto _L12; else goto _L11 | |
_L12: | |
if(s6.endsWith(".apk")) goto _L14; else goto _L13 | |
_L13: | |
boolean flag4 = s6.endsWith(".jar"); | |
if(!flag4) goto _L11; else goto _L14 | |
_L14: | |
if(!DexFile.isDexOptNeeded(s6)) goto _L11; else goto _L15 | |
_L15: | |
mInstaller.dexopt(s6, 1000, true); | |
flag2 = true; | |
goto _L11 | |
FileNotFoundException filenotfoundexception; | |
filenotfoundexception; | |
Slog.w("PackageManager", (new StringBuilder()).append("Jar not found: ").append(s6).toString()); | |
goto _L11 | |
IOException ioexception; | |
ioexception; | |
Slog.w("PackageManager", (new StringBuilder()).append("Exception reading jar: ").append(s6).toString(), ioexception); | |
goto _L11 | |
_L9: | |
if(!flag2) goto _L17; else goto _L16 | |
_L16: | |
String as2[] = mDalvikCacheDir.list(); | |
if(as2 == null) goto _L17; else goto _L18 | |
_L18: | |
int k1 = 0; | |
_L28: | |
int l1 = as2.length; | |
if(k1 >= l1) goto _L17; else goto _L19 | |
_L19: | |
String s5 = as2[k1]; | |
if(s5.startsWith("data@app@") || s5.startsWith("data@app-private@")) | |
{ | |
Slog.i("PackageManager", (new StringBuilder()).append("Pruning dalvik file: ").append(s5).toString()); | |
(new File(mDalvikCacheDir, s5)).delete(); | |
} | |
break MISSING_BLOCK_LABEL_2979; | |
_L17: | |
ArrayList arraylist; | |
Iterator iterator1; | |
mFrameworkInstallObserver = new AppDirObserver(mFrameworkDir.getPath(), 712, true); | |
mFrameworkInstallObserver.startWatching(); | |
scanDirLI(mFrameworkDir, 65, i | 2, 0L); | |
readHiddenApkList(); | |
mSystemAppDir = new File(Environment.getRootDirectory(), "app"); | |
mSystemInstallObserver = new AppDirObserver(mSystemAppDir.getPath(), 712, true); | |
mSystemInstallObserver.startWatching(); | |
scanDirLI(mSystemAppDir, 65, i, 0L); | |
mVendorAppDir = new File("/vendor/app"); | |
mVendorInstallObserver = new AppDirObserver(mVendorAppDir.getPath(), 712, true); | |
mVendorInstallObserver.startWatching(); | |
scanDirLI(mVendorAppDir, 65, i, 0L); | |
mForcedSystemAppInstallObserver = new AppDirObserver(mForcedSystemAppInstallDir.getPath(), 712, true); | |
mForcedSystemAppInstallObserver.startWatching(); | |
scanDirLI(mForcedSystemAppInstallDir, 65, i, 0L); | |
mInstaller.moveFiles(); | |
arraylist = new ArrayList(); | |
if(mOnlyCore) | |
break MISSING_BLOCK_LABEL_2415; | |
iterator1 = mSettings.mPackages.values().iterator(); | |
_L22: | |
PackageSetting packagesetting1; | |
do | |
{ | |
if(!iterator1.hasNext()) | |
break MISSING_BLOCK_LABEL_2415; | |
packagesetting1 = (PackageSetting)iterator1.next(); | |
} while((1 & ((GrantedPermissions) (packagesetting1)).pkgFlags) == 0); | |
if((android.content.pm.PackageParser.Package)mPackages.get(((PackageSettingBase) (packagesetting1)).name) == null) goto _L21; else goto _L20 | |
_L20: | |
if(mSettings.isDisabledSystemPackageLPr(((PackageSettingBase) (packagesetting1)).name)) | |
{ | |
Slog.i("PackageManager", (new StringBuilder()).append("Expecting better updatd system app for ").append(((PackageSettingBase) (packagesetting1)).name).append("; removing system app").toString()); | |
removePackageLI(packagesetting1, true); | |
} | |
goto _L22 | |
_L21: | |
label0: | |
{ | |
if(mSettings.isDisabledSystemPackageLPr(((PackageSettingBase) (packagesetting1)).name)) | |
break label0; | |
iterator1.remove(); | |
reportSettingsProblem(5, (new StringBuilder()).append("System package ").append(((PackageSettingBase) (packagesetting1)).name).append(" no longer exists; wiping its data").toString()); | |
removeDataDirsLI(((PackageSettingBase) (packagesetting1)).name); | |
} | |
goto _L22 | |
PackageSetting packagesetting2 = mSettings.getDisabledSystemPkgLPr(((PackageSettingBase) (packagesetting1)).name); | |
if(((PackageSettingBase) (packagesetting2)).codePath == null || !((PackageSettingBase) (packagesetting2)).codePath.exists()) | |
arraylist.add(((PackageSettingBase) (packagesetting1)).name); | |
goto _L22 | |
ArrayList arraylist1 = mSettings.getListOfIncompleteInstallPackagesLPr(); | |
int i1 = 0; | |
_L24: | |
int j1 = arraylist1.size(); | |
if(i1 >= j1) | |
break; /* Loop/switch isn't completed */ | |
cleanupInstallFailedPackage((PackageSetting)arraylist1.get(i1)); | |
i1++; | |
if(true) goto _L24; else goto _L23 | |
_L23: | |
Iterator iterator; | |
deleteTempPackageFiles(); | |
if(mOnlyCore) | |
break MISSING_BLOCK_LABEL_2758; | |
EventLog.writeEvent(3080, SystemClock.uptimeMillis()); | |
mAppInstallObserver = new AppDirObserver(mAppInstallDir.getPath(), 712, false); | |
mAppInstallObserver.startWatching(); | |
scanDirLI(mAppInstallDir, 0, i, 0L); | |
mDrmAppInstallObserver = new AppDirObserver(mDrmAppPrivateInstallDir.getPath(), 712, false); | |
mDrmAppInstallObserver.startWatching(); | |
scanDirLI(mDrmAppPrivateInstallDir, 16, i, 0L); | |
iterator = arraylist.iterator(); | |
_L25: | |
String s3; | |
android.content.pm.PackageParser.Package package1; | |
if(!iterator.hasNext()) | |
break MISSING_BLOCK_LABEL_2768; | |
s3 = (String)iterator.next(); | |
package1 = (android.content.pm.PackageParser.Package)mPackages.get(s3); | |
mSettings.removeDisabledSystemPackageLPw(s3); | |
if(package1 != null) | |
break MISSING_BLOCK_LABEL_2671; | |
String s4; | |
s4 = (new StringBuilder()).append("Updated system package ").append(s3).append(" no longer exists; wiping its data").toString(); | |
removeDataDirsLI(s3); | |
_L26: | |
reportSettingsProblem(5, s4); | |
goto _L25 | |
s4 = (new StringBuilder()).append("Updated system app + ").append(s3).append(" no longer present; removing system privileges for ").append(s3).toString(); | |
ApplicationInfo applicationinfo = package1.applicationInfo; | |
applicationinfo.flags = -2 & applicationinfo.flags; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s3); | |
packagesetting.pkgFlags = -2 & ((GrantedPermissions) (packagesetting)).pkgFlags; | |
goto _L26 | |
mAppInstallObserver = null; | |
mDrmAppInstallObserver = null; | |
EventLog.writeEvent(3090, SystemClock.uptimeMillis()); | |
Slog.i("PackageManager", (new StringBuilder()).append("Time to scan packages: ").append((float)(SystemClock.uptimeMillis() - l) / 1000F).append(" seconds").toString()); | |
byte byte0; | |
boolean flag3; | |
if(mSettings.mInternalSdkPlatform != mSdkVersion) | |
flag3 = true; | |
else | |
flag3 = false; | |
if(!flag3) | |
break MISSING_BLOCK_LABEL_2893; | |
Slog.i("PackageManager", (new StringBuilder()).append("Platform changed from ").append(mSettings.mInternalSdkPlatform).append(" to ").append(mSdkVersion).append("; regranting permissions for internal storage").toString()); | |
mSettings.mInternalSdkPlatform = mSdkVersion; | |
if(flag3) | |
byte0 = 6; | |
else | |
byte0 = 0; | |
updatePermissionsLPw(null, null, byte0 | 1); | |
mSettings.writeLPr(); | |
EventLog.writeEvent(3100, SystemClock.uptimeMillis()); | |
Runtime.getRuntime().gc(); | |
mRequiredVerifierPackage = getRequiredVerifierLPr(); | |
hashmap; | |
JVM INSTR monitorexit ; | |
obj; | |
JVM INSTR monitorexit ; | |
return; | |
_L11: | |
i2++; | |
goto _L27 | |
k1++; | |
goto _L28 | |
} | |
static int[] appendInts(int ai[], int ai1[]) | |
{ | |
if(ai1 != null) | |
{ | |
if(ai == null) | |
return ai1; | |
int i = ai1.length; | |
int j = 0; | |
while(j < i) | |
{ | |
ai = ArrayUtils.appendInt(ai, ai1[j]); | |
j++; | |
} | |
} | |
return ai; | |
} | |
static String arrayToString(int ai[]) | |
{ | |
StringBuffer stringbuffer = new StringBuffer(128); | |
stringbuffer.append('['); | |
if(ai != null) | |
{ | |
for(int i = 0; i < ai.length; i++) | |
{ | |
if(i > 0) | |
stringbuffer.append(", "); | |
stringbuffer.append(ai[i]); | |
} | |
} | |
stringbuffer.append(']'); | |
return stringbuffer.toString(); | |
} | |
private void broadcastPackageVerified(int i, Uri uri, int j, UserHandle userhandle) | |
{ | |
Intent intent = new Intent("android.intent.action.PACKAGE_VERIFIED"); | |
intent.setDataAndType(uri, "application/vnd.android.package-archive"); | |
intent.addFlags(1); | |
intent.putExtra("android.content.pm.extra.VERIFICATION_ID", i); | |
intent.putExtra("android.content.pm.extra.VERIFICATION_RESULT", j); | |
mContext.sendBroadcastAsUser(intent, userhandle, "android.permission.PACKAGE_VERIFICATION_AGENT"); | |
} | |
private boolean checkOverridePermission(String s, int i) | |
{ | |
PackageSetting packagesetting = mSettings.peekPackageLPr("com.sprint.extension"); | |
if(packagesetting != null) | |
{ | |
boolean flag; | |
if(checkUidSignatures(packagesetting.appId, i) == 0) | |
flag = true; | |
else | |
flag = false; | |
if(flag && ((GrantedPermissions) (packagesetting)).grantedPermissions.contains(s)) | |
return true; | |
} | |
return false; | |
} | |
private BasePermission checkPermissionTreeLP(String s) | |
{ | |
if(s != null) | |
{ | |
BasePermission basepermission = findPermissionTreeLP(s); | |
if(basepermission != null) | |
if(basepermission.uid == UserHandle.getAppId(Binder.getCallingUid())) | |
return basepermission; | |
else | |
throw new SecurityException((new StringBuilder()).append("Calling uid ").append(Binder.getCallingUid()).append(" is not allowed to add to permission tree ").append(basepermission.name).append(" owned by uid ").append(basepermission.uid).toString()); | |
} | |
throw new SecurityException((new StringBuilder()).append("No permission tree found for ").append(s).toString()); | |
} | |
private void checkValidCaller(int i, int j) | |
{ | |
if(UserHandle.getUserId(i) == j || i == 1000 || i == 0) | |
return; | |
else | |
throw new SecurityException((new StringBuilder()).append("Caller uid=").append(i).append(" is not privileged to communicate with user=").append(j).toString()); | |
} | |
private ResolveInfo chooseBestActivity(Intent intent, String s, int i, List list, int j) | |
{ | |
if(list != null) | |
{ | |
int k = list.size(); | |
if(k == 1) | |
return (ResolveInfo)list.get(0); | |
if(k > 1) | |
{ | |
ResolveInfo resolveinfo = (ResolveInfo)list.get(0); | |
ResolveInfo resolveinfo1 = (ResolveInfo)list.get(1); | |
if(resolveinfo.priority != resolveinfo1.priority || resolveinfo.preferredOrder != resolveinfo1.preferredOrder || resolveinfo.isDefault != resolveinfo1.isDefault) | |
return (ResolveInfo)list.get(0); | |
ResolveInfo resolveinfo2 = findPreferredActivity(intent, s, i, list, resolveinfo.priority, j); | |
if(resolveinfo2 != null) | |
return resolveinfo2; | |
if(j != 0) | |
{ | |
ResolveInfo resolveinfo3 = new ResolveInfo(mResolveInfo); | |
resolveinfo3.activityInfo = new ActivityInfo(resolveinfo3.activityInfo); | |
resolveinfo3.activityInfo.applicationInfo = new ApplicationInfo(((ComponentInfo) (resolveinfo3.activityInfo)).applicationInfo); | |
((ComponentInfo) (resolveinfo3.activityInfo)).applicationInfo.uid = UserHandle.getUid(j, UserHandle.getAppId(((ComponentInfo) (resolveinfo3.activityInfo)).applicationInfo.uid)); | |
return resolveinfo3; | |
} else | |
{ | |
return mResolveInfo; | |
} | |
} | |
} | |
return null; | |
} | |
static String cidFromCodePath(String s) | |
{ | |
int i = s.lastIndexOf("/"); | |
String s1 = s.substring(0, i); | |
return s1.substring(1 + s1.lastIndexOf("/"), i); | |
} | |
private boolean clearApplicationUserDataLI(String s, int i) | |
{ | |
if(s == null) | |
{ | |
Slog.w("PackageManager", "Attempt to delete null packageName."); | |
return false; | |
} | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
boolean flag; | |
flag = false; | |
if(package1 != null) | |
break MISSING_BLOCK_LABEL_125; | |
flag = true; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s); | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_75; | |
if(packagesetting.pkg != null) | |
break MISSING_BLOCK_LABEL_118; | |
Slog.w("PackageManager", (new StringBuilder()).append("Package named '").append(s).append("' doesn't exist.").toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return false; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
package1 = packagesetting.pkg; | |
hashmap; | |
JVM INSTR monitorexit ; | |
if(!flag) | |
{ | |
if(package1 == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package named '").append(s).append("' doesn't exist.").toString()); | |
return false; | |
} | |
if(package1.applicationInfo == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package ").append(s).append(" has no applicationInfo.").toString()); | |
return false; | |
} | |
} | |
if(mInstaller.clearUserData(s, i) < 0) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't remove cache files for package: ").append(s).toString()); | |
return false; | |
} else | |
{ | |
return true; | |
} | |
} | |
private void clearExternalStorageDataSync(String s, int i, boolean flag) | |
{ | |
boolean flag1; | |
if(Environment.isExternalStorageEmulated()) | |
{ | |
flag1 = true; | |
} else | |
{ | |
String s1 = Environment.getExternalStorageState(); | |
if(s1.equals("mounted") || s1.equals("mounted_ro")) | |
flag1 = true; | |
else | |
flag1 = false; | |
} | |
if(flag1) goto _L2; else goto _L1 | |
_L1: | |
return; | |
_L2: | |
ClearStorageConnection clearstorageconnection; | |
int k; | |
int l; | |
Intent intent = (new Intent()).setComponent(DEFAULT_CONTAINER_COMPONENT); | |
int ai[]; | |
int ai1[]; | |
int j; | |
long l1; | |
long l2; | |
IMediaContainerService imediacontainerservice; | |
long l3; | |
InterruptedException interruptedexception; | |
if(i == -1) | |
{ | |
ai = sUserManager.getUserIds(); | |
} else | |
{ | |
ai = new int[1]; | |
ai[0] = i; | |
} | |
clearstorageconnection = new ClearStorageConnection(); | |
if(!mContext.bindService(intent, clearstorageconnection, 1, 0)) goto _L1; else goto _L3 | |
_L3: | |
ai1 = ai; | |
j = ai1.length; | |
k = 0; | |
_L9: | |
if(k >= j) goto _L5; else goto _L4 | |
_L4: | |
l = ai1[k]; | |
l1 = 5000L + SystemClock.uptimeMillis(); | |
clearstorageconnection; | |
JVM INSTR monitorenter ; | |
l2 = SystemClock.uptimeMillis(); | |
_L6: | |
imediacontainerservice = clearstorageconnection.mContainerService; | |
if(imediacontainerservice != null || l2 >= l1) | |
break MISSING_BLOCK_LABEL_207; | |
l3 = l1 - l2; | |
try | |
{ | |
clearstorageconnection.wait(l3); | |
} | |
// Misplaced declaration of an exception variable | |
catch(InterruptedException interruptedexception) { } | |
goto _L6 | |
clearstorageconnection; | |
JVM INSTR monitorexit ; | |
IMediaContainerService imediacontainerservice1 = clearstorageconnection.mContainerService; | |
if(imediacontainerservice1 != null) goto _L8; else goto _L7 | |
_L7: | |
Context context = mContext; | |
_L10: | |
context.unbindService(clearstorageconnection); | |
return; | |
Exception exception1; | |
exception1; | |
clearstorageconnection; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
Exception exception; | |
exception; | |
mContext.unbindService(clearstorageconnection); | |
throw exception; | |
_L8: | |
android.os.Environment.UserEnvironment userenvironment; | |
File file; | |
userenvironment = new android.os.Environment.UserEnvironment(l); | |
file = userenvironment.getExternalStorageAppCacheDirectory(s); | |
File file1; | |
RemoteException remoteexception1; | |
File file2; | |
RemoteException remoteexception2; | |
try | |
{ | |
clearstorageconnection.mContainerService.clearDirectory(file.toString()); | |
} | |
catch(RemoteException remoteexception) { } | |
if(!flag) | |
continue; /* Loop/switch isn't completed */ | |
file1 = userenvironment.getExternalStorageAppDataDirectory(s); | |
try | |
{ | |
clearstorageconnection.mContainerService.clearDirectory(file1.toString()); | |
} | |
// Misplaced declaration of an exception variable | |
catch(RemoteException remoteexception1) { } | |
file2 = userenvironment.getExternalStorageAppMediaDirectory(s); | |
try | |
{ | |
clearstorageconnection.mContainerService.clearDirectory(file2.toString()); | |
} | |
// Misplaced declaration of an exception variable | |
catch(RemoteException remoteexception2) { } | |
k++; | |
goto _L9 | |
_L5: | |
context = mContext; | |
goto _L10 | |
} | |
private void clearThemePackageCache(String s) | |
{ | |
IThemeIconManager ithemeiconmanager; | |
ithemeiconmanager = android.content.thm.IThemeIconManager.Stub.asInterface(ServiceManager.getService("themeicon")); | |
if(ithemeiconmanager == null) | |
break MISSING_BLOCK_LABEL_28; | |
ithemeiconmanager.removeThemePackage(s); | |
ithemeiconmanager.removePackageRedirectionMap(s); | |
return; | |
RemoteException remoteexception; | |
remoteexception; | |
} | |
private boolean collectCertificatesLI(PackageParser packageparser, PackageSetting packagesetting, android.content.pm.PackageParser.Package package1, File file, int i) | |
{ | |
if(packagesetting == null || !((PackageSettingBase) (packagesetting)).codePath.equals(file) || ((PackageSettingBase) (packagesetting)).timeStamp != file.lastModified()) goto _L2; else goto _L1 | |
_L1: | |
if(((PackageSettingBase) (packagesetting)).signatures.mSignatures == null || ((PackageSettingBase) (packagesetting)).signatures.mSignatures.length == 0) goto _L4; else goto _L3 | |
_L3: | |
package1.mSignatures = ((PackageSettingBase) (packagesetting)).signatures.mSignatures; | |
_L9: | |
return true; | |
_L4: | |
Slog.w("PackageManager", (new StringBuilder()).append("PackageSetting for ").append(((PackageSettingBase) (packagesetting)).name).append(" is missing signatures. Collecting certs again to recover them.").toString()); | |
_L7: | |
if(!packageparser.collectCertificates(package1, i)) | |
{ | |
mLastScanError = packageparser.getParseError(); | |
return false; | |
} | |
goto _L5 | |
_L2: | |
Log.i("PackageManager", (new StringBuilder()).append(file.toString()).append(" changed; collecting certs").toString()); | |
if(true) goto _L7; else goto _L6 | |
_L6: | |
_L5: | |
if(true) goto _L9; else goto _L8 | |
_L8: | |
} | |
static boolean comparePermissionInfos(PermissionInfo permissioninfo, PermissionInfo permissioninfo1) | |
{ | |
while(((PackageItemInfo) (permissioninfo)).icon != ((PackageItemInfo) (permissioninfo1)).icon || ((PackageItemInfo) (permissioninfo)).logo != ((PackageItemInfo) (permissioninfo1)).logo || permissioninfo.protectionLevel != permissioninfo1.protectionLevel || !compareStrings(((PackageItemInfo) (permissioninfo)).name, ((PackageItemInfo) (permissioninfo1)).name) || !compareStrings(((PackageItemInfo) (permissioninfo)).nonLocalizedLabel, ((PackageItemInfo) (permissioninfo1)).nonLocalizedLabel) || !compareStrings(((PackageItemInfo) (permissioninfo)).packageName, ((PackageItemInfo) (permissioninfo1)).packageName)) | |
return false; | |
return true; | |
} | |
static int compareSignatures(Signature asignature[], Signature asignature1[]) | |
{ | |
if(asignature == null) | |
return asignature1 != null ? -1 : 1; | |
if(asignature1 == null) | |
return -2; | |
HashSet hashset = new HashSet(); | |
int i = asignature.length; | |
for(int j = 0; j < i; j++) | |
hashset.add(asignature[j]); | |
HashSet hashset1 = new HashSet(); | |
int k = asignature1.length; | |
for(int l = 0; l < k; l++) | |
hashset1.add(asignature1[l]); | |
return !hashset.equals(hashset1) ? -3 : 0; | |
} | |
static boolean compareStrings(CharSequence charsequence, CharSequence charsequence1) | |
{ | |
boolean flag; | |
if(charsequence == null) | |
{ | |
flag = false; | |
if(charsequence1 == null) | |
flag = true; | |
} else | |
{ | |
flag = false; | |
if(charsequence1 != null) | |
{ | |
Class class1 = charsequence.getClass(); | |
Class class2 = charsequence1.getClass(); | |
flag = false; | |
if(class1 == class2) | |
return charsequence.equals(charsequence1); | |
} | |
} | |
return flag; | |
} | |
private static int copyNativeLibrariesForInternalApp(File file, File file1) | |
throws IOException | |
{ | |
if(!file1.isDirectory()) | |
{ | |
file1.delete(); | |
if(!file1.mkdir()) | |
throw new IOException((new StringBuilder()).append("Cannot create ").append(file1.getPath()).toString()); | |
try | |
{ | |
Libcore.os.chmod(file1.getPath(), OsConstants.S_IRWXU | OsConstants.S_IRGRP | OsConstants.S_IXGRP | OsConstants.S_IROTH | OsConstants.S_IXOTH); | |
} | |
catch(ErrnoException errnoexception) | |
{ | |
throw new IOException((new StringBuilder()).append("Cannot chmod native library directory ").append(file1.getPath()).toString(), errnoexception); | |
} | |
} else | |
if(!SELinux.restorecon(file1)) | |
throw new IOException((new StringBuilder()).append("Cannot set SELinux context for ").append(file1.getPath()).toString()); | |
return NativeLibraryHelper.copyNativeBinariesIfNeededLI(file, file1); | |
} | |
private int createDataDirsLI(String s, int i) | |
{ | |
int ai[] = sUserManager.getUserIds(); | |
int j = mInstaller.install(s, i, i); | |
if(j < 0) | |
return j; | |
int k = ai.length; | |
for(int l = 0; l < k; l++) | |
{ | |
int i1 = ai[l]; | |
if(i1 == 0) | |
continue; | |
j = mInstaller.createUserData(s, UserHandle.getUid(i1, i), i1); | |
if(j < 0) | |
return j; | |
} | |
return j; | |
} | |
private InstallArgs createInstallArgs(int i, String s, String s1, String s2) | |
{ | |
boolean flag; | |
if(installOnSd(i)) | |
flag = true; | |
else | |
if(installForwardLocked(i) && !s.startsWith(mDrmAppPrivateInstallDir.getAbsolutePath())) | |
flag = true; | |
else | |
flag = false; | |
if(flag) | |
return new AsecInstallArgs(s, s1, s2, installOnSd(i), installForwardLocked(i)); | |
else | |
return new FileInstallArgs(s, s1, s2); | |
} | |
private InstallArgs createInstallArgs(Uri uri, int i, String s, String s1) | |
{ | |
if(installOnSd(i) || installForwardLocked(i)) | |
return new AsecInstallArgs(uri, getNextCodePath(uri.getPath(), s, "/pkg.apk"), installOnSd(i), installForwardLocked(i)); | |
else | |
return new FileInstallArgs(uri, s, s1); | |
} | |
private InstallArgs createInstallArgs(InstallParams installparams) | |
{ | |
if(installOnSd(installparams.flags) || installparams.isForwardLocked()) | |
return new AsecInstallArgs(installparams); | |
else | |
return new FileInstallArgs(installparams); | |
} | |
private File createTempPackageFile(File file) | |
{ | |
File file1; | |
File file2; | |
boolean flag; | |
try | |
{ | |
file1 = File.createTempFile("vmdl", ".tmp", file); | |
} | |
catch(IOException ioexception) | |
{ | |
Slog.e("PackageManager", "Couldn't create temp file for downloaded package file."); | |
return null; | |
} | |
file2 = file1; | |
try | |
{ | |
FileUtils.setPermissions(file2.getCanonicalPath(), 384, -1, -1); | |
flag = SELinux.restorecon(file2); | |
} | |
catch(IOException ioexception1) | |
{ | |
Slog.e("PackageManager", "Trouble getting the canoncical path for a temp file."); | |
return null; | |
} | |
if(!flag) | |
file2 = null; | |
return file2; | |
} | |
private boolean deleteApplicationCacheFilesLI(String s, int i) | |
{ | |
android.content.pm.PackageParser.Package package1; | |
if(s == null) | |
{ | |
Slog.w("PackageManager", "Attempt to delete null packageName."); | |
return false; | |
} | |
synchronized(mPackages) | |
{ | |
package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
} | |
if(package1 == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package named '").append(s).append("' doesn't exist.").toString()); | |
return false; | |
} | |
break MISSING_BLOCK_LABEL_83; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
if(package1.applicationInfo == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package ").append(s).append(" has no applicationInfo.").toString()); | |
return false; | |
} | |
if(mInstaller.deleteCacheFiles(s, i) < 0) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't remove cache files for package: ").append(s).append(" u").append(i).toString()); | |
return false; | |
} else | |
{ | |
return true; | |
} | |
} | |
private boolean deleteInstalledPackageLI(PackageSetting packagesetting, boolean flag, int i, PackageRemovedInfo packageremovedinfo, boolean flag1) | |
{ | |
if(packageremovedinfo != null) | |
packageremovedinfo.uid = packagesetting.appId; | |
removePackageDataLI(packagesetting, packageremovedinfo, i, flag1); | |
if(flag && packageremovedinfo != null) | |
packageremovedinfo.args = createInstallArgs(packageFlagsToInstallFlags(packagesetting), ((PackageSettingBase) (packagesetting)).codePathString, ((PackageSettingBase) (packagesetting)).resourcePathString, ((PackageSettingBase) (packagesetting)).nativeLibraryPathString); | |
return true; | |
} | |
private boolean deletePackageLI(String s, UserHandle userhandle, boolean flag, int i, PackageRemovedInfo packageremovedinfo, boolean flag1, boolean flag2) | |
{ | |
int j; | |
int k; | |
if(s == null) | |
{ | |
Slog.w("PackageManager", "Attempt to delete null packageName."); | |
return false; | |
} | |
if(ThreelmMdmConfig.THREELM_MDM && mDeviceManager != null && !flag2 && !mDeviceManager.checkAppUninstallPolicies(s)) | |
return false; | |
j = -1; | |
k = -1; | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_127; | |
Slog.w("PackageManager", (new StringBuilder()).append("Package named '").append(s).append("' doesn't exist.").toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return false; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
if(isSystemApp(packagesetting) || userhandle == null) | |
break MISSING_BLOCK_LABEL_198; | |
if(userhandle.getIdentifier() != -1) | |
{ | |
packagesetting.setUserState(userhandle.getIdentifier(), 0, false, true, true, null, null); | |
if(!packagesetting.isAnyInstalled(sUserManager.getUserIds())) | |
break MISSING_BLOCK_LABEL_258; | |
j = userhandle.getIdentifier(); | |
k = packagesetting.appId; | |
mSettings.writePackageRestrictionsLPr(j); | |
} | |
_L1: | |
hashmap; | |
JVM INSTR monitorexit ; | |
if(j >= 0) | |
{ | |
if(packageremovedinfo != null) | |
{ | |
packageremovedinfo.removedPackage = s; | |
packageremovedinfo.removedAppId = k; | |
packageremovedinfo.removedUsers = (new int[] { | |
j | |
}); | |
} | |
mInstaller.clearUserData(s, j); | |
schedulePackageCleaning(s, j, false); | |
return true; | |
} | |
break MISSING_BLOCK_LABEL_271; | |
packagesetting.setInstalled(true, userhandle.getIdentifier()); | |
goto _L1 | |
if(false) | |
{ | |
removePackageDataLI(packagesetting, packageremovedinfo, i, flag1); | |
return true; | |
} | |
if(isSystemApp(packagesetting)) | |
{ | |
Log.i("PackageManager", (new StringBuilder()).append("Removing system package:").append(((PackageSettingBase) (packagesetting)).name).toString()); | |
return deleteSystemPackageLI(packagesetting, i, packageremovedinfo, flag1); | |
} else | |
{ | |
Log.i("PackageManager", (new StringBuilder()).append("Removing non-system package:").append(((PackageSettingBase) (packagesetting)).name).toString()); | |
killApplication(s, packagesetting.appId); | |
return deleteInstalledPackageLI(packagesetting, flag, i, packageremovedinfo, flag1); | |
} | |
} | |
private int deletePackageX(String s, int i, int j) | |
{ | |
PackageRemovedInfo packageremovedinfo; | |
IDevicePolicyManager idevicepolicymanager; | |
packageremovedinfo = new PackageRemovedInfo(); | |
idevicepolicymanager = android.app.admin.IDevicePolicyManager.Stub.asInterface(ServiceManager.getService("device_policy")); | |
if(idevicepolicymanager == null) | |
break MISSING_BLOCK_LABEL_77; | |
if(!idevicepolicymanager.packageHasActiveAdmins(s, UserHandle.getUserId(i))) | |
break MISSING_BLOCK_LABEL_77; | |
Slog.w("PackageManager", (new StringBuilder()).append("Not removing package ").append(s).append(": has active device admin").toString()); | |
return -2; | |
RemoteException remoteexception; | |
remoteexception; | |
if(Mdm.getInstance() != null && Mdm.getInstance().isFailedUninstallByMDM(null, s, j, UserHandle.getUserId(i))) | |
return -1; | |
Object obj = mInstallLock; | |
obj; | |
JVM INSTR monitorenter ; | |
if((j & 2) == 0) | |
break MISSING_BLOCK_LABEL_330; | |
UserHandle userhandle = UserHandle.ALL; | |
_L1: | |
boolean flag; | |
boolean flag1; | |
flag = deletePackageLI(s, userhandle, true, j | 0x10000, packageremovedinfo, true, false); | |
flag1 = packageremovedinfo.isRemovedPackageSystemUpdate; | |
boolean flag2; | |
flag2 = false; | |
if(!flag) | |
break MISSING_BLOCK_LABEL_185; | |
flag2 = false; | |
if(flag1) | |
break MISSING_BLOCK_LABEL_185; | |
Object obj1 = mPackages.get(s); | |
flag2 = false; | |
if(obj1 == null) | |
flag2 = true; | |
obj; | |
JVM INSTR monitorexit ; | |
if(flag) | |
{ | |
packageremovedinfo.sendBroadcast(true, flag1, flag2); | |
if(flag1) | |
{ | |
Bundle bundle = new Bundle(1); | |
Exception exception; | |
int k; | |
if(packageremovedinfo.removedAppId >= 0) | |
k = packageremovedinfo.removedAppId; | |
else | |
k = packageremovedinfo.uid; | |
bundle.putInt("android.intent.extra.UID", k); | |
bundle.putBoolean("android.intent.extra.REPLACING", true); | |
sendPackageBroadcast("android.intent.action.PACKAGE_ADDED", s, bundle, null, null, null); | |
sendPackageBroadcast("android.intent.action.PACKAGE_REPLACED", s, bundle, null, null, null); | |
sendPackageBroadcast("android.intent.action.MY_PACKAGE_REPLACED", null, null, s, null, null); | |
} | |
} | |
Runtime.getRuntime().gc(); | |
if(packageremovedinfo.args != null) | |
synchronized(mInstallLock) | |
{ | |
packageremovedinfo.args.doPostDeleteLI(true); | |
} | |
return !flag ? -1 : 1; | |
userhandle = new UserHandle(UserHandle.getUserId(i)); | |
goto _L1 | |
exception; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception; | |
exception1; | |
obj2; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
} | |
private boolean deleteSystemPackageLI(PackageSetting packagesetting, int i, PackageRemovedInfo packageremovedinfo, boolean flag) | |
{ | |
PackageSetting packagesetting1; | |
synchronized(mPackages) | |
{ | |
packagesetting1 = mSettings.getDisabledSystemPkgLPr(((PackageSettingBase) (packagesetting)).name); | |
} | |
if(packagesetting1 == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Attempt to delete unknown system package ").append(((PackageSettingBase) (packagesetting)).name).toString()); | |
return false; | |
} | |
break MISSING_BLOCK_LABEL_69; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
android.content.pm.PackageParser.Package package1; | |
Log.i("PackageManager", "Deleting system pkg from data partition"); | |
packageremovedinfo.isRemovedPackageSystemUpdate = true; | |
int j; | |
if(((PackageSettingBase) (packagesetting1)).versionCode < ((PackageSettingBase) (packagesetting)).versionCode) | |
j = i & -2; | |
else | |
j = i | 1; | |
if(!deleteInstalledPackageLI(packagesetting, true, j, packageremovedinfo, flag)) | |
return false; | |
synchronized(mPackages) | |
{ | |
mSettings.enableSystemPackageLPw(((PackageSettingBase) (packagesetting)).name); | |
NativeLibraryHelper.removeNativeBinariesLI(((PackageSettingBase) (packagesetting)).nativeLibraryPathString); | |
} | |
package1 = scanPackageLI(((PackageSettingBase) (packagesetting1)).codePath, 5, 33, 0L, null); | |
if(package1 == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Failed to restore system package:").append(((PackageSettingBase) (packagesetting)).name).append(" with error:").append(mLastScanError).toString()); | |
return false; | |
} | |
break MISSING_BLOCK_LABEL_230; | |
exception1; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
HashMap hashmap2 = mPackages; | |
hashmap2; | |
JVM INSTR monitorenter ; | |
updatePermissionsLPw(package1.packageName, package1, 3); | |
if(!flag) | |
break MISSING_BLOCK_LABEL_263; | |
mSettings.writeLPr(); | |
hashmap2; | |
JVM INSTR monitorexit ; | |
return true; | |
Exception exception2; | |
exception2; | |
hashmap2; | |
JVM INSTR monitorexit ; | |
throw exception2; | |
} | |
private void deleteTempPackageFiles() | |
{ | |
FilenameFilter filenamefilter = new FilenameFilter() { | |
public boolean accept(File file, String s) | |
{ | |
return s.startsWith("vmdl") && s.endsWith(".tmp"); | |
} | |
final PackageManagerService this$0; | |
{ | |
this$0 = PackageManagerService.this; | |
super(); | |
} | |
} | |
; | |
deleteTempPackageFilesInDirectory(mAppInstallDir, filenamefilter); | |
deleteTempPackageFilesInDirectory(mDrmAppPrivateInstallDir, filenamefilter); | |
} | |
private static final void deleteTempPackageFilesInDirectory(File file, FilenameFilter filenamefilter) | |
{ | |
String as[] = file.list(filenamefilter); | |
if(as != null) | |
{ | |
int i = 0; | |
while(i < as.length) | |
{ | |
(new File(file, as[i])).delete(); | |
i++; | |
} | |
} | |
} | |
private void enforceCrossUserPermission(int i, int j, boolean flag, String s) | |
{ | |
if(j < 0) | |
throw new IllegalArgumentException((new StringBuilder()).append("Invalid userId ").append(j).toString()); | |
while(j == UserHandle.getUserId(i) || i == 1000 || i == 0) | |
return; | |
if(flag) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.INTERACT_ACROSS_USERS_FULL", s); | |
return; | |
} | |
try | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.INTERACT_ACROSS_USERS_FULL", s); | |
return; | |
} | |
catch(SecurityException securityexception) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.INTERACT_ACROSS_USERS", s); | |
} | |
} | |
private static final void enforceSystemOrRoot(String s) | |
{ | |
int i = Binder.getCallingUid(); | |
if(i != 1000 && i != 0) | |
throw new SecurityException(s); | |
else | |
return; | |
} | |
private BasePermission findPermissionTreeLP(String s) | |
{ | |
for(Iterator iterator = mSettings.mPermissionTrees.values().iterator(); iterator.hasNext();) | |
{ | |
BasePermission basepermission = (BasePermission)iterator.next(); | |
if(s.startsWith(basepermission.name) && s.length() > basepermission.name.length() && s.charAt(basepermission.name.length()) == '.') | |
return basepermission; | |
} | |
return null; | |
} | |
private static String fixProcessName(String s, String s1, int i) | |
{ | |
if(s1 == null) | |
return s; | |
else | |
return s1; | |
} | |
private ApplicationInfo generateApplicationInfoFromSettingsLPw(String s, int i, int j) | |
{ | |
PackageSetting packagesetting; | |
if(sUserManager.exists(j)) | |
if((packagesetting = (PackageSetting)mSettings.mPackages.get(s)) != null) | |
if(packagesetting.pkg == null) | |
{ | |
PackageInfo packageinfo = generatePackageInfoFromSettingsLPw(s, i, j); | |
if(packageinfo != null) | |
return packageinfo.applicationInfo; | |
} else | |
{ | |
return PackageParser.generateApplicationInfo(packagesetting.pkg, i, packagesetting.readUserState(j), j); | |
} | |
return null; | |
} | |
private PackageInfo generatePackageInfoFromSettingsLPw(String s, int i, int j) | |
{ | |
if(sUserManager.exists(j)) goto _L2; else goto _L1 | |
_L1: | |
PackageSetting packagesetting; | |
return null; | |
_L2: | |
android.content.pm.PackageParser.Package package1; | |
if((packagesetting = (PackageSetting)mSettings.mPackages.get(s)) == null) | |
continue; /* Loop/switch isn't completed */ | |
package1 = packagesetting.pkg; | |
if(package1 != null) | |
break; /* Loop/switch isn't completed */ | |
if((i & 0x2000) == 0) | |
continue; /* Loop/switch isn't completed */ | |
package1 = new android.content.pm.PackageParser.Package(s); | |
package1.applicationInfo.packageName = s; | |
package1.applicationInfo.flags = 0x1000000 | ((GrantedPermissions) (packagesetting)).pkgFlags; | |
package1.applicationInfo.publicSourceDir = ((PackageSettingBase) (packagesetting)).resourcePathString; | |
package1.applicationInfo.sourceDir = ((PackageSettingBase) (packagesetting)).codePathString; | |
package1.applicationInfo.dataDir = getDataPathForPackage(s, 0).getPath(); | |
package1.applicationInfo.nativeLibraryDir = ((PackageSettingBase) (packagesetting)).nativeLibraryPathString; | |
break; /* Loop/switch isn't completed */ | |
if(true) goto _L1; else goto _L3 | |
_L3: | |
return generatePackageInfo(package1, i, j); | |
} | |
static final PermissionInfo generatePermissionInfo(BasePermission basepermission, int i) | |
{ | |
if(basepermission.perm != null) | |
{ | |
return PackageParser.generatePermissionInfo(basepermission.perm, i); | |
} else | |
{ | |
PermissionInfo permissioninfo = new PermissionInfo(); | |
permissioninfo.name = basepermission.name; | |
permissioninfo.packageName = basepermission.sourcePackage; | |
permissioninfo.nonLocalizedLabel = basepermission.name; | |
permissioninfo.protectionLevel = basepermission.protectionLevel; | |
return permissioninfo; | |
} | |
} | |
static String getApkName(String s) | |
{ | |
if(s == null) | |
return null; | |
int i = s.lastIndexOf("/"); | |
int j = s.lastIndexOf("."); | |
if(j == -1) | |
j = s.length(); | |
else | |
if(j == 0) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append(" Invalid code path, ").append(s).append(" Not a valid apk name").toString()); | |
return null; | |
} | |
return s.substring(i + 1, j); | |
} | |
static String getAsecPackageName(String s) | |
{ | |
int i = s.lastIndexOf("-"); | |
if(i == -1) | |
return s; | |
else | |
return s.substring(0, i); | |
} | |
private static final int getContinuationPoint(String as[], String s) | |
{ | |
if(s == null) | |
return 0; | |
int i = Arrays.binarySearch(as, s); | |
if(i < 0) | |
return -i; | |
else | |
return i + 1; | |
} | |
private File getDataPathForPackage(String s, int i) | |
{ | |
if(i == 0) | |
return new File(mAppDataDir, s); | |
else | |
return new File((new StringBuilder()).append(mUserAppDataDir.getAbsolutePath()).append(File.separator).append(i).append(File.separator).append(s).toString()); | |
} | |
private int getDefaultVerificationResponse() | |
{ | |
return android.provider.Settings.Global.getInt(mContext.getContentResolver(), "verifier_default_response", 1); | |
} | |
private String getEncryptKey() | |
{ | |
String s; | |
try | |
{ | |
s = SystemKeyStore.getInstance().retrieveKeyHexString("AppsOnSD"); | |
} | |
catch(NoSuchAlgorithmException nosuchalgorithmexception) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to create encryption keys with exception: ").append(nosuchalgorithmexception).toString()); | |
return null; | |
} | |
catch(IOException ioexception) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to retrieve encryption keys with exception: ").append(ioexception).toString()); | |
return null; | |
} | |
if(s != null) | |
break MISSING_BLOCK_LABEL_47; | |
s = SystemKeyStore.getInstance().generateNewKeyHexString(128, "AES", "AppsOnSD"); | |
if(s != null) | |
break MISSING_BLOCK_LABEL_47; | |
Slog.e("PackageManager", "Failed to create encryption keys"); | |
s = null; | |
return s; | |
} | |
private static String getNextCodePath(String s, String s1, String s2) | |
{ | |
int i; | |
String s5; | |
i = 1; | |
if(s == null) | |
break MISSING_BLOCK_LABEL_109; | |
String s4 = s; | |
if(s4.endsWith(s2)) | |
s4 = s4.substring(0, s4.length() - s2.length()); | |
int j = s4.lastIndexOf(s1); | |
if(j == -1) | |
break MISSING_BLOCK_LABEL_109; | |
s5 = s4.substring(j + s1.length()); | |
if(s5 == null) | |
break MISSING_BLOCK_LABEL_109; | |
if(s5.startsWith("-")) | |
s5 = s5.substring("-".length()); | |
int k = Integer.parseInt(s5); | |
String s3; | |
if(k <= 1) | |
i = k + 1; | |
else | |
i = k - 1; | |
_L2: | |
s3 = (new StringBuilder()).append("-").append(Integer.toString(i)).toString(); | |
return (new StringBuilder()).append(s1).append(s3).toString(); | |
NumberFormatException numberformatexception; | |
numberformatexception; | |
if(true) goto _L2; else goto _L1 | |
_L1: | |
} | |
private boolean getPackageSizeInfoLI(String s, int i, PackageStats packagestats) | |
{ | |
if(s == null) | |
{ | |
Slog.w("PackageManager", "Attempt to get size of null packageName."); | |
return false; | |
} | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
boolean flag; | |
flag = false; | |
if(package1 != null) | |
break MISSING_BLOCK_LABEL_129; | |
flag = true; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s); | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_77; | |
if(packagesetting.pkg != null) | |
break MISSING_BLOCK_LABEL_122; | |
Slog.w("PackageManager", (new StringBuilder()).append("Package named '").append(s).append("' doesn't exist.").toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return false; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
package1 = packagesetting.pkg; | |
String s1; | |
s1 = null; | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_188; | |
boolean flag2; | |
if(isExternal(package1)) | |
break MISSING_BLOCK_LABEL_160; | |
flag2 = isForwardLocked(package1); | |
s1 = null; | |
if(!flag2) | |
break MISSING_BLOCK_LABEL_188; | |
String s2 = cidFromCodePath(package1.applicationInfo.sourceDir); | |
s1 = null; | |
if(s2 == null) | |
break MISSING_BLOCK_LABEL_188; | |
s1 = PackageHelper.getSdFilesystem(s2); | |
hashmap; | |
JVM INSTR monitorexit ; | |
String s3 = null; | |
if(!flag) | |
{ | |
ApplicationInfo applicationinfo = package1.applicationInfo; | |
if(applicationinfo == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package ").append(s).append(" has no applicationInfo.").toString()); | |
return false; | |
} | |
boolean flag1 = isForwardLocked(package1); | |
s3 = null; | |
if(flag1) | |
s3 = applicationinfo.publicSourceDir; | |
} | |
if(mInstaller.getSizeInfo(s, i, package1.mPath, s3, s1, packagestats) < 0) | |
return false; | |
if(!isExternal(package1)) | |
{ | |
packagestats.codeSize = packagestats.codeSize + packagestats.externalCodeSize; | |
packagestats.externalCodeSize = 0L; | |
} | |
return true; | |
} | |
private String getRequiredVerifierLPr() | |
{ | |
List list = queryIntentReceivers(new Intent("android.intent.action.PACKAGE_NEEDS_VERIFICATION"), "application/vnd.android.package-archive", 512, 0); | |
String s = null; | |
int i = list.size(); | |
int j = 0; | |
while(j < i) | |
{ | |
ResolveInfo resolveinfo = (ResolveInfo)list.get(j); | |
if(resolveinfo.activityInfo != null) | |
{ | |
String s1 = ((PackageItemInfo) (resolveinfo.activityInfo)).packageName; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s1); | |
if(packagesetting != null && ((GrantedPermissions) (packagesetting)).grantedPermissions.contains("android.permission.PACKAGE_VERIFICATION_AGENT")) | |
{ | |
if(s != null) | |
throw new RuntimeException("There can be only one required verifier"); | |
s = s1; | |
} | |
} | |
j++; | |
} | |
return s; | |
} | |
private static File getSettingsProblemFile() | |
{ | |
return new File(new File(Environment.getDataDirectory(), "system"), "uiderrors.txt"); | |
} | |
static String getTempContainerId() | |
{ | |
int i; | |
String as[]; | |
i = 1; | |
as = PackageHelper.getSecureContainerList(); | |
if(as == null) goto _L2; else goto _L1 | |
_L1: | |
int j; | |
int k; | |
j = as.length; | |
k = 0; | |
_L6: | |
if(k >= j) goto _L2; else goto _L3 | |
_L3: | |
String s = as[k]; | |
if(s != null && s.startsWith("smdl2tmp")) goto _L5; else goto _L4 | |
_L4: | |
k++; | |
goto _L6 | |
_L5: | |
String s1 = s.substring("smdl2tmp".length()); | |
int l = Integer.parseInt(s1); | |
if(l >= i) | |
i = l + 1; | |
goto _L4 | |
_L2: | |
return (new StringBuilder()).append("smdl2tmp").append(i).toString(); | |
NumberFormatException numberformatexception; | |
numberformatexception; | |
goto _L4 | |
} | |
private int getUidForVerifier(VerifierInfo verifierinfo) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(verifierinfo.packageName); | |
if(package1 != null) | |
break MISSING_BLOCK_LABEL_32; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -1; | |
if(package1.mSignatures.length == 1) | |
break MISSING_BLOCK_LABEL_86; | |
Slog.i("PackageManager", (new StringBuilder()).append("Verifier package ").append(verifierinfo.packageName).append(" has more than one signature; ignoring").toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -1; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
byte abyte0[] = package1.mSignatures[0].getPublicKey().getEncoded(); | |
if(Arrays.equals(verifierinfo.publicKey.getEncoded(), abyte0)) | |
break MISSING_BLOCK_LABEL_165; | |
Slog.i("PackageManager", (new StringBuilder()).append("Verifier package ").append(verifierinfo.packageName).append(" does not have the expected public key; ignoring").toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -1; | |
CertificateException certificateexception; | |
certificateexception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -1; | |
int i = package1.applicationInfo.uid; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return i; | |
} | |
private int getUidTargetSdkVersionLockedLPr(int i) | |
{ | |
label0: | |
{ | |
Object obj = mSettings.getUserIdLPr(i); | |
int j; | |
if(obj instanceof SharedUserSetting) | |
{ | |
SharedUserSetting sharedusersetting = (SharedUserSetting)obj; | |
j = 10000; | |
Iterator iterator = sharedusersetting.packages.iterator(); | |
do | |
{ | |
if(!iterator.hasNext()) | |
break; | |
PackageSetting packagesetting1 = (PackageSetting)iterator.next(); | |
if(packagesetting1.pkg != null) | |
{ | |
int k = packagesetting1.pkg.applicationInfo.targetSdkVersion; | |
if(k < j) | |
j = k; | |
} | |
} while(true); | |
} else | |
{ | |
if(!(obj instanceof PackageSetting)) | |
break label0; | |
PackageSetting packagesetting = (PackageSetting)obj; | |
if(packagesetting.pkg == null) | |
break label0; | |
j = packagesetting.pkg.applicationInfo.targetSdkVersion; | |
} | |
return j; | |
} | |
return 10000; | |
} | |
private int getUnknownSourcesSettings() | |
{ | |
return android.provider.Settings.Global.getInt(mContext.getContentResolver(), "install_non_market_apps", -1); | |
} | |
private long getVerificationTimeout() | |
{ | |
return android.provider.Settings.Global.getLong(mContext.getContentResolver(), "verifier_timeout", 10000L); | |
} | |
private void grantPermissionsLPw(android.content.pm.PackageParser.Package package1, boolean flag) | |
{ | |
PackageSetting packagesetting; | |
Object obj; | |
HashSet hashset; | |
boolean flag1; | |
String s; | |
BasePermission basepermission; | |
String s1; | |
boolean flag2; | |
int k; | |
boolean flag3; | |
int i1; | |
packagesetting = (PackageSetting)package1.mExtras; | |
if(packagesetting == null) | |
return; | |
int i; | |
int j; | |
int l; | |
android.content.pm.PackageParser.NewPermissionInfo newpermissioninfo; | |
if(packagesetting.sharedUser != null) | |
obj = packagesetting.sharedUser; | |
else | |
obj = packagesetting; | |
hashset = ((GrantedPermissions) (obj)).grantedPermissions; | |
flag1 = false; | |
if(flag) | |
{ | |
packagesetting.permissionsFixed = false; | |
if(obj == packagesetting) | |
{ | |
hashset = new HashSet(((GrantedPermissions) (obj)).grantedPermissions); | |
((GrantedPermissions) (obj)).grantedPermissions.clear(); | |
obj.gids = mGlobalGids; | |
} | |
} | |
if(((GrantedPermissions) (obj)).gids == null) | |
obj.gids = mGlobalGids; | |
i = package1.requestedPermissions.size(); | |
j = 0; | |
_L11: | |
if(j >= i) | |
break MISSING_BLOCK_LABEL_940; | |
s = (String)package1.requestedPermissions.get(j); | |
basepermission = (BasePermission)mSettings.mPermissions.get(s); | |
if(basepermission == null || basepermission.packageSetting == null) | |
break MISSING_BLOCK_LABEL_897; | |
s1 = basepermission.name; | |
flag2 = false; | |
k = 0xf & basepermission.protectionLevel; | |
if(k == 0 || k == 1) | |
flag3 = true; | |
else | |
if(basepermission.packageSetting == null) | |
{ | |
flag3 = false; | |
flag2 = false; | |
} else | |
if(k == 2) | |
{ | |
if(compareSignatures(basepermission.packageSetting.signatures.mSignatures, package1.mSignatures) == 0 || compareSignatures(mPlatformPackage.mSignatures, package1.mSignatures) == 0) | |
flag3 = true; | |
else | |
flag3 = false; | |
if(!flag3 && (0x10 & basepermission.protectionLevel) != 0 && isSystemApp(package1)) | |
if(isUpdatedSystemApp(package1)) | |
{ | |
PackageSetting packagesetting1 = mSettings.getDisabledSystemPkgLPr(package1.packageName); | |
Object obj1; | |
if(packagesetting1.sharedUser != null) | |
obj1 = packagesetting1.sharedUser; | |
else | |
obj1 = packagesetting1; | |
if(((GrantedPermissions) (obj1)).grantedPermissions.contains(s1)) | |
flag3 = true; | |
else | |
flag3 = false; | |
} else | |
{ | |
flag3 = true; | |
} | |
if(!flag3 && (0x20 & basepermission.protectionLevel) != 0) | |
if(hashset.contains(s1)) | |
flag3 = true; | |
else | |
flag3 = false; | |
flag2 = false; | |
if(flag3) | |
flag2 = true; | |
} else | |
{ | |
flag3 = false; | |
flag2 = false; | |
} | |
if(!flag3) goto _L2; else goto _L1 | |
_L1: | |
if((1 & ((GrantedPermissions) (packagesetting)).pkgFlags) != 0 || !((PackageSettingBase) (packagesetting)).permissionsFixed || flag2 || ((GrantedPermissions) (obj)).grantedPermissions.contains(s1)) goto _L4; else goto _L3 | |
_L3: | |
l = PackageParser.NEW_PERMISSIONS.length; | |
i1 = 0; | |
_L8: | |
flag3 = false; | |
if(i1 >= l) goto _L4; else goto _L5 | |
_L5: | |
newpermissioninfo = PackageParser.NEW_PERMISSIONS[i1]; | |
if(!newpermissioninfo.name.equals(s1) || package1.applicationInfo.targetSdkVersion >= newpermissioninfo.sdkVersion) goto _L7; else goto _L6 | |
_L6: | |
flag3 = true; | |
Log.i("PackageManager", (new StringBuilder()).append("Auto-granting ").append(s1).append(" to old pkg ").append(package1.packageName).toString()); | |
_L4: | |
if(flag3) | |
{ | |
if(!((GrantedPermissions) (obj)).grantedPermissions.contains(s1)) | |
{ | |
flag1 = true; | |
((GrantedPermissions) (obj)).grantedPermissions.add(s1); | |
obj.gids = appendInts(((GrantedPermissions) (obj)).gids, basepermission.gids); | |
} else | |
if(!((PackageSettingBase) (packagesetting)).haveGids) | |
obj.gids = appendInts(((GrantedPermissions) (obj)).gids, basepermission.gids); | |
} else | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Not granting permission ").append(s1).append(" to package ").append(package1.packageName).append(" because it was previously installed without").toString()); | |
} | |
_L9: | |
j++; | |
continue; /* Loop/switch isn't completed */ | |
_L7: | |
i1++; | |
goto _L8 | |
_L2: | |
if(((GrantedPermissions) (obj)).grantedPermissions.remove(s1)) | |
{ | |
flag1 = true; | |
obj.gids = removeInts(((GrantedPermissions) (obj)).gids, basepermission.gids); | |
Slog.i("PackageManager", (new StringBuilder()).append("Un-granting permission ").append(s1).append(" from package ").append(package1.packageName).append(" (protectionLevel=").append(basepermission.protectionLevel).append(" flags=0x").append(Integer.toHexString(package1.applicationInfo.flags)).append(")").toString()); | |
} else | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Not granting permission ").append(s1).append(" to package ").append(package1.packageName).append(" (protectionLevel=").append(basepermission.protectionLevel).append(" flags=0x").append(Integer.toHexString(package1.applicationInfo.flags)).append(")").toString()); | |
} | |
goto _L9 | |
Slog.w("PackageManager", (new StringBuilder()).append("Unknown permission ").append(s).append(" in package ").append(package1.packageName).toString()); | |
goto _L9 | |
if((flag1 || flag) && !((PackageSettingBase) (packagesetting)).permissionsFixed && (1 & ((GrantedPermissions) (packagesetting)).pkgFlags) == 0 || (0x80 & ((GrantedPermissions) (packagesetting)).pkgFlags) != 0) | |
packagesetting.permissionsFixed = true; | |
packagesetting.haveGids = true; | |
return; | |
if(true) goto _L11; else goto _L10 | |
_L10: | |
} | |
private static boolean hasPermission(android.content.pm.PackageParser.Package package1, String s) | |
{ | |
for(int i = -1 + package1.permissions.size(); i >= 0; i--) | |
if(((PackageItemInfo) (((android.content.pm.PackageParser.Permission)package1.permissions.get(i)).info)).name.equals(s)) | |
return true; | |
return false; | |
} | |
private static boolean ignoreCodePath(String s) | |
{ | |
String s2; | |
String s1 = getApkName(s); | |
int i = s1.lastIndexOf("-"); | |
if(i == -1 || i + 1 >= s1.length()) | |
break MISSING_BLOCK_LABEL_44; | |
s2 = s1.substring(i + 1); | |
Integer.parseInt(s2); | |
return true; | |
NumberFormatException numberformatexception; | |
numberformatexception; | |
return false; | |
} | |
private static boolean installForwardLocked(int i) | |
{ | |
return (i & 1) != 0; | |
} | |
private void installNewPackageLI(android.content.pm.PackageParser.Package package1, int i, int j, UserHandle userhandle, String s, PackageInstalledInfo packageinstalledinfo) | |
{ | |
String s1; | |
boolean flag; | |
label0: | |
{ | |
s1 = package1.packageName; | |
flag = getDataPathForPackage(package1.packageName, 0).exists(); | |
synchronized(mPackages) | |
{ | |
if(!mSettings.mRenamedPackages.containsKey(s1)) | |
break label0; | |
Slog.w("PackageManager", (new StringBuilder()).append("Attempt to re-install ").append(s1).append(" without first uninstalling package running as ").append((String)mSettings.mRenamedPackages.get(s1)).toString()); | |
packageinstalledinfo.returnCode = -1; | |
} | |
return; | |
} | |
if(!mPackages.containsKey(s1) && !mAppDirs.containsKey(package1.mPath)) | |
break MISSING_BLOCK_LABEL_182; | |
Slog.w("PackageManager", (new StringBuilder()).append("Attempt to re-install ").append(s1).append(" without first uninstalling.").toString()); | |
packageinstalledinfo.returnCode = -1; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
mLastScanError = 1; | |
android.content.pm.PackageParser.Package package2 = scanPackageLI(package1, i, j, System.currentTimeMillis(), userhandle); | |
if(package2 == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package couldn't be installed in ").append(package1.mPath).toString()); | |
int l = mLastScanError; | |
packageinstalledinfo.returnCode = l; | |
if(l == 1) | |
{ | |
packageinstalledinfo.returnCode = -2; | |
return; | |
} | |
} else | |
{ | |
updateSettingsLI(package2, s, packageinstalledinfo); | |
if(packageinstalledinfo.returnCode != 1) | |
{ | |
UserHandle userhandle1 = UserHandle.ALL; | |
int k; | |
if(flag) | |
k = 1; | |
else | |
k = 0; | |
deletePackageLI(s1, userhandle1, false, k, packageinstalledinfo.removedInfo, true, true); | |
return; | |
} | |
} | |
return; | |
} | |
private static boolean installOnSd(int i) | |
{ | |
while((i & 0x10) != 0 || (i & 8) == 0) | |
return false; | |
return true; | |
} | |
private void installPackageLI(InstallArgs installargs, boolean flag, PackageInstalledInfo packageinstalledinfo) | |
{ | |
int i; | |
String s; | |
boolean flag2; | |
int l; | |
int k1; | |
android.content.pm.PackageParser.Package package1; | |
String s1; | |
i = installargs.flags; | |
s = installargs.installerPackageName; | |
File file = new File(installargs.getCodePath()); | |
boolean flag1; | |
int j; | |
int k; | |
byte byte0; | |
if((i & 1) != 0) | |
flag1 = true; | |
else | |
flag1 = false; | |
if((i & 8) != 0) | |
flag2 = true; | |
else | |
flag2 = false; | |
if(flag2) | |
j = 0; | |
else | |
j = 1; | |
k = 8 | (j | 4); | |
if(flag) | |
byte0 = 16; | |
else | |
byte0 = 0; | |
l = k | byte0; | |
packageinstalledinfo.returnCode = 1; | |
if(!mSecurityBridge.approveAppInstallRequest(installargs.getResourcePath(), installargs.packageURI.toSafeString())) | |
{ | |
packageinstalledinfo.returnCode = -22; | |
return; | |
} | |
int i1 = 2 | mDefParseFlags; | |
byte byte1; | |
int j1; | |
byte byte2; | |
PackageParser packageparser; | |
if(flag1) | |
byte1 = 16; | |
else | |
byte1 = 0; | |
j1 = i1 | byte1; | |
if(flag2) | |
byte2 = 32; | |
else | |
byte2 = 0; | |
k1 = j1 | byte2; | |
if((0x10000000 & i) != 0) | |
{ | |
k1 |= 0x41; | |
l |= 0x8000; | |
} | |
packageparser = new PackageParser(file.getPath()); | |
packageparser.setSeparateProcesses(mSeparateProcesses); | |
package1 = packageparser.parsePackage(file, null, mMetrics, k1); | |
if(package1 == null) | |
{ | |
packageinstalledinfo.returnCode = packageparser.getParseError(); | |
return; | |
} | |
s1 = package1.packageName; | |
packageinstalledinfo.name = s1; | |
if((0x100 & package1.applicationInfo.flags) != 0 && (i & 4) == 0) | |
{ | |
packageinstalledinfo.returnCode = -15; | |
return; | |
} | |
if(!packageparser.collectCertificates(package1, k1)) | |
{ | |
packageinstalledinfo.returnCode = packageparser.getParseError(); | |
return; | |
} | |
if(Mdm.getInstance() != null && Mdm.getInstance().isFailedInstallByMDM(null, package1.packageName, package1.mSignatures, i, installargs.user)) | |
{ | |
packageinstalledinfo.returnCode = -6; | |
return; | |
} | |
if(installargs.manifestDigest != null && !installargs.manifestDigest.equals(package1.manifestDigest)) | |
{ | |
packageinstalledinfo.returnCode = -23; | |
return; | |
} | |
if(ThreelmMdmConfig.THREELM_MDM) | |
{ | |
ArrayList arraylist = new ArrayList(); | |
Signature asignature[] = package1.mSignatures; | |
int l1 = asignature.length; | |
for(int i2 = 0; i2 < l1; i2++) | |
arraylist.add(Base64.encodeToString(asignature[i2].toByteArray(), 0)); | |
DeviceManager3LMService devicemanager3lmservice = mDeviceManager; | |
ArrayList arraylist1 = package1.requestedPermissions; | |
if(!devicemanager3lmservice.checkAppInstallPolicies(s1, arraylist1, arraylist)) | |
{ | |
packageinstalledinfo.returnCode = -2; | |
return; | |
} | |
} | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
int j2; | |
boolean flag3; | |
j2 = i & 2; | |
flag3 = false; | |
if(j2 == 0) goto _L2; else goto _L1 | |
_L1: | |
String s3 = (String)mSettings.mRenamedPackages.get(s1); | |
if(package1.mOriginalPackages == null || !package1.mOriginalPackages.contains(s3) || !mPackages.containsKey(s3)) goto _L4; else goto _L3 | |
_L3: | |
package1.setPackageName(s3); | |
s1 = package1.packageName; | |
flag3 = true; | |
_L2: | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s1); | |
String s2; | |
boolean flag4; | |
s2 = null; | |
flag4 = false; | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_700; | |
android.content.pm.PackageParser.Package package2; | |
s2 = ((PackageSettingBase) ((PackageSetting)mSettings.mPackages.get(s1))).codePathString; | |
package2 = packagesetting.pkg; | |
flag4 = false; | |
if(package2 == null) | |
break MISSING_BLOCK_LABEL_684; | |
ApplicationInfo applicationinfo = packagesetting.pkg.applicationInfo; | |
flag4 = false; | |
if(applicationinfo == null) | |
break MISSING_BLOCK_LABEL_684; | |
Exception exception; | |
boolean flag5; | |
if((1 & packagesetting.pkg.applicationInfo.flags) != 0) | |
flag4 = true; | |
else | |
flag4 = false; | |
packageinstalledinfo.origUsers = packagesetting.queryInstalledUsers(sUserManager.getUserIds(), true); | |
hashmap; | |
JVM INSTR monitorexit ; | |
if(flag4 && flag2) | |
{ | |
Slog.w("PackageManager", "Cannot install updates to system apps on sdcard"); | |
packageinstalledinfo.returnCode = -19; | |
return; | |
} | |
break; /* Loop/switch isn't completed */ | |
_L4: | |
flag5 = mPackages.containsKey(s1); | |
flag3 = false; | |
if(flag5) | |
flag3 = true; | |
if(true) goto _L2; else goto _L5 | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L5: | |
if(!installargs.doRename(packageinstalledinfo.returnCode, s1, s2)) | |
{ | |
packageinstalledinfo.returnCode = -4; | |
return; | |
} | |
setApplicationInfoPaths(package1, installargs.getCodePath(), installargs.getResourcePath()); | |
package1.applicationInfo.nativeLibraryDir = installargs.getNativeLibraryPath(); | |
HashMap hashmap1; | |
Exception exception1; | |
PackageSetting packagesetting1; | |
if(flag3) | |
replacePackageLI(package1, k1, l, installargs.user, s, packageinstalledinfo); | |
else | |
installNewPackageLI(package1, k1, l, installargs.user, s, packageinstalledinfo); | |
hashmap1 = mPackages; | |
hashmap1; | |
JVM INSTR monitorenter ; | |
packagesetting1 = (PackageSetting)mSettings.mPackages.get(s1); | |
if(packagesetting1 == null) | |
break MISSING_BLOCK_LABEL_878; | |
packageinstalledinfo.newUsers = packagesetting1.queryInstalledUsers(sUserManager.getUserIds(), true); | |
hashmap1; | |
JVM INSTR monitorexit ; | |
return; | |
exception1; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
} | |
private boolean isAsecExternal(String s) | |
{ | |
String s1 = PackageHelper.getSdFilesystem(s); | |
if(s1 == null) | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to get container filesystem for ").append(s).toString()); | |
else | |
if(!s1.startsWith(mAsecInternalPath)) | |
return true; | |
return false; | |
} | |
private static boolean isExternal(android.content.pm.PackageParser.Package package1) | |
{ | |
return (0x40000 & package1.applicationInfo.flags) != 0; | |
} | |
private static boolean isExternal(PackageSetting packagesetting) | |
{ | |
return (0x40000 & ((GrantedPermissions) (packagesetting)).pkgFlags) != 0; | |
} | |
private boolean isExternalMediaAvailable() | |
{ | |
return mMediaMounted || Environment.isExternalStorageEmulated(); | |
} | |
private static boolean isForwardLocked(android.content.pm.PackageParser.Package package1) | |
{ | |
return (0x20000000 & package1.applicationInfo.flags) != 0; | |
} | |
private boolean isForwardLocked(PackageSetting packagesetting) | |
{ | |
return (0x20000000 & ((GrantedPermissions) (packagesetting)).pkgFlags) != 0; | |
} | |
private static final boolean isPackageFilename(String s) | |
{ | |
return s != null && s.endsWith(".apk"); | |
} | |
private boolean isPermissionEnforcedDefault(String s) | |
{ | |
return !"android.permission.READ_EXTERNAL_STORAGE".equals(s) || android.provider.Settings.Global.getInt(mContext.getContentResolver(), "read_external_storage_enforced_default", 0) != 0; | |
} | |
private boolean isPermissionEnforcedLocked(String s, boolean flag) | |
{ | |
if("android.permission.READ_EXTERNAL_STORAGE".equals(s)) | |
{ | |
if(mSettings.mReadExternalStorageEnforced != null) | |
flag = mSettings.mReadExternalStorageEnforced.booleanValue(); | |
return flag; | |
} else | |
{ | |
return true; | |
} | |
} | |
private static boolean isSystemApp(ApplicationInfo applicationinfo) | |
{ | |
return (1 & applicationinfo.flags) != 0; | |
} | |
private static boolean isSystemApp(android.content.pm.PackageParser.Package package1) | |
{ | |
return (1 & package1.applicationInfo.flags) != 0; | |
} | |
private static boolean isSystemApp(PackageSetting packagesetting) | |
{ | |
return (1 & ((GrantedPermissions) (packagesetting)).pkgFlags) != 0; | |
} | |
private static boolean isUpdatedSystemApp(android.content.pm.PackageParser.Package package1) | |
{ | |
return (0x80 & package1.applicationInfo.flags) != 0; | |
} | |
private boolean isVerificationEnabled(int i) | |
{ | |
boolean flag; | |
for(flag = true; (i & 0x20) != 0 && (ActivityManager.isRunningInTestHarness() || android.provider.Settings.Global.getInt(mContext.getContentResolver(), "verifier_verify_adb_installs", flag) == 0) || Mdm.getInstance() != null && Mdm.getInstance().checkInstallByMDM(i);) | |
return false; | |
if(android.provider.Settings.Global.getInt(mContext.getContentResolver(), "package_verifier_enable", flag) != flag) | |
flag = false; | |
return flag; | |
} | |
private void killApplication(String s, int i) | |
{ | |
IActivityManager iactivitymanager; | |
iactivitymanager = ActivityManagerNative.getDefault(); | |
if(iactivitymanager == null) | |
break MISSING_BLOCK_LABEL_16; | |
iactivitymanager.killApplicationWithAppId(s, i); | |
return; | |
RemoteException remoteexception; | |
remoteexception; | |
} | |
private void loadMediaPackages(HashMap hashmap, int ai[], HashSet hashset) | |
{ | |
ArrayList arraylist; | |
boolean flag; | |
Iterator iterator; | |
arraylist = new ArrayList(); | |
Set set = hashmap.keySet(); | |
flag = false; | |
iterator = set.iterator(); | |
_L6: | |
if(!iterator.hasNext()) goto _L2; else goto _L1 | |
_L1: | |
AsecInstallArgs asecinstallargs; | |
String s1; | |
byte byte1; | |
asecinstallargs = (AsecInstallArgs)iterator.next(); | |
s1 = (String)hashmap.get(asecinstallargs); | |
byte1 = -18; | |
if(asecinstallargs.doPreInstall(1) == 1) goto _L4; else goto _L3 | |
_L3: | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to mount cid : ").append(asecinstallargs.cid).append(" when installing from sdcard").toString()); | |
if(byte1 == 1) goto _L6; else goto _L5 | |
_L5: | |
String s2 = asecinstallargs.cid; | |
_L8: | |
hashset.add(s2); | |
goto _L6 | |
_L4: | |
if(s1 == null) | |
break MISSING_BLOCK_LABEL_151; | |
if(s1.equals(asecinstallargs.getCodePath())) | |
break MISSING_BLOCK_LABEL_222; | |
Slog.e("PackageManager", (new StringBuilder()).append("Container ").append(asecinstallargs.cid).append(" cachepath ").append(asecinstallargs.getCodePath()).append(" does not match one in settings ").append(s1).toString()); | |
if(byte1 == 1) goto _L6; else goto _L7 | |
_L7: | |
s2 = asecinstallargs.cid; | |
goto _L8 | |
int i = mDefParseFlags; | |
if(asecinstallargs.isExternal()) | |
i |= 0x20; | |
if(asecinstallargs.isFwdLocked()) | |
i |= 0x10; | |
flag = true; | |
Object obj = mInstallLock; | |
obj; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = scanPackageLI(new File(s1), i, 0, 0L, null); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_392; | |
HashMap hashmap2 = mPackages; | |
hashmap2; | |
JVM INSTR monitorenter ; | |
byte1 = 1; | |
arraylist.add(package1.packageName); | |
asecinstallargs.doPostInstall(1, package1.applicationInfo.uid); | |
hashmap2; | |
JVM INSTR monitorexit ; | |
_L10: | |
obj; | |
JVM INSTR monitorexit ; | |
if(byte1 == 1) goto _L6; else goto _L9 | |
_L9: | |
s2 = asecinstallargs.cid; | |
goto _L8 | |
Exception exception3; | |
exception3; | |
hashmap2; | |
JVM INSTR monitorexit ; | |
throw exception3; | |
Exception exception2; | |
exception2; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception2; | |
Exception exception1; | |
exception1; | |
if(byte1 != 1) | |
hashset.add(asecinstallargs.cid); | |
throw exception1; | |
Slog.i("PackageManager", (new StringBuilder()).append("Failed to install pkg from ").append(s1).append(" from sdcard").toString()); | |
goto _L10 | |
_L2: | |
HashMap hashmap1 = mPackages; | |
hashmap1; | |
JVM INSTR monitorenter ; | |
byte byte0; | |
boolean flag1; | |
Iterator iterator1; | |
if(mSettings.mExternalSdkPlatform != mSdkVersion) | |
flag1 = true; | |
else | |
flag1 = false; | |
if(!flag1) | |
break MISSING_BLOCK_LABEL_510; | |
Slog.i("PackageManager", (new StringBuilder()).append("Platform changed from ").append(mSettings.mExternalSdkPlatform).append(" to ").append(mSdkVersion).append("; regranting permissions for external storage").toString()); | |
mSettings.mExternalSdkPlatform = mSdkVersion; | |
if(flag1) | |
byte0 = 6; | |
else | |
byte0 = 0; | |
updatePermissionsLPw(null, null, byte0 | 1); | |
mSettings.writeLPr(); | |
hashmap1; | |
JVM INSTR monitorexit ; | |
if(arraylist.size() > 0) | |
sendResourcesChangedBroadcast(true, arraylist, ai, null); | |
if(flag) | |
Runtime.getRuntime().gc(); | |
if(hashset != null) | |
for(iterator1 = hashset.iterator(); iterator1.hasNext();) | |
{ | |
String s = (String)iterator1.next(); | |
Exception exception; | |
if(s.startsWith("smdl2tmp")) | |
{ | |
Log.i("PackageManager", (new StringBuilder()).append("Destroying stale temporary container ").append(s).toString()); | |
PackageHelper.destroySdDir(s); | |
} else | |
{ | |
Log.w("PackageManager", (new StringBuilder()).append("Container ").append(s).append(" is stale").toString()); | |
} | |
} | |
break MISSING_BLOCK_LABEL_712; | |
exception; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception; | |
goto _L8 | |
} | |
public static final IPackageManager main(Context context, Installer installer, boolean flag, boolean flag1) | |
{ | |
PackageManagerService packagemanagerservice = new PackageManagerService(context, installer, flag, flag1); | |
ServiceManager.addService("package", packagemanagerservice); | |
return packagemanagerservice; | |
} | |
private ComponentName matchComponentForVerifier(String s, List list) | |
{ | |
int i; | |
int j; | |
i = list.size(); | |
j = 0; | |
_L3: | |
ActivityInfo activityinfo; | |
ResolveInfo resolveinfo; | |
activityinfo = null; | |
if(j >= i) | |
break; /* Loop/switch isn't completed */ | |
resolveinfo = (ResolveInfo)list.get(j); | |
goto _L1 | |
_L5: | |
j++; | |
if(true) goto _L3; else goto _L2 | |
_L1: | |
if(resolveinfo.activityInfo == null || !s.equals(((PackageItemInfo) (resolveinfo.activityInfo)).packageName)) goto _L5; else goto _L4 | |
_L4: | |
activityinfo = resolveinfo.activityInfo; | |
_L2: | |
if(activityinfo == null) | |
return null; | |
else | |
return new ComponentName(((PackageItemInfo) (activityinfo)).packageName, ((PackageItemInfo) (activityinfo)).name); | |
} | |
private List matchVerifiers(PackageInfoLite packageinfolite, List list, PackageVerificationState packageverificationstate) | |
{ | |
Object obj; | |
if(packageinfolite.verifiers.length == 0) | |
{ | |
obj = null; | |
} else | |
{ | |
int i = packageinfolite.verifiers.length; | |
obj = new ArrayList(i + 1); | |
int j = 0; | |
while(j < i) | |
{ | |
VerifierInfo verifierinfo = packageinfolite.verifiers[j]; | |
ComponentName componentname = matchComponentForVerifier(verifierinfo.packageName, list); | |
if(componentname != null) | |
{ | |
int k = getUidForVerifier(verifierinfo); | |
if(k != -1) | |
{ | |
((List) (obj)).add(componentname); | |
packageverificationstate.addSufficientVerifier(k); | |
} | |
} | |
j++; | |
} | |
} | |
return ((List) (obj)); | |
} | |
private int moveDexFilesLI(android.content.pm.PackageParser.Package package1) | |
{ | |
label0: | |
{ | |
if((4 & package1.applicationInfo.flags) != 0 && mInstaller.movedex(package1.mScanPath, package1.mPath) != 0) | |
{ | |
if(!mNoDexOpt) | |
break label0; | |
Slog.i("PackageManager", (new StringBuilder()).append("dex file doesn't exist, skipping move: ").append(package1.mPath).toString()); | |
} | |
return 1; | |
} | |
Slog.e("PackageManager", (new StringBuilder()).append("Couldn't rename dex file: ").append(package1.mPath).toString()); | |
return -4; | |
} | |
private int packageFlagsToInstallFlags(PackageSetting packagesetting) | |
{ | |
boolean flag = isExternal(packagesetting); | |
int i = 0; | |
if(flag) | |
i = 0 | 8; | |
if(isForwardLocked(packagesetting)) | |
i |= 1; | |
return i; | |
} | |
private int performDexOptLI(android.content.pm.PackageParser.Package package1, boolean flag, boolean flag1) | |
{ | |
int i; | |
int j; | |
boolean flag2; | |
i = 1; | |
j = 4 & package1.applicationInfo.flags; | |
flag2 = false; | |
if(j == 0) goto _L2; else goto _L1 | |
_L1: | |
String s; | |
s = package1.mScanPath; | |
if(flag) | |
break MISSING_BLOCK_LABEL_50; | |
boolean flag4 = DexFile.isDexOptNeeded(s); | |
int k; | |
flag2 = false; | |
k = 0; | |
if(!flag4) | |
break MISSING_BLOCK_LABEL_151; | |
if(flag || !flag1) | |
break MISSING_BLOCK_LABEL_69; | |
mDeferredDexOpt.add(package1); | |
return 2; | |
int l; | |
Installer installer; | |
Log.i("PackageManager", (new StringBuilder()).append("Running dexopt on: ").append(((PackageItemInfo) (package1.applicationInfo)).packageName).toString()); | |
l = UserHandle.getSharedAppGid(package1.applicationInfo.uid); | |
installer = mInstaller; | |
boolean flag3; | |
if(!isForwardLocked(package1)) | |
flag3 = i; | |
else | |
flag3 = false; | |
k = installer.dexopt(s, l, flag3); | |
package1.mDidDexOpt = true; | |
flag2 = true; | |
_L3: | |
if(k < 0) | |
return -1; | |
break; /* Loop/switch isn't completed */ | |
FileNotFoundException filenotfoundexception; | |
filenotfoundexception; | |
Slog.w("PackageManager", (new StringBuilder()).append("Apk not found for dexopt: ").append(s).toString()); | |
k = -1; | |
flag2 = false; | |
continue; /* Loop/switch isn't completed */ | |
IOException ioexception; | |
ioexception; | |
Slog.w("PackageManager", (new StringBuilder()).append("IOException reading apk: ").append(s).toString(), ioexception); | |
k = -1; | |
flag2 = false; | |
continue; /* Loop/switch isn't completed */ | |
StaleDexCacheError staledexcacheerror; | |
staledexcacheerror; | |
Slog.w("PackageManager", (new StringBuilder()).append("StaleDexCacheError when reading apk: ").append(s).toString(), staledexcacheerror); | |
k = -1; | |
flag2 = false; | |
continue; /* Loop/switch isn't completed */ | |
Exception exception; | |
exception; | |
Slog.w("PackageManager", "Exception when doing dexopt : ", exception); | |
k = -1; | |
flag2 = false; | |
if(true) goto _L3; else goto _L2 | |
_L2: | |
if(!flag2) | |
i = 0; | |
return i; | |
} | |
private void processPendingInstall(final InstallArgs args, final int currentStatus) | |
{ | |
mHandler.post(new Runnable() { | |
public void run() | |
{ | |
mHandler.removeCallbacks(this); | |
PackageInstalledInfo packageinstalledinfo = new PackageInstalledInfo(); | |
packageinstalledinfo.returnCode = currentStatus; | |
packageinstalledinfo.uid = -1; | |
packageinstalledinfo.pkg = null; | |
packageinstalledinfo.removedInfo = new PackageRemovedInfo(); | |
if(packageinstalledinfo.returnCode == 1) | |
{ | |
args.doPreInstall(packageinstalledinfo.returnCode); | |
synchronized(mInstallLock) | |
{ | |
installPackageLI(args, true, packageinstalledinfo); | |
} | |
args.doPostInstall(packageinstalledinfo.returnCode, packageinstalledinfo.uid); | |
} | |
boolean flag; | |
boolean flag1; | |
PackageManagerService packagemanagerservice; | |
int i; | |
PostInstallData postinstalldata; | |
if(packageinstalledinfo.removedInfo.removedPackage != null) | |
flag = true; | |
else | |
flag = false; | |
if(!flag && packageinstalledinfo.pkg != null && packageinstalledinfo.pkg.applicationInfo.backupAgentName != null) | |
flag1 = true; | |
else | |
flag1 = false; | |
if(mNextInstallToken < 0) | |
mNextInstallToken = 1; | |
packagemanagerservice = PackageManagerService.this; | |
i = packagemanagerservice.mNextInstallToken; | |
packagemanagerservice.mNextInstallToken = i + 1; | |
postinstalldata = new PostInstallData(args, packageinstalledinfo); | |
mRunningInstalls.put(i, postinstalldata); | |
if(packageinstalledinfo.returnCode == 1 && flag1) | |
{ | |
IBackupManager ibackupmanager = android.app.backup.IBackupManager.Stub.asInterface(ServiceManager.getService("backup")); | |
Message message; | |
if(ibackupmanager != null) | |
{ | |
try | |
{ | |
ibackupmanager.restoreAtInstall(((PackageItemInfo) (packageinstalledinfo.pkg.applicationInfo)).packageName, i); | |
} | |
catch(RemoteException remoteexception) { } | |
catch(Exception exception) | |
{ | |
Slog.e("PackageManager", "Exception trying to enqueue restore", exception); | |
flag1 = false; | |
} | |
} else | |
{ | |
Slog.e("PackageManager", "Backup Manager not found!"); | |
flag1 = false; | |
} | |
} | |
if(!flag1) | |
{ | |
message = mHandler.obtainMessage(9, i, 0); | |
mHandler.sendMessage(message); | |
} | |
return; | |
exception1; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
} | |
final PackageManagerService this$0; | |
final InstallArgs val$args; | |
final int val$currentStatus; | |
{ | |
this$0 = PackageManagerService.this; | |
currentStatus = i; | |
args = installargs; | |
super(); | |
} | |
} | |
); | |
} | |
private void processPendingMove(final MoveParams mp, final int currentStatus) | |
{ | |
mHandler.post(new Runnable() { | |
public void run() | |
{ | |
int i; | |
mHandler.removeCallbacks(this); | |
i = currentStatus; | |
if(currentStatus != 1) goto _L2; else goto _L1 | |
_L1: | |
int ai[]; | |
ArrayList arraylist; | |
ai = null; | |
arraylist = null; | |
HashMap hashmap1 = mPackages; | |
hashmap1; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package2 = (android.content.pm.PackageParser.Package)mPackages.get(mp.packageName); | |
if(package2 != null) goto _L4; else goto _L3 | |
_L3: | |
Slog.w("PackageManager", (new StringBuilder()).append(" Package ").append(mp.packageName).append(" doesn't exist. Aborting move").toString()); | |
i = -2; | |
_L10: | |
hashmap1; | |
JVM INSTR monitorexit ; | |
if(i != 1) goto _L2; else goto _L5 | |
_L5: | |
sendResourcesChangedBroadcast(false, arraylist, ai, null); | |
Object obj1 = mInstallLock; | |
obj1; | |
JVM INSTR monitorenter ; | |
HashMap hashmap2 = mPackages; | |
hashmap2; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package3 = (android.content.pm.PackageParser.Package)mPackages.get(mp.packageName); | |
if(package3 != null) goto _L7; else goto _L6 | |
_L6: | |
Slog.w("PackageManager", (new StringBuilder()).append(" Package ").append(mp.packageName).append(" doesn't exist. Aborting move").toString()); | |
i = -2; | |
_L11: | |
hashmap2; | |
JVM INSTR monitorexit ; | |
obj1; | |
JVM INSTR monitorexit ; | |
sendResourcesChangedBroadcast(true, arraylist, ai, null); | |
_L2: | |
IPackageMoveObserver ipackagemoveobserver; | |
HashMap hashmap; | |
android.content.pm.PackageParser.Package package1; | |
Exception exception2; | |
String s; | |
String s1; | |
String s2; | |
String s3; | |
int ai1[]; | |
int j; | |
int ai2[]; | |
ArrayList arraylist1; | |
if(i != 1) | |
{ | |
if(mp.targetArgs != null) | |
mp.targetArgs.doPostInstall(-110, -1); | |
} else | |
{ | |
Runtime.getRuntime().gc(); | |
synchronized(mInstallLock) | |
{ | |
mp.srcArgs.doPostDeleteLI(true); | |
} | |
} | |
if(i == -7) goto _L9; else goto _L8 | |
_L8: | |
hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
package1 = (android.content.pm.PackageParser.Package)mPackages.get(mp.packageName); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_318; | |
package1.mOperationPending = false; | |
hashmap; | |
JVM INSTR monitorexit ; | |
_L9: | |
ipackagemoveobserver = mp.observer; | |
if(ipackagemoveobserver == null) | |
break MISSING_BLOCK_LABEL_350; | |
ipackagemoveobserver.packageMoved(mp.packageName, i); | |
return; | |
_L4: | |
if(mp.srcArgs.getCodePath().equals(package2.applicationInfo.sourceDir)) | |
break MISSING_BLOCK_LABEL_457; | |
Slog.w("PackageManager", (new StringBuilder()).append("Package ").append(mp.packageName).append(" code path changed from ").append(mp.srcArgs.getCodePath()).append(" to ").append(package2.applicationInfo.sourceDir).append(" Aborting move and returning error").toString()); | |
i = -6; | |
arraylist = null; | |
ai = null; | |
goto _L10 | |
ai2 = new int[1]; | |
ai2[0] = package2.applicationInfo.uid; | |
arraylist1 = new ArrayList(); | |
arraylist1.add(mp.packageName); | |
arraylist = arraylist1; | |
ai = ai2; | |
goto _L10 | |
exception2; | |
_L17: | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception2; | |
_L7: | |
if(mp.srcArgs.getCodePath().equals(package3.applicationInfo.sourceDir)) | |
break MISSING_BLOCK_LABEL_615; | |
Slog.w("PackageManager", (new StringBuilder()).append("Package ").append(mp.packageName).append(" code path changed from ").append(mp.srcArgs.getCodePath()).append(" to ").append(package3.applicationInfo.sourceDir).append(" Aborting move and returning error").toString()); | |
i = -6; | |
goto _L11 | |
s = package3.mPath; | |
s1 = mp.targetArgs.getCodePath(); | |
s2 = mp.targetArgs.getResourcePath(); | |
s3 = mp.targetArgs.getNativeLibraryPath(); | |
File file = new File(s3); | |
if(!PackageManagerService.isForwardLocked(package3) && !PackageManagerService.isExternal(package3)) | |
{ | |
File file3 = new File(s1); | |
NativeLibraryHelper.copyNativeBinariesIfNeededLI(file3, file); | |
} | |
ai1 = PackageManagerService.sUserManager.getUserIds(); | |
j = ai1.length; | |
RemoteException remoteexception; | |
Exception exception1; | |
Exception exception3; | |
Exception exception4; | |
int l; | |
PackageSetting packagesetting; | |
File file1; | |
File file2; | |
ApplicationInfo applicationinfo; | |
ApplicationInfo applicationinfo1; | |
for(int k = 0; k >= j; k++) | |
break MISSING_BLOCK_LABEL_761; | |
l = ai1[k]; | |
if(mInstaller.linkNativeLibraryDirectory(package3.packageName, s3, l) < 0) | |
i = -1; | |
break MISSING_BLOCK_LABEL_1126; | |
if(i != 1) goto _L13; else goto _L12 | |
_L12: | |
package3.mPath = s1; | |
if(moveDexFilesLI(package3) == 1) goto _L13; else goto _L14 | |
_L14: | |
package3.mPath = package3.mScanPath; | |
i = -1; | |
_L13: | |
if(i != 1) goto _L11; else goto _L15 | |
_L15: | |
package3.mScanPath = s1; | |
package3.applicationInfo.sourceDir = s1; | |
package3.applicationInfo.publicSourceDir = s2; | |
package3.applicationInfo.nativeLibraryDir = s3; | |
packagesetting = (PackageSetting)package3.mExtras; | |
file1 = new File(package3.applicationInfo.sourceDir); | |
packagesetting.codePath = file1; | |
packagesetting.codePathString = ((PackageSettingBase) (packagesetting)).codePath.getPath(); | |
file2 = new File(package3.applicationInfo.publicSourceDir); | |
packagesetting.resourcePath = file2; | |
packagesetting.resourcePathString = ((PackageSettingBase) (packagesetting)).resourcePath.getPath(); | |
packagesetting.nativeLibraryPathString = s3; | |
if((8 & mp.flags) == 0) | |
break MISSING_BLOCK_LABEL_1034; | |
applicationinfo1 = package3.applicationInfo; | |
applicationinfo1.flags = 0x40000 | applicationinfo1.flags; | |
_L16: | |
packagesetting.setFlags(package3.applicationInfo.flags); | |
mAppDirs.remove(s); | |
mAppDirs.put(s1, package3); | |
mSettings.writeLPr(); | |
goto _L11 | |
exception4; | |
hashmap2; | |
JVM INSTR monitorexit ; | |
throw exception4; | |
exception3; | |
obj1; | |
JVM INSTR monitorexit ; | |
throw exception3; | |
applicationinfo = package3.applicationInfo; | |
applicationinfo.flags = 0xfffbffff & applicationinfo.flags; | |
goto _L16 | |
exception; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception; | |
exception1; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
remoteexception; | |
Log.i("PackageManager", "Observer no longer exists."); | |
return; | |
exception2; | |
goto _L17 | |
exception2; | |
goto _L17 | |
} | |
final PackageManagerService this$0; | |
final int val$currentStatus; | |
final MoveParams val$mp; | |
{ | |
this$0 = PackageManagerService.this; | |
currentStatus = i; | |
mp = moveparams; | |
super(); | |
} | |
} | |
); | |
} | |
private HashSet readConfigFile(String s) | |
{ | |
HashSet hashset = new HashSet(); | |
BufferedReader bufferedreader = new BufferedReader(new FileReader(s)); | |
_L3: | |
String s1 = bufferedreader.readLine(); | |
if(s1 == null) goto _L2; else goto _L1 | |
_L1: | |
String s2 = s1.trim(); | |
if(s2.length() > 0) | |
hashset.add(s2); | |
goto _L3 | |
IOException ioexception; | |
ioexception; | |
_L5: | |
Log.e("PackageManager", (new StringBuilder()).append("Could not read ").append(s).append(" -->").append(ioexception.getMessage()).toString()); | |
return hashset; | |
_L2: | |
bufferedreader.close(); | |
return hashset; | |
ioexception; | |
if(true) goto _L5; else goto _L4 | |
_L4: | |
} | |
private void readHiddenApkList() | |
{ | |
hiddenApkList.clear(); | |
File file = new File((new StringBuilder()).append(SystemProperties.get("ro.lge.capp_cupss.rootdir", "/cust")).append("/config/custom_apk_list.cfg").toString()); | |
if(file.exists()) | |
{ | |
Iterator iterator = readConfigFile("/etc/3rd_party_apps.cfg").iterator(); | |
do | |
{ | |
if(!iterator.hasNext()) | |
break; | |
String s2 = (String)iterator.next(); | |
if(isPackageFilename(s2)) | |
hiddenApkList.add(s2); | |
} while(true); | |
Iterator iterator1 = readConfigFile(file.getAbsolutePath()).iterator(); | |
while(iterator1.hasNext()) | |
{ | |
String s = (String)iterator1.next(); | |
if(s.length() >= 2) | |
{ | |
String s1 = s.substring(1); | |
if(s.startsWith("+")) | |
hiddenApkList.remove(s1); | |
else | |
if(s.startsWith("-")) | |
hiddenApkList.add(s1); | |
} | |
} | |
} | |
} | |
private void readPermissionsFromXml(File file) | |
{ | |
FileReader filereader; | |
XmlPullParser xmlpullparser; | |
try | |
{ | |
filereader = new FileReader(file); | |
} | |
catch(FileNotFoundException filenotfoundexception) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't find or open permissions file ").append(file).toString()); | |
return; | |
} | |
xmlpullparser = Xml.newPullParser(); | |
xmlpullparser.setInput(filereader); | |
XmlUtils.beginDocument(xmlpullparser, "permissions"); | |
_L3: | |
XmlUtils.nextElement(xmlpullparser); | |
if(xmlpullparser.getEventType() != 1) goto _L2; else goto _L1 | |
_L1: | |
filereader.close(); | |
_L4: | |
return; | |
_L2: | |
String s; | |
String s8; | |
s = xmlpullparser.getName(); | |
if(!"group".equals(s)) | |
break MISSING_BLOCK_LABEL_211; | |
s8 = xmlpullparser.getAttributeValue(null, "gid"); | |
if(s8 == null) | |
break MISSING_BLOCK_LABEL_162; | |
int j = Integer.parseInt(s8); | |
mGlobalGids = ArrayUtils.appendInt(mGlobalGids, j); | |
_L5: | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
goto _L3 | |
XmlPullParserException xmlpullparserexception; | |
xmlpullparserexception; | |
Slog.w("PackageManager", "Got execption parsing permissions.", xmlpullparserexception); | |
goto _L4 | |
Slog.w("PackageManager", (new StringBuilder()).append("<group> without gid at ").append(xmlpullparser.getPositionDescription()).toString()); | |
goto _L5 | |
IOException ioexception; | |
ioexception; | |
Slog.w("PackageManager", "Got execption parsing permissions.", ioexception); | |
goto _L4 | |
String s7; | |
if(!"permission".equals(s)) | |
break MISSING_BLOCK_LABEL_294; | |
s7 = xmlpullparser.getAttributeValue(null, "name"); | |
if(s7 != null) | |
break MISSING_BLOCK_LABEL_280; | |
Slog.w("PackageManager", (new StringBuilder()).append("<permission> without name at ").append(xmlpullparser.getPositionDescription()).toString()); | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
goto _L3 | |
readPermission(xmlpullparser, s7.intern()); | |
goto _L3 | |
String s4; | |
if(!"assign-permission".equals(s)) | |
break MISSING_BLOCK_LABEL_546; | |
s4 = xmlpullparser.getAttributeValue(null, "name"); | |
if(s4 != null) | |
break MISSING_BLOCK_LABEL_363; | |
Slog.w("PackageManager", (new StringBuilder()).append("<assign-permission> without name at ").append(xmlpullparser.getPositionDescription()).toString()); | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
goto _L3 | |
String s5 = xmlpullparser.getAttributeValue(null, "uid"); | |
if(s5 != null) | |
break MISSING_BLOCK_LABEL_421; | |
Slog.w("PackageManager", (new StringBuilder()).append("<assign-permission> without uid at ").append(xmlpullparser.getPositionDescription()).toString()); | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
goto _L3 | |
int i = Process.getUidForName(s5); | |
if(i >= 0) | |
break MISSING_BLOCK_LABEL_484; | |
Slog.w("PackageManager", (new StringBuilder()).append("<assign-permission> with unknown uid \"").append(s5).append("\" at ").append(xmlpullparser.getPositionDescription()).toString()); | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
goto _L3 | |
String s6; | |
HashSet hashset; | |
s6 = s4.intern(); | |
hashset = (HashSet)mSystemPermissions.get(i); | |
if(hashset != null) | |
break MISSING_BLOCK_LABEL_530; | |
hashset = new HashSet(); | |
mSystemPermissions.put(i, hashset); | |
hashset.add(s6); | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
goto _L3 | |
String s2; | |
String s3; | |
if(!"library".equals(s)) | |
break MISSING_BLOCK_LABEL_683; | |
s2 = xmlpullparser.getAttributeValue(null, "name"); | |
s3 = xmlpullparser.getAttributeValue(null, "file"); | |
if(s2 != null) goto _L7; else goto _L6 | |
_L6: | |
Slog.w("PackageManager", (new StringBuilder()).append("<library> without name at ").append(xmlpullparser.getPositionDescription()).toString()); | |
_L8: | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
goto _L3 | |
_L7: | |
if(s3 != null) | |
break MISSING_BLOCK_LABEL_668; | |
Slog.w("PackageManager", (new StringBuilder()).append("<library> without file at ").append(xmlpullparser.getPositionDescription()).toString()); | |
goto _L8 | |
mSharedLibraries.put(s2, s3); | |
goto _L8 | |
String s1; | |
if(!"feature".equals(s)) | |
break MISSING_BLOCK_LABEL_783; | |
s1 = xmlpullparser.getAttributeValue(null, "name"); | |
if(s1 != null) | |
break MISSING_BLOCK_LABEL_752; | |
Slog.w("PackageManager", (new StringBuilder()).append("<feature> without name at ").append(xmlpullparser.getPositionDescription()).toString()); | |
_L9: | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
goto _L3 | |
FeatureInfo featureinfo = new FeatureInfo(); | |
featureinfo.name = s1; | |
mAvailableFeatures.put(s1, featureinfo); | |
goto _L9 | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
goto _L3 | |
} | |
private int removeDataDirsLI(String s) | |
{ | |
int ai[] = sUserManager.getUserIds(); | |
int i = 0; | |
int j = ai.length; | |
for(int k = 0; k < j; k++) | |
{ | |
int l = ai[k]; | |
int i1 = mInstaller.remove(s, l); | |
if(i1 < 0) | |
i = i1; | |
} | |
File file = new File(mAppLibInstallDir, s); | |
NativeLibraryHelper.removeNativeBinariesFromDirLI(file); | |
if(!file.delete()) | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't delete native library directory ").append(file.getPath()).toString()); | |
return i; | |
} | |
static int[] removeInts(int ai[], int ai1[]) | |
{ | |
if(ai1 != null && ai != null) | |
{ | |
int i = ai1.length; | |
int j = 0; | |
while(j < i) | |
{ | |
ai = ArrayUtils.removeInt(ai, ai1[j]); | |
j++; | |
} | |
} | |
return ai; | |
} | |
private void removePackageDataLI(PackageSetting packagesetting, PackageRemovedInfo packageremovedinfo, int i, boolean flag) | |
{ | |
String s; | |
s = ((PackageSettingBase) (packagesetting)).name; | |
int j = 0x10000 & i; | |
boolean flag1 = false; | |
if(j != 0) | |
flag1 = true; | |
removePackageLI(packagesetting, flag1); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
PackageSetting packagesetting1 = (PackageSetting)mSettings.mPackages.get(s); | |
if(packageremovedinfo == null) goto _L2; else goto _L1 | |
_L1: | |
packageremovedinfo.removedPackage = s; | |
if(packagesetting1 == null) | |
break MISSING_BLOCK_LABEL_216; | |
int ai[] = packagesetting1.queryInstalledUsers(sUserManager.getUserIds(), true); | |
_L3: | |
packageremovedinfo.removedUsers = ai; | |
_L2: | |
hashmap; | |
JVM INSTR monitorexit ; | |
if((i & 1) == 0) | |
{ | |
removeDataDirsLI(s); | |
schedulePackageCleaning(s, -1, true); | |
} | |
HashMap hashmap1 = mPackages; | |
hashmap1; | |
JVM INSTR monitorenter ; | |
if(packagesetting1 == null || (i & 1) != 0) | |
break MISSING_BLOCK_LABEL_200; | |
if(packageremovedinfo == null) | |
break MISSING_BLOCK_LABEL_152; | |
packageremovedinfo.removedAppId = mSettings.removePackageLPw(s); | |
if(packagesetting1 == null) | |
break MISSING_BLOCK_LABEL_189; | |
updatePermissionsLPw(((PackageSettingBase) (packagesetting1)).name, null, 0); | |
if(packagesetting1.sharedUser != null) | |
mSettings.updateSharedUserPermsLPw(packagesetting1, mGlobalGids); | |
clearPackagePreferredActivitiesLPw(((PackageSettingBase) (packagesetting1)).name, -1); | |
if(!flag) | |
break MISSING_BLOCK_LABEL_212; | |
mSettings.writeLPr(); | |
hashmap1; | |
JVM INSTR monitorexit ; | |
return; | |
ai = null; | |
goto _L3 | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
Exception exception1; | |
exception1; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
} | |
private void replaceNonSystemPackageLI(android.content.pm.PackageParser.Package package1, android.content.pm.PackageParser.Package package2, int i, int j, UserHandle userhandle, String s, PackageInstalledInfo packageinstalledinfo) | |
{ | |
String s1; | |
boolean flag1; | |
s1 = package1.packageName; | |
boolean flag = true; | |
flag1 = false; | |
long l; | |
File file; | |
boolean flag2; | |
int k; | |
int i1; | |
int j1; | |
if(package2.mExtras != null) | |
l = ((PackageSettingBase) ((PackageSetting)package2.mExtras)).lastUpdateTime; | |
else | |
l = 0L; | |
if(deletePackageLI(s1, null, true, 1, packageinstalledinfo.removedInfo, true, true)) goto _L2; else goto _L1 | |
_L1: | |
packageinstalledinfo.returnCode = -10; | |
flag = false; | |
_L4: | |
if(packageinstalledinfo.returnCode != 1) | |
{ | |
if(flag1) | |
deletePackageLI(s1, null, true, 1, packageinstalledinfo.removedInfo, true, true); | |
if(flag) | |
{ | |
file = new File(package1.mPath); | |
flag2 = isExternal(package1); | |
k = 2 | mDefParseFlags; | |
android.content.pm.PackageParser.Package package3; | |
byte byte0; | |
byte byte1; | |
int k1; | |
int l1; | |
if(isForwardLocked(package1)) | |
byte0 = 16; | |
else | |
byte0 = 0; | |
i1 = k | byte0; | |
if(flag2) | |
byte1 = 32; | |
else | |
byte1 = 0; | |
j1 = i1 | byte1; | |
if(flag2) | |
k1 = 0; | |
else | |
k1 = 1; | |
if(scanPackageLI(file, j1, 0x40 | (k1 | 8), l, null) != null) | |
break; /* Loop/switch isn't completed */ | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to restore package : ").append(s1).append(" after failed upgrade").toString()); | |
} | |
} | |
return; | |
_L2: | |
mLastScanError = 1; | |
package3 = scanPackageLI(package2, i, j | 0x40, System.currentTimeMillis(), userhandle); | |
if(package3 == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package couldn't be installed in ").append(package2.mPath).toString()); | |
l1 = mLastScanError; | |
packageinstalledinfo.returnCode = l1; | |
flag1 = false; | |
if(l1 == 1) | |
{ | |
packageinstalledinfo.returnCode = -2; | |
flag1 = false; | |
} | |
} else | |
{ | |
updateSettingsLI(package3, s, packageinstalledinfo); | |
flag1 = true; | |
} | |
if(true) goto _L4; else goto _L3 | |
_L3: | |
synchronized(mPackages) | |
{ | |
updatePermissionsLPw(package1.packageName, package1, 1); | |
mSettings.writeLPr(); | |
} | |
Slog.i("PackageManager", (new StringBuilder()).append("Successfully restored package : ").append(s1).append(" after failed upgrade").toString()); | |
return; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
private void replacePackageLI(android.content.pm.PackageParser.Package package1, int i, int j, UserHandle userhandle, String s, PackageInstalledInfo packageinstalledinfo) | |
{ | |
android.content.pm.PackageParser.Package package2; | |
label0: | |
{ | |
String s1 = package1.packageName; | |
synchronized(mPackages) | |
{ | |
package2 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
if(compareSignatures(package2.mSignatures, package1.mSignatures) == 0) | |
break label0; | |
Slog.w("PackageManager", (new StringBuilder()).append("New package has a different signature: ").append(s1).toString()); | |
packageinstalledinfo.returnCode = -104; | |
} | |
return; | |
} | |
hashmap; | |
JVM INSTR monitorexit ; | |
if(isSystemApp(package2)) | |
{ | |
replaceSystemPackageLI(package2, package1, i, j, userhandle, s, packageinstalledinfo); | |
return; | |
} else | |
{ | |
replaceNonSystemPackageLI(package2, package1, i, j, userhandle, s, packageinstalledinfo); | |
return; | |
} | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
private void replaceSystemPackageLI(android.content.pm.PackageParser.Package package1, android.content.pm.PackageParser.Package package2, int i, int j, UserHandle userhandle, String s, PackageInstalledInfo packageinstalledinfo) | |
{ | |
int k; | |
String s1; | |
k = i | 3; | |
s1 = package1.packageName; | |
packageinstalledinfo.returnCode = -10; | |
if(s1 != null) goto _L2; else goto _L1 | |
_L1: | |
Slog.w("PackageManager", "Attempt to delete null packageName."); | |
_L4: | |
return; | |
_L2: | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package3; | |
PackageSetting packagesetting; | |
package3 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
packagesetting = (PackageSetting)mSettings.mPackages.get(s1); | |
if(package3 == null) | |
break MISSING_BLOCK_LABEL_91; | |
if(package3.applicationInfo != null && packagesetting != null) | |
break MISSING_BLOCK_LABEL_136; | |
Slog.w("PackageManager", (new StringBuilder()).append("Couldn't find package:").append(s1).append(" information").toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
killApplication(s1, package3.applicationInfo.uid); | |
packageinstalledinfo.removedInfo.uid = package3.applicationInfo.uid; | |
packageinstalledinfo.removedInfo.removedPackage = s1; | |
removePackageLI(packagesetting, true); | |
HashMap hashmap1 = mPackages; | |
hashmap1; | |
JVM INSTR monitorenter ; | |
if(mSettings.disableSystemPackageLPw(s1) || package1 == null) | |
break MISSING_BLOCK_LABEL_442; | |
packageinstalledinfo.removedInfo.args = createInstallArgs(0, package1.applicationInfo.sourceDir, package1.applicationInfo.publicSourceDir, package1.applicationInfo.nativeLibraryDir); | |
_L5: | |
hashmap1; | |
JVM INSTR monitorexit ; | |
mLastScanError = 1; | |
ApplicationInfo applicationinfo = package2.applicationInfo; | |
applicationinfo.flags = 0x80 | applicationinfo.flags; | |
android.content.pm.PackageParser.Package package4 = scanPackageLI(package2, k, j, 0L, userhandle); | |
Exception exception1; | |
boolean flag; | |
HashMap hashmap2; | |
Exception exception2; | |
if(package4 == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package couldn't be installed in ").append(package2.mPath).toString()); | |
int l = mLastScanError; | |
packageinstalledinfo.returnCode = l; | |
flag = false; | |
if(l == 1) | |
packageinstalledinfo.returnCode = -2; | |
} else | |
{ | |
if(package4.mExtras != null) | |
{ | |
PackageSetting packagesetting1 = (PackageSetting)package4.mExtras; | |
packagesetting1.firstInstallTime = ((PackageSettingBase) (packagesetting)).firstInstallTime; | |
packagesetting1.lastUpdateTime = System.currentTimeMillis(); | |
} | |
updateSettingsLI(package4, s, packageinstalledinfo); | |
flag = true; | |
} | |
if(packageinstalledinfo.returnCode == 1) goto _L4; else goto _L3 | |
_L3: | |
if(package4 != null) | |
removeInstalledPackageLI(package4, true); | |
scanPackageLI(package3, k, 9, 0L, userhandle); | |
hashmap2 = mPackages; | |
hashmap2; | |
JVM INSTR monitorenter ; | |
if(!flag) | |
break MISSING_BLOCK_LABEL_423; | |
mSettings.enableSystemPackageLPw(s1); | |
mSettings.setInstallerPackageName(s1, ((PackageSettingBase) (packagesetting)).installerPackageName); | |
mSettings.writeLPr(); | |
hashmap2; | |
JVM INSTR monitorexit ; | |
return; | |
exception2; | |
hashmap2; | |
JVM INSTR monitorexit ; | |
throw exception2; | |
packageinstalledinfo.removedInfo.args = null; | |
goto _L5 | |
exception1; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
} | |
static void reportSettingsProblem(int i, String s) | |
{ | |
try | |
{ | |
File file = getSettingsProblemFile(); | |
PrintWriter printwriter = new PrintWriter(new FileOutputStream(file, true)); | |
String s1 = (new SimpleDateFormat()).format(new Date(System.currentTimeMillis())); | |
printwriter.println((new StringBuilder()).append(s1).append(": ").append(s).toString()); | |
printwriter.close(); | |
FileUtils.setPermissions(file.toString(), 508, -1, -1); | |
} | |
catch(IOException ioexception) { } | |
Slog.println(i, "PackageManager", s); | |
} | |
private void scanDirLI(File file, int i, int j, long l) | |
{ | |
String as[] = file.list(); | |
if(as != null) goto _L2; else goto _L1 | |
_L1: | |
Log.d("PackageManager", (new StringBuilder()).append("No files in app dir ").append(file).toString()); | |
_L4: | |
return; | |
_L2: | |
int k; | |
if(ConfigBuildFlags.CAPP_UPLUSAPI && mLguplusPermissions != null) | |
mLguplusPermissions.reorderApkFiles(as); | |
k = 0; | |
_L8: | |
if(k >= as.length) goto _L4; else goto _L3 | |
_L3: | |
File file1; | |
file1 = new File(file, as[k]); | |
if(!ConfigBuildFlags.CAPP_SPR_CHAMELEON) | |
break MISSING_BLOCK_LABEL_505; | |
String s = SystemProperties.get("ro.build.target_operator"); | |
if(!s.equalsIgnoreCase("SPR") && !s.equalsIgnoreCase("BM")) | |
break MISSING_BLOCK_LABEL_505; | |
if(!"SprintID.apk".equals(as[k])) goto _L6; else goto _L5 | |
_L5: | |
if(!"activationOK".equals(SystemProperties.get("ro.sprint.hfa.flag", ""))) | |
Log.d("PackageManager", "NOT YET HFA completed. SprintID is disabled."); | |
if(!"0".equals(SystemProperties.get("ro.chameleon.mobileid", "1"))) goto _L6; else goto _L7 | |
_L7: | |
Log.d("PackageManager", "SprintID is disabled."); | |
_L9: | |
k++; | |
goto _L8 | |
_L6: | |
label0: | |
{ | |
if(!"Zone-Sprint.apk".equals(as[k])) | |
break label0; | |
if(!"activationOK".equals(SystemProperties.get("ro.sprint.hfa.flag", ""))) | |
Log.d("PackageManager", "NOT YET HFA completed. Zone-Sprint is disabled."); | |
if(!"0".equals(SystemProperties.get("ro.chameleon.mobilezone", "1"))) | |
break label0; | |
Log.d("PackageManager", "Zone-Sprint is disabled."); | |
} | |
goto _L9 | |
label1: | |
{ | |
if(!"Vtt-Sprint.apk".equals(as[k])) | |
break label1; | |
if(!"activationOK".equals(SystemProperties.get("ro.sprint.hfa.flag", ""))) | |
Log.d("PackageManager", "NOT YET HFA completed. Vtt-Sprint is disabled."); | |
if(!"0".equals(SystemProperties.get("ro.chameleon.vvm", "1"))) | |
break label1; | |
Log.d("PackageManager", "Vtt-Sprint is disabled."); | |
} | |
goto _L9 | |
if("TraditionalVM.apk".equals(as[k]) && "1".equals(SystemProperties.get("ro.chameleon.vvm", "1"))) | |
Log.d("PackageManager", "TraditionalVM is disabled."); | |
else | |
if(("SPR_Skyfire_Observer.apk".equals(as[k]) || "SPR_Skyfire_Toolbar.apk".equals(as[k])) && "0".equals(SystemProperties.get("ro.chameleon.skyfire", "0"))) | |
{ | |
Log.d("PackageManager", (new StringBuilder()).append(as[k]).append(" is disabled.").toString()); | |
} else | |
{ | |
if(!"SprintTouch.apk".equals(as[k]) || !"0".equals(SystemProperties.get("ro.chameleon.touch", "0"))) | |
break MISSING_BLOCK_LABEL_505; | |
Log.d("PackageManager", "SprintTouch is disabled."); | |
} | |
goto _L9 | |
if(isPackageFilename(as[k]) && !shouldRemoveApk(file1.getAbsolutePath()) && scanPackageLI(file1, i | 4, j, l, null) == null && (i & 1) == 0 && mLastScanError == -2) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Cleaning up failed install of ").append(file1).toString()); | |
file1.delete(); | |
} | |
goto _L9 | |
} | |
private android.content.pm.PackageParser.Package scanPackageLI(android.content.pm.PackageParser.Package package1, int i, int j, long l, UserHandle userhandle) | |
{ | |
File file; | |
file = new File(package1.mScanPath); | |
if(file == null || package1.applicationInfo.sourceDir == null || package1.applicationInfo.publicSourceDir == null) | |
{ | |
Slog.w("PackageManager", " Code and resource paths haven't been set correctly"); | |
mLastScanError = -2; | |
return null; | |
} | |
mScanningPath = file; | |
if((i & 1) != 0) | |
{ | |
ApplicationInfo applicationinfo2 = package1.applicationInfo; | |
applicationinfo2.flags = 1 | applicationinfo2.flags; | |
} | |
if(package1.packageName.equals("android")) | |
{ | |
synchronized(mPackages) | |
{ | |
if(mAndroidApplication == null) | |
break MISSING_BLOCK_LABEL_189; | |
Slog.w("PackageManager", "*************************************************"); | |
Slog.w("PackageManager", "Core android package being redefined. Skipping."); | |
Slog.w("PackageManager", (new StringBuilder()).append(" file=").append(mScanningPath).toString()); | |
Slog.w("PackageManager", "*************************************************"); | |
mLastScanError = -5; | |
} | |
return null; | |
} | |
goto _L1 | |
exception4; | |
hashmap4; | |
JVM INSTR monitorexit ; | |
throw exception4; | |
mPlatformPackage = package1; | |
package1.mVersionCode = mSdkVersion; | |
mAndroidApplication = package1.applicationInfo; | |
mResolveActivity.applicationInfo = mAndroidApplication; | |
mResolveActivity.name = com/android/internal/app/ResolverActivity.getName(); | |
mResolveActivity.packageName = ((PackageItemInfo) (mAndroidApplication)).packageName; | |
mResolveActivity.processName = "system:ui"; | |
mResolveActivity.launchMode = 0; | |
mResolveActivity.flags = 32; | |
mResolveActivity.theme = 0x1030302; | |
if(ConfigBuildFlags.CAPP_RESOURCE) | |
mResolveActivity.theme = 0x20a01cb; | |
mResolveActivity.exported = true; | |
mResolveActivity.enabled = true; | |
mResolveInfo.activityInfo = mResolveActivity; | |
mResolveInfo.priority = 0; | |
mResolveInfo.preferredOrder = 0; | |
mResolveInfo.match = 0; | |
mResolveComponentName = new ComponentName(((PackageItemInfo) (mAndroidApplication)).packageName, ((PackageItemInfo) (mResolveActivity)).name); | |
hashmap4; | |
JVM INSTR monitorexit ; | |
_L1: | |
File file1; | |
File file2; | |
if(mPackages.containsKey(package1.packageName) || mSharedLibraries.containsKey(package1.packageName)) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Application package ").append(package1.packageName).append(" already installed. Skipping duplicate.").toString()); | |
mLastScanError = -5; | |
return null; | |
} | |
file1 = new File(package1.applicationInfo.sourceDir); | |
file2 = new File(package1.applicationInfo.publicSourceDir); | |
if(!isSystemApp(package1)) | |
{ | |
package1.mOriginalPackages = null; | |
package1.mRealPackage = null; | |
package1.mAdoptPermissions = null; | |
} | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
if(package1.usesLibraries == null && package1.usesOptionalLibraries == null) goto _L3; else goto _L2 | |
_L2: | |
if(mTmpSharedLibraries == null || mTmpSharedLibraries.length < mSharedLibraries.size()) | |
mTmpSharedLibraries = new String[mSharedLibraries.size()]; | |
if(package1.usesLibraries == null) goto _L5; else goto _L4 | |
_L4: | |
int k = package1.usesLibraries.size(); | |
goto _L6 | |
_L11: | |
int i1; | |
if(i1 >= k) goto _L8; else goto _L7 | |
_L7: | |
String s = (String)mSharedLibraries.get(package1.usesLibraries.get(i1)); | |
if(s != null) goto _L10; else goto _L9 | |
_L9: | |
Slog.e("PackageManager", (new StringBuilder()).append("Package ").append(package1.packageName).append(" requires unavailable shared library ").append((String)package1.usesLibraries.get(i1)).append("; failing!").toString()); | |
mLastScanError = -9; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L5: | |
k = 0; | |
goto _L6 | |
_L10: | |
int j1; | |
mTmpSharedLibraries[j1] = s; | |
j1++; | |
i1++; | |
goto _L11 | |
_L8: | |
if(package1.usesOptionalLibraries == null) goto _L13; else goto _L12 | |
_L12: | |
int k1 = package1.usesOptionalLibraries.size(); | |
goto _L14 | |
_L137: | |
int l1; | |
if(l1 >= k1) goto _L16; else goto _L15 | |
_L15: | |
String s1 = (String)mSharedLibraries.get(package1.usesOptionalLibraries.get(l1)); | |
if(s1 != null) goto _L18; else goto _L17 | |
_L17: | |
Slog.w("PackageManager", (new StringBuilder()).append("Package ").append(package1.packageName).append(" desires unavailable shared library ").append((String)package1.usesOptionalLibraries.get(l1)).append("; ignoring!").toString()); | |
goto _L19 | |
_L18: | |
mTmpSharedLibraries[j1] = s1; | |
j1++; | |
goto _L19 | |
_L16: | |
if(j1 <= 0) goto _L3; else goto _L20 | |
_L20: | |
package1.usesLibraryFiles = new String[j1]; | |
System.arraycopy(mTmpSharedLibraries, 0, package1.usesLibraryFiles, 0, j1); | |
_L3: | |
String s2; | |
if(ConfigBuildFlags.CAPP_UPLUSAPI && mLguplusPermissions != null && package1.mSignatures != null) | |
mLguplusPermissions.beforeAddPkg(package1); | |
s2 = package1.mSharedUserId; | |
SharedUserSetting sharedusersetting; | |
sharedusersetting = null; | |
if(s2 == null) | |
break MISSING_BLOCK_LABEL_984; | |
sharedusersetting = mSettings.getSharedUserLPw(package1.mSharedUserId, package1.applicationInfo.flags, true); | |
if(sharedusersetting != null) | |
break MISSING_BLOCK_LABEL_984; | |
Slog.w("PackageManager", (new StringBuilder()).append("Creating application package ").append(package1.packageName).append(" for shared user failed").toString()); | |
mLastScanError = -4; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
ArrayList arraylist = package1.mOriginalPackages; | |
PackageSetting packagesetting; | |
String s3; | |
packagesetting = null; | |
s3 = null; | |
if(arraylist == null) goto _L22; else goto _L21 | |
_L21: | |
String s4 = (String)mSettings.mRenamedPackages.get(package1.mRealPackage); | |
if(!package1.mOriginalPackages.contains(s4)) goto _L24; else goto _L23 | |
_L23: | |
boolean flag6; | |
s3 = package1.mRealPackage; | |
flag6 = package1.packageName.equals(s4); | |
packagesetting = null; | |
if(flag6) goto _L22; else goto _L25 | |
_L25: | |
package1.setPackageName(s4); | |
_L22: | |
PackageSetting packagesetting1; | |
if(mTransferedPackages.contains(package1.packageName)) | |
Slog.w("PackageManager", (new StringBuilder()).append("Package ").append(package1.packageName).append(" was transferred to another, but its .apk remains").toString()); | |
packagesetting1 = mSettings.getPackageLPw(package1, packagesetting, s3, sharedusersetting, file1, file2, package1.applicationInfo.nativeLibraryDir, package1.applicationInfo.flags, userhandle, false); | |
if(packagesetting1 != null) goto _L27; else goto _L26 | |
_L26: | |
Slog.w("PackageManager", (new StringBuilder()).append("Creating application package ").append(package1.packageName).append(" failed").toString()); | |
mLastScanError = -4; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
_L24: | |
int i2 = -1 + package1.mOriginalPackages.size(); | |
_L138: | |
s3 = null; | |
if(i2 < 0) goto _L22; else goto _L28 | |
_L28: | |
packagesetting = mSettings.peekPackageLPr((String)package1.mOriginalPackages.get(i2)); | |
if(packagesetting == null) goto _L30; else goto _L29 | |
_L29: | |
if(verifyPackageUpdateLPr(packagesetting, package1)) goto _L32; else goto _L31 | |
_L31: | |
packagesetting = null; | |
goto _L30 | |
_L32: | |
SharedUserSetting sharedusersetting1 = packagesetting.sharedUser; | |
s3 = null; | |
if(sharedusersetting1 == null) goto _L22; else goto _L33 | |
_L33: | |
boolean flag = packagesetting.sharedUser.name.equals(package1.mSharedUserId); | |
s3 = null; | |
if(flag) goto _L22; else goto _L34 | |
_L34: | |
Slog.w("PackageManager", (new StringBuilder()).append("Unable to migrate data from ").append(((PackageSettingBase) (packagesetting)).name).append(" to ").append(package1.packageName).append(": old uid ").append(packagesetting.sharedUser.name).append(" differs from ").append(package1.mSharedUserId).toString()); | |
packagesetting = null; | |
goto _L30 | |
_L27: | |
if(((PackageSettingBase) (packagesetting1)).origPackage != null) | |
{ | |
package1.setPackageName(((PackageSettingBase) (packagesetting)).name); | |
reportSettingsProblem(5, (new StringBuilder()).append("New package ").append(((PackageSettingBase) (packagesetting1)).realName).append(" renamed to replace old package ").append(((PackageSettingBase) (packagesetting1)).name).toString()); | |
mTransferedPackages.add(((PackageSettingBase) (packagesetting)).name); | |
packagesetting1.origPackage = null; | |
} | |
if(s3 == null) | |
break MISSING_BLOCK_LABEL_1475; | |
mTransferedPackages.add(package1.packageName); | |
if(mSettings.isDisabledSystemPackageLPr(package1.packageName)) | |
{ | |
ApplicationInfo applicationinfo1 = package1.applicationInfo; | |
applicationinfo1.flags = 0x80 | applicationinfo1.flags; | |
} | |
package1.applicationInfo.uid = packagesetting1.appId; | |
package1.mExtras = packagesetting1; | |
if(verifySignaturesLP(packagesetting1, package1)) | |
break MISSING_BLOCK_LABEL_1775; | |
if((i & 0x40) != 0) | |
break MISSING_BLOCK_LABEL_1633; | |
if(!ConfigBuildFlags.CAPP_UPLUSAPI || mLguplusPermissions == null) | |
break MISSING_BLOCK_LABEL_1628; | |
if(mLastScanError == -8 && mLguplusPermissions.isSystemUid(package1.packageName)) | |
break MISSING_BLOCK_LABEL_1633; | |
Slog.d("uplus_common_api", (new StringBuilder()).append("pkgName : ").append(package1.packageName).append(", mLastScanError : ").append(mLastScanError).toString()); | |
return null; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
((PackageSettingBase) (packagesetting1)).signatures.mSignatures = package1.mSignatures; | |
if(packagesetting1.sharedUser == null || !ConfigBuildFlags.CAPP_UPLUSAPI || mLguplusPermissions == null || mLguplusPermissions.isSystemUid(package1.packageName) || compareSignatures(packagesetting1.sharedUser.signatures.mSignatures, package1.mSignatures) == 0) | |
break MISSING_BLOCK_LABEL_1742; | |
Log.w("PackageManager", (new StringBuilder()).append("Signature mismatch for shared user : ").append(packagesetting1.sharedUser).toString()); | |
mLastScanError = -104; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
reportSettingsProblem(5, (new StringBuilder()).append("System package ").append(package1.packageName).append(" signature changed; retaining data.").toString()); | |
if((j & 0x10) == 0) goto _L36; else goto _L35 | |
_L35: | |
int j2 = package1.providers.size(); | |
int k2 = 0; | |
_L141: | |
if(k2 >= j2) goto _L36; else goto _L37 | |
_L37: | |
android.content.pm.PackageParser.Provider provider = (android.content.pm.PackageParser.Provider)package1.providers.get(k2); | |
if(provider.info.authority == null) goto _L39; else goto _L38 | |
_L38: | |
String as[] = provider.info.authority.split(";"); | |
int l2 = 0; | |
_L140: | |
int i3 = as.length; | |
if(l2 >= i3) goto _L39; else goto _L40 | |
_L40: | |
if(!mProviders.containsKey(as[l2])) goto _L42; else goto _L41 | |
_L41: | |
android.content.pm.PackageParser.Provider provider1; | |
StringBuilder stringbuilder; | |
provider1 = (android.content.pm.PackageParser.Provider)mProviders.get(as[l2]); | |
stringbuilder = (new StringBuilder()).append("Can't install because provider name ").append(as[l2]).append(" (in package ").append(((PackageItemInfo) (package1.applicationInfo)).packageName).append(") is already used by "); | |
if(provider1 == null) goto _L44; else goto _L43 | |
_L43: | |
if(provider1.getComponentName() == null) goto _L44; else goto _L45 | |
_L45: | |
String s5 = provider1.getComponentName().getPackageName(); | |
_L139: | |
Slog.w("PackageManager", stringbuilder.append(s5).toString()); | |
mLastScanError = -13; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
_L36: | |
if(package1.mAdoptPermissions == null) goto _L47; else goto _L46 | |
_L46: | |
int j10 = -1 + package1.mAdoptPermissions.size(); | |
_L142: | |
if(j10 < 0) goto _L47; else goto _L48 | |
_L48: | |
String s27; | |
PackageSetting packagesetting2; | |
s27 = (String)package1.mAdoptPermissions.get(j10); | |
packagesetting2 = mSettings.peekPackageLPr(s27); | |
if(packagesetting2 == null) goto _L50; else goto _L49 | |
_L49: | |
if(verifyPackageUpdateLPr(packagesetting2, package1)) | |
{ | |
Slog.i("PackageManager", (new StringBuilder()).append("Adopting permissions from ").append(s27).append(" to ").append(package1.packageName).toString()); | |
mSettings.transferPermissionsLPw(s27, package1.packageName); | |
} | |
goto _L50 | |
_L47: | |
hashmap; | |
JVM INSTR monitorexit ; | |
String s6; | |
long l3; | |
File file3; | |
File file4; | |
String s23; | |
s6 = package1.packageName; | |
l3 = file.lastModified(); | |
boolean flag1; | |
String s7; | |
String s22; | |
File file5; | |
if((j & 4) != 0) | |
flag1 = true; | |
else | |
flag1 = false; | |
package1.applicationInfo.processName = fixProcessName(((PackageItemInfo) (package1.applicationInfo)).packageName, package1.applicationInfo.processName, package1.applicationInfo.uid); | |
if(mPlatformPackage != package1) goto _L52; else goto _L51 | |
_L51: | |
file5 = Environment.getDataDirectory(); | |
file3 = new File(file5, "system"); | |
package1.applicationInfo.dataDir = file3.getPath(); | |
_L62: | |
s7 = file.getPath(); | |
if(package1.applicationInfo.nativeLibraryDir == null) goto _L54; else goto _L53 | |
_L53: | |
s22 = package1.applicationInfo.nativeLibraryDir; | |
file4 = new File(s22); | |
s23 = file3.getCanonicalPath(); | |
if(!isSystemApp(package1) || isUpdatedSystemApp(package1) || (0x8000 & j) != 0) goto _L56; else goto _L55 | |
_L55: | |
int l8; | |
try | |
{ | |
if(NativeLibraryHelper.removeNativeBinariesFromDirLI(file4)) | |
Log.i("PackageManager", (new StringBuilder()).append("removed obsolete native libraries for system package ").append(s7).toString()); | |
} | |
catch(IOException ioexception) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Unable to get canonical file ").append(ioexception.toString()).toString()); | |
} | |
goto _L54 | |
_L52: | |
file3 = getDataPathForPackage(package1.packageName, 0); | |
if(!file3.exists()) | |
break MISSING_BLOCK_LABEL_2969; | |
try | |
{ | |
j9 = Libcore.os.stat(file3.getPath()).st_uid; | |
} | |
catch(ErrnoException errnoexception) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Couldn't stat path ").append(file3.getPath()).toString(), errnoexception); | |
j9 = 0; | |
} | |
k9 = package1.applicationInfo.uid; | |
l9 = j9; | |
flag2 = false; | |
if(l9 == k9) goto _L58; else goto _L57 | |
_L57: | |
flag5 = false; | |
if(j9 == 0) | |
{ | |
int i10 = mInstaller.fixUid(s6, package1.applicationInfo.uid, package1.applicationInfo.uid); | |
flag5 = false; | |
if(i10 >= 0) | |
{ | |
flag5 = true; | |
reportSettingsProblem(5, (new StringBuilder()).append("Package ").append(package1.packageName).append(" unexpectedly changed to uid 0; recovered to ").append(package1.applicationInfo.uid).toString()); | |
} | |
} | |
if(flag5 || (i & 1) == 0 && (j & 0x100) == 0) goto _L60; else goto _L59 | |
_L59: | |
if(removeDataDirsLI(s6) >= 0) | |
{ | |
String s26; | |
if((i & 1) != 0) | |
s26 = "System package "; | |
else | |
s26 = "Third party package "; | |
reportSettingsProblem(5, (new StringBuilder()).append(s26).append(package1.packageName).append(" has changed from uid: ").append(j9).append(" to ").append(package1.applicationInfo.uid).append("; old data erased").toString()); | |
flag5 = true; | |
if(createDataDirsLI(s6, package1.applicationInfo.uid) == -1) | |
{ | |
reportSettingsProblem(5, (new StringBuilder()).append(s26).append(package1.packageName).append(" could not have data directory re-created after delete.").toString()); | |
mLastScanError = -4; | |
return null; | |
} | |
} | |
if(!flag5) | |
mHasSystemUidErrors = true; | |
_L64: | |
flag2 = false; | |
if(flag5) goto _L58; else goto _L61 | |
_L61: | |
package1.applicationInfo.dataDir = (new StringBuilder()).append("/mismatched_uid/settings_").append(package1.applicationInfo.uid).append("/fs_").append(j9).toString(); | |
package1.applicationInfo.nativeLibraryDir = package1.applicationInfo.dataDir; | |
s25 = (new StringBuilder()).append("Package ").append(package1.packageName).append(" has mismatched uid: ").append(j9).append(" on disk, ").append(package1.applicationInfo.uid).append(" in settings").toString(); | |
hashmap3 = mPackages; | |
hashmap3; | |
JVM INSTR monitorenter ; | |
mSettings.mReadMessages.append(s25); | |
mSettings.mReadMessages.append('\n'); | |
flag2 = true; | |
if(!((PackageSettingBase) (packagesetting1)).uidError) | |
reportSettingsProblem(6, s25); | |
hashmap3; | |
JVM INSTR monitorexit ; | |
_L58: | |
package1.applicationInfo.dataDir = file3.getPath(); | |
_L65: | |
Exception exception3; | |
if(package1.applicationInfo.nativeLibraryDir == null && package1.applicationInfo.dataDir != null) | |
if(((PackageSettingBase) (packagesetting1)).nativeLibraryPathString == null) | |
setInternalAppNativeLibraryPath(package1, packagesetting1); | |
else | |
package1.applicationInfo.nativeLibraryDir = ((PackageSettingBase) (packagesetting1)).nativeLibraryPathString; | |
packagesetting1.uidError = flag2; | |
goto _L62 | |
_L60: | |
if(flag5) goto _L64; else goto _L63 | |
_L63: | |
mLastScanError = -24; | |
return null; | |
exception3; | |
hashmap3; | |
JVM INSTR monitorexit ; | |
throw exception3; | |
if(createDataDirsLI(s6, package1.applicationInfo.uid) < 0) | |
{ | |
mLastScanError = -4; | |
return null; | |
} | |
if(file3.exists()) | |
{ | |
package1.applicationInfo.dataDir = file3.getPath(); | |
flag2 = false; | |
} else | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Unable to create data directory: ").append(file3).toString()); | |
package1.applicationInfo.dataDir = null; | |
flag2 = false; | |
} | |
goto _L65 | |
_L56: | |
if(isForwardLocked(package1) || isExternal(package1)) | |
break MISSING_BLOCK_LABEL_3178; | |
if(file4.getPath().startsWith(s23)) | |
{ | |
setInternalAppNativeLibraryPath(package1, packagesetting1); | |
String s24 = package1.applicationInfo.nativeLibraryDir; | |
file4 = new File(s24); | |
} | |
if(copyNativeLibrariesForInternalApp(file, file4) == 1) | |
break MISSING_BLOCK_LABEL_3178; | |
Slog.e("PackageManager", "Unable to copy native libraries"); | |
mLastScanError = -110; | |
return null; | |
ioexception1; | |
Slog.e("PackageManager", "Unable to copy native libraries", ioexception1); | |
mLastScanError = -110; | |
return null; | |
ai = sUserManager.getUserIds(); | |
obj = mInstallLock; | |
obj; | |
JVM INSTR monitorenter ; | |
k8 = ai.length; | |
l8 = 0; | |
_L143: | |
if(l8 >= k8) goto _L67; else goto _L66 | |
_L66: | |
i9 = ai[l8]; | |
if(mInstaller.linkNativeLibraryDirectory(package1.packageName, package1.applicationInfo.nativeLibraryDir, i9) >= 0) goto _L69; else goto _L68 | |
_L68: | |
Slog.w("PackageManager", (new StringBuilder()).append("Failed linking native library dir (user=").append(i9).append(")").toString()); | |
mLastScanError = -110; | |
obj; | |
JVM INSTR monitorexit ; | |
return null; | |
_L67: | |
obj; | |
JVM INSTR monitorexit ; | |
goto _L54 | |
exception2; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception2; | |
_L54: | |
package1.mScanPath = s7; | |
if((j & 2) == 0) | |
{ | |
boolean flag2; | |
boolean flag4; | |
int ai[]; | |
Object obj; | |
Exception exception2; | |
int k8; | |
int i9; | |
IOException ioexception1; | |
int j9; | |
int k9; | |
int l9; | |
boolean flag5; | |
String s25; | |
HashMap hashmap3; | |
if((j & 0x80) != 0) | |
flag4 = true; | |
else | |
flag4 = false; | |
if(performDexOptLI(package1, flag1, flag4) == -1) | |
{ | |
mLastScanError = -11; | |
return null; | |
} | |
} | |
if(mFactoryTest && package1.requestedPermissions.contains("android.permission.FACTORY_TEST")) | |
{ | |
ApplicationInfo applicationinfo = package1.applicationInfo; | |
applicationinfo.flags = 0x10 | applicationinfo.flags; | |
} | |
if((i & 2) != 0) | |
killApplication(((PackageItemInfo) (package1.applicationInfo)).packageName, package1.applicationInfo.uid); | |
HashMap hashmap1 = mPackages; | |
hashmap1; | |
JVM INSTR monitorenter ; | |
if((j & 1) == 0) | |
break MISSING_BLOCK_LABEL_3430; | |
mAppDirs.put(package1.mPath, package1); | |
mSettings.insertPackageSettingLPw(packagesetting1, package1); | |
mPackages.put(((PackageItemInfo) (package1.applicationInfo)).packageName, package1); | |
Iterator iterator = mSettings.mPackagesToBeCleaned.iterator(); | |
do | |
{ | |
if(!iterator.hasNext()) | |
break; | |
if(s6.equals(((PackageCleanItem)iterator.next()).packageName)) | |
iterator.remove(); | |
} while(true); | |
break MISSING_BLOCK_LABEL_3517; | |
Exception exception1; | |
exception1; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
if(l == 0L) goto _L71; else goto _L70 | |
_L70: | |
if(((PackageSettingBase) (packagesetting1)).firstInstallTime != 0L) goto _L73; else goto _L72 | |
_L72: | |
packagesetting1.lastUpdateTime = l; | |
packagesetting1.firstInstallTime = l; | |
_L89: | |
int j3 = package1.providers.size(); | |
StringBuilder stringbuilder1; | |
int k3; | |
stringbuilder1 = null; | |
k3 = 0; | |
_L147: | |
if(k3 >= j3) goto _L75; else goto _L74 | |
_L74: | |
android.content.pm.PackageParser.Provider provider2; | |
provider2 = (android.content.pm.PackageParser.Provider)package1.providers.get(k3); | |
provider2.info.processName = fixProcessName(package1.applicationInfo.processName, ((ComponentInfo) (provider2.info)).processName, package1.applicationInfo.uid); | |
mProvidersByComponent.put(new ComponentName(((PackageItemInfo) (provider2.info)).packageName, ((PackageItemInfo) (provider2.info)).name), provider2); | |
boolean flag3 = provider2.info.isSyncable; | |
provider2.syncable = flag3; | |
if(provider2.info.authority == null) goto _L77; else goto _L76 | |
_L76: | |
String as1[]; | |
as1 = provider2.info.authority.split(";"); | |
provider2.info.authority = null; | |
int i4; | |
android.content.pm.PackageParser.Provider provider3; | |
i4 = 0; | |
provider3 = provider2; | |
_L144: | |
int j4 = as1.length; | |
if(i4 >= j4) goto _L79; else goto _L78 | |
_L78: | |
if(i4 != 1) goto _L81; else goto _L80 | |
_L80: | |
if(!provider3.syncable) goto _L81; else goto _L82 | |
_L82: | |
android.content.pm.PackageParser.Provider provider4; | |
provider4 = new android.content.pm.PackageParser.Provider(provider3); | |
provider4.syncable = false; | |
_L136: | |
if(mProviders.containsKey(as1[i4])) goto _L84; else goto _L83 | |
_L83: | |
mProviders.put(as1[i4], provider4); | |
if(provider4.info.authority != null) goto _L86; else goto _L85 | |
_L85: | |
provider4.info.authority = as1[i4]; | |
goto _L87 | |
_L73: | |
if((j & 0x40) == 0) goto _L89; else goto _L88 | |
_L88: | |
packagesetting1.lastUpdateTime = l; | |
goto _L89 | |
_L71: | |
if(((PackageSettingBase) (packagesetting1)).firstInstallTime != 0L) goto _L91; else goto _L90 | |
_L90: | |
packagesetting1.lastUpdateTime = l3; | |
packagesetting1.firstInstallTime = l3; | |
goto _L89 | |
_L91: | |
if((i & 0x40) == 0) goto _L89; else goto _L92 | |
_L92: | |
if(l3 == ((PackageSettingBase) (packagesetting1)).timeStamp) goto _L89; else goto _L93 | |
_L93: | |
packagesetting1.lastUpdateTime = l3; | |
goto _L89 | |
_L86: | |
provider4.info.authority = (new StringBuilder()).append(provider4.info.authority).append(";").append(as1[i4]).toString(); | |
goto _L87 | |
_L84: | |
android.content.pm.PackageParser.Provider provider5; | |
StringBuilder stringbuilder2; | |
provider5 = (android.content.pm.PackageParser.Provider)mProviders.get(as1[i4]); | |
stringbuilder2 = (new StringBuilder()).append("Skipping provider name ").append(as1[i4]).append(" (in package ").append(((PackageItemInfo) (package1.applicationInfo)).packageName).append("): name already used by "); | |
if(provider5 == null) goto _L95; else goto _L94 | |
_L94: | |
if(provider5.getComponentName() == null) goto _L95; else goto _L96 | |
_L96: | |
String s9 = provider5.getComponentName().getPackageName(); | |
_L145: | |
Slog.w("PackageManager", stringbuilder2.append(s9).toString()); | |
goto _L87 | |
_L77: | |
if((i & 2) == 0) | |
continue; /* Loop/switch isn't completed */ | |
if(stringbuilder1 != null) | |
break MISSING_BLOCK_LABEL_4076; | |
stringbuilder1 = new StringBuilder(256); | |
_L97: | |
String s8 = ((PackageItemInfo) (provider2.info)).name; | |
stringbuilder1.append(s8); | |
continue; /* Loop/switch isn't completed */ | |
stringbuilder1.append(' '); | |
goto _L97 | |
_L149: | |
int k4 = package1.services.size(); | |
StringBuilder stringbuilder3; | |
int l4; | |
stringbuilder3 = null; | |
l4 = 0; | |
_L150: | |
if(l4 >= k4) goto _L99; else goto _L98 | |
_L98: | |
android.content.pm.PackageParser.Service service; | |
service = (android.content.pm.PackageParser.Service)package1.services.get(l4); | |
service.info.processName = fixProcessName(package1.applicationInfo.processName, ((ComponentInfo) (service.info)).processName, package1.applicationInfo.uid); | |
mServices.addService(service); | |
if((i & 2) == 0) | |
continue; /* Loop/switch isn't completed */ | |
if(stringbuilder3 != null) | |
break MISSING_BLOCK_LABEL_4209; | |
stringbuilder3 = new StringBuilder(256); | |
_L100: | |
String s10 = ((PackageItemInfo) (service.info)).name; | |
stringbuilder3.append(s10); | |
continue; /* Loop/switch isn't completed */ | |
stringbuilder3.append(' '); | |
goto _L100 | |
_L152: | |
int i5 = package1.receivers.size(); | |
StringBuilder stringbuilder4; | |
int j5; | |
stringbuilder4 = null; | |
j5 = 0; | |
_L153: | |
if(j5 >= i5) goto _L102; else goto _L101 | |
_L101: | |
android.content.pm.PackageParser.Activity activity; | |
activity = (android.content.pm.PackageParser.Activity)package1.receivers.get(j5); | |
activity.info.processName = fixProcessName(package1.applicationInfo.processName, ((ComponentInfo) (activity.info)).processName, package1.applicationInfo.uid); | |
mReceivers.addActivity(activity, "receiver"); | |
if((i & 2) == 0) | |
continue; /* Loop/switch isn't completed */ | |
if(stringbuilder4 != null) | |
break MISSING_BLOCK_LABEL_4345; | |
stringbuilder4 = new StringBuilder(256); | |
_L103: | |
String s11 = ((PackageItemInfo) (activity.info)).name; | |
stringbuilder4.append(s11); | |
continue; /* Loop/switch isn't completed */ | |
stringbuilder4.append(' '); | |
goto _L103 | |
_L155: | |
int k5 = package1.activities.size(); | |
StringBuilder stringbuilder5; | |
int l5; | |
stringbuilder5 = null; | |
l5 = 0; | |
_L156: | |
if(l5 >= k5) goto _L105; else goto _L104 | |
_L104: | |
android.content.pm.PackageParser.Activity activity1; | |
activity1 = (android.content.pm.PackageParser.Activity)package1.activities.get(l5); | |
activity1.info.processName = fixProcessName(package1.applicationInfo.processName, ((ComponentInfo) (activity1.info)).processName, package1.applicationInfo.uid); | |
mActivities.addActivity(activity1, "activity"); | |
if((i & 2) == 0) | |
continue; /* Loop/switch isn't completed */ | |
if(stringbuilder5 != null) | |
break MISSING_BLOCK_LABEL_4481; | |
stringbuilder5 = new StringBuilder(256); | |
_L106: | |
String s12 = ((PackageItemInfo) (activity1.info)).name; | |
stringbuilder5.append(s12); | |
continue; /* Loop/switch isn't completed */ | |
stringbuilder5.append(' '); | |
goto _L106 | |
_L158: | |
int i6 = package1.permissionGroups.size(); | |
StringBuilder stringbuilder6; | |
int j6; | |
stringbuilder6 = null; | |
j6 = 0; | |
_L159: | |
if(j6 >= i6) goto _L108; else goto _L107 | |
_L107: | |
android.content.pm.PackageParser.PermissionGroup permissiongroup; | |
android.content.pm.PackageParser.PermissionGroup permissiongroup1; | |
permissiongroup = (android.content.pm.PackageParser.PermissionGroup)package1.permissionGroups.get(j6); | |
permissiongroup1 = (android.content.pm.PackageParser.PermissionGroup)mPermissionGroups.get(((PackageItemInfo) (permissiongroup.info)).name); | |
if(permissiongroup1 != null) | |
break MISSING_BLOCK_LABEL_4626; | |
mPermissionGroups.put(((PackageItemInfo) (permissiongroup.info)).name, permissiongroup); | |
if((i & 2) == 0) | |
continue; /* Loop/switch isn't completed */ | |
if(stringbuilder6 != null) | |
break MISSING_BLOCK_LABEL_4615; | |
stringbuilder6 = new StringBuilder(256); | |
_L109: | |
String s13 = ((PackageItemInfo) (permissiongroup.info)).name; | |
stringbuilder6.append(s13); | |
continue; /* Loop/switch isn't completed */ | |
stringbuilder6.append(' '); | |
goto _L109 | |
Slog.w("PackageManager", (new StringBuilder()).append("Permission group ").append(((PackageItemInfo) (permissiongroup.info)).name).append(" from package ").append(((PackageItemInfo) (permissiongroup.info)).packageName).append(" ignored: original from ").append(((PackageItemInfo) (permissiongroup1.info)).packageName).toString()); | |
if((i & 2) == 0) | |
continue; /* Loop/switch isn't completed */ | |
if(stringbuilder6 != null) | |
break MISSING_BLOCK_LABEL_4746; | |
stringbuilder6 = new StringBuilder(256); | |
_L110: | |
stringbuilder6.append("DUP:"); | |
String s14 = ((PackageItemInfo) (permissiongroup.info)).name; | |
stringbuilder6.append(s14); | |
continue; /* Loop/switch isn't completed */ | |
stringbuilder6.append(' '); | |
goto _L110 | |
_L161: | |
int k6 = package1.permissions.size(); | |
StringBuilder stringbuilder7; | |
int l6; | |
stringbuilder7 = null; | |
l6 = 0; | |
_L162: | |
if(l6 >= k6) goto _L112; else goto _L111 | |
_L111: | |
android.content.pm.PackageParser.Permission permission = (android.content.pm.PackageParser.Permission)package1.permissions.get(l6); | |
if(!permission.tree) goto _L114; else goto _L113 | |
_L113: | |
HashMap hashmap2 = mSettings.mPermissionTrees; | |
_L126: | |
BasePermission basepermission; | |
permission.group = (android.content.pm.PackageParser.PermissionGroup)mPermissionGroups.get(permission.info.group); | |
if(permission.info.group != null && permission.group == null) | |
break MISSING_BLOCK_LABEL_5342; | |
String s15 = ((PackageItemInfo) (permission.info)).name; | |
basepermission = (BasePermission)hashmap2.get(s15); | |
if(basepermission != null) | |
break MISSING_BLOCK_LABEL_4933; | |
String s16 = ((PackageItemInfo) (permission.info)).name; | |
String s17 = ((PackageItemInfo) (permission.info)).packageName; | |
basepermission = new BasePermission(s16, s17, 0); | |
String s18 = ((PackageItemInfo) (permission.info)).name; | |
hashmap2.put(s18, basepermission); | |
if(basepermission.perm != null) goto _L116; else goto _L115 | |
_L115: | |
if(basepermission.sourcePackage != null && !basepermission.sourcePackage.equals(((PackageItemInfo) (permission.info)).packageName)) goto _L118; else goto _L117 | |
_L117: | |
BasePermission basepermission1 = findPermissionTreeLP(((PackageItemInfo) (permission.info)).name); | |
if(basepermission1 == null) goto _L120; else goto _L119 | |
_L119: | |
if(!basepermission1.sourcePackage.equals(((PackageItemInfo) (permission.info)).packageName)) goto _L121; else goto _L120 | |
_L120: | |
basepermission.packageSetting = packagesetting1; | |
basepermission.perm = permission; | |
int j7 = package1.applicationInfo.uid; | |
basepermission.uid = j7; | |
if((i & 2) == 0) goto _L123; else goto _L122 | |
_L122: | |
if(stringbuilder7 != null) goto _L125; else goto _L124 | |
_L124: | |
stringbuilder7 = new StringBuilder(256); | |
_L127: | |
String s20 = ((PackageItemInfo) (permission.info)).name; | |
stringbuilder7.append(s20); | |
_L123: | |
if(basepermission.perm == permission) | |
{ | |
int i7 = permission.info.protectionLevel; | |
basepermission.protectionLevel = i7; | |
} | |
continue; /* Loop/switch isn't completed */ | |
_L114: | |
hashmap2 = mSettings.mPermissions; | |
goto _L126 | |
_L125: | |
stringbuilder7.append(' '); | |
goto _L127 | |
_L121: | |
Slog.w("PackageManager", (new StringBuilder()).append("Permission ").append(((PackageItemInfo) (permission.info)).name).append(" from package ").append(((PackageItemInfo) (permission.info)).packageName).append(" ignored: base tree ").append(basepermission1.name).append(" is from package ").append(basepermission1.sourcePackage).toString()); | |
goto _L123 | |
_L118: | |
Slog.w("PackageManager", (new StringBuilder()).append("Permission ").append(((PackageItemInfo) (permission.info)).name).append(" from package ").append(((PackageItemInfo) (permission.info)).packageName).append(" ignored: original from ").append(basepermission.sourcePackage).toString()); | |
goto _L123 | |
_L116: | |
if((i & 2) == 0) goto _L123; else goto _L128 | |
_L128: | |
if(stringbuilder7 != null) | |
break MISSING_BLOCK_LABEL_5331; | |
stringbuilder7 = new StringBuilder(256); | |
_L129: | |
stringbuilder7.append("DUP:"); | |
String s19 = ((PackageItemInfo) (permission.info)).name; | |
stringbuilder7.append(s19); | |
goto _L123 | |
stringbuilder7.append(' '); | |
goto _L129 | |
Slog.w("PackageManager", (new StringBuilder()).append("Permission ").append(((PackageItemInfo) (permission.info)).name).append(" from package ").append(((PackageItemInfo) (permission.info)).packageName).append(" ignored: no group ").append(permission.group).toString()); | |
continue; /* Loop/switch isn't completed */ | |
goto _L123 | |
_L164: | |
int k7 = package1.instrumentation.size(); | |
StringBuilder stringbuilder8; | |
int l7; | |
stringbuilder8 = null; | |
l7 = 0; | |
_L165: | |
if(l7 >= k7) goto _L131; else goto _L130 | |
_L130: | |
android.content.pm.PackageParser.Instrumentation instrumentation; | |
instrumentation = (android.content.pm.PackageParser.Instrumentation)package1.instrumentation.get(l7); | |
instrumentation.info.packageName = ((PackageItemInfo) (package1.applicationInfo)).packageName; | |
instrumentation.info.sourceDir = package1.applicationInfo.sourceDir; | |
instrumentation.info.publicSourceDir = package1.applicationInfo.publicSourceDir; | |
instrumentation.info.dataDir = package1.applicationInfo.dataDir; | |
instrumentation.info.nativeLibraryDir = package1.applicationInfo.nativeLibraryDir; | |
mInstrumentation.put(instrumentation.getComponentName(), instrumentation); | |
if((i & 2) == 0) | |
continue; /* Loop/switch isn't completed */ | |
if(stringbuilder8 != null) | |
break MISSING_BLOCK_LABEL_5579; | |
stringbuilder8 = new StringBuilder(256); | |
_L132: | |
String s21 = ((PackageItemInfo) (instrumentation.info)).name; | |
stringbuilder8.append(s21); | |
continue; /* Loop/switch isn't completed */ | |
stringbuilder8.append(' '); | |
goto _L132 | |
_L166: | |
if(package1.protectedBroadcasts == null) goto _L134; else goto _L133 | |
_L133: | |
int i8 = package1.protectedBroadcasts.size(); | |
int j8 = 0; | |
_L135: | |
if(j8 >= i8) | |
break; /* Loop/switch isn't completed */ | |
mProtectedBroadcasts.add(package1.protectedBroadcasts.get(j8)); | |
j8++; | |
if(true) goto _L135; else goto _L134 | |
_L134: | |
packagesetting1.setTimeStamp(l3); | |
if(ConfigBuildFlags.CAPP_UPLUSAPI && mLguplusPermissions != null) | |
mLguplusPermissions.afterAddPkg(package1); | |
hashmap1; | |
JVM INSTR monitorexit ; | |
return package1; | |
_L81: | |
provider4 = provider3; | |
goto _L136 | |
_L6: | |
i1 = 0; | |
j1 = 0; | |
goto _L11 | |
_L14: | |
l1 = 0; | |
goto _L137 | |
_L19: | |
l1++; | |
goto _L137 | |
_L13: | |
k1 = 0; | |
goto _L14 | |
_L30: | |
i2--; | |
goto _L138 | |
_L44: | |
s5 = "?"; | |
goto _L139 | |
_L42: | |
l2++; | |
goto _L140 | |
_L39: | |
k2++; | |
goto _L141 | |
_L50: | |
j10--; | |
goto _L142 | |
_L69: | |
l8++; | |
goto _L143 | |
_L87: | |
i4++; | |
provider3 = provider4; | |
goto _L144 | |
_L95: | |
s9 = "?"; | |
goto _L145 | |
_L79: | |
provider2 = provider3; | |
if(true) goto _L77; else goto _L146 | |
_L146: | |
k3++; | |
goto _L147 | |
_L75: | |
if(stringbuilder1 == null); | |
if(true) goto _L149; else goto _L148 | |
_L148: | |
l4++; | |
goto _L150 | |
_L99: | |
if(stringbuilder3 == null); | |
if(true) goto _L152; else goto _L151 | |
_L151: | |
j5++; | |
goto _L153 | |
_L102: | |
if(stringbuilder4 == null); | |
if(true) goto _L155; else goto _L154 | |
_L154: | |
l5++; | |
goto _L156 | |
_L105: | |
if(stringbuilder5 == null); | |
if(true) goto _L158; else goto _L157 | |
_L157: | |
j6++; | |
goto _L159 | |
_L108: | |
if(stringbuilder6 == null); | |
if(true) goto _L161; else goto _L160 | |
_L160: | |
l6++; | |
goto _L162 | |
_L112: | |
if(stringbuilder7 == null); | |
if(true) goto _L164; else goto _L163 | |
_L163: | |
l7++; | |
goto _L165 | |
_L131: | |
if(stringbuilder8 == null); | |
goto _L166 | |
} | |
private android.content.pm.PackageParser.Package scanPackageLI(File file, int i, int j, long l, UserHandle userhandle) | |
{ | |
int k; | |
PackageParser packageparser; | |
android.content.pm.PackageParser.Package package1; | |
mLastScanError = 1; | |
String s = file.getPath(); | |
k = i | mDefParseFlags; | |
packageparser = new PackageParser(s); | |
packageparser.setSeparateProcesses(mSeparateProcesses); | |
packageparser.setOnlyCoreApps(mOnlyCore); | |
package1 = packageparser.parsePackage(file, s, mMetrics, k); | |
if(package1 != null) goto _L2; else goto _L1 | |
_L1: | |
android.content.pm.PackageParser.Package package2; | |
mLastScanError = packageparser.getParseError(); | |
package2 = null; | |
_L5: | |
return package2; | |
_L2: | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
String s1; | |
ArrayList arraylist; | |
s1 = (String)mSettings.mRenamedPackages.get(package1.packageName); | |
arraylist = package1.mOriginalPackages; | |
PackageSetting packagesetting; | |
packagesetting = null; | |
if(arraylist == null) | |
break MISSING_BLOCK_LABEL_159; | |
boolean flag = package1.mOriginalPackages.contains(s1); | |
packagesetting = null; | |
if(!flag) | |
break MISSING_BLOCK_LABEL_159; | |
packagesetting = mSettings.peekPackageLPr(s1); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_178; | |
packagesetting = mSettings.peekPackageLPr(package1.packageName); | |
Settings settings = mSettings; | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_361; | |
String s2 = ((PackageSettingBase) (packagesetting)).name; | |
_L3: | |
PackageSetting packagesetting1 = settings.getDisabledSystemPkgLPr(s2); | |
hashmap; | |
JVM INSTR monitorexit ; | |
if(packagesetting1 == null || (k & 1) == 0 || packagesetting == null || ((PackageSettingBase) (packagesetting)).codePath.equals(file)) | |
break MISSING_BLOCK_LABEL_555; | |
if(package1.mVersionCode < ((PackageSettingBase) (packagesetting)).versionCode) | |
{ | |
if(ConfigBuildFlags.CAPP_UPLUSAPI && ((PackageSettingBase) (packagesetting)).name.equals("com.lguplus.common_api_impl")) | |
scanPackageLI(((PackageSettingBase) (packagesetting)).codePath, 4, j, l, null); | |
Log.i("PackageManager", (new StringBuilder()).append("Package ").append(((PackageSettingBase) (packagesetting)).name).append(" at ").append(file).append(" ignored: updated version ").append(((PackageSettingBase) (packagesetting)).versionCode).append(" better than this ").append(package1.mVersionCode).toString()); | |
mLastScanError = -5; | |
return null; | |
} | |
break MISSING_BLOCK_LABEL_379; | |
s2 = package1.packageName; | |
goto _L3 | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
synchronized(mPackages) | |
{ | |
mPackages.remove(((PackageSettingBase) (packagesetting)).name); | |
} | |
Slog.w("PackageManager", (new StringBuilder()).append("Package ").append(((PackageSettingBase) (packagesetting)).name).append(" at ").append(file).append("reverting from ").append(((PackageSettingBase) (packagesetting)).codePathString).append(": new version ").append(package1.mVersionCode).append(" better than installed ").append(((PackageSettingBase) (packagesetting)).versionCode).toString()); | |
InstallArgs installargs1 = createInstallArgs(packageFlagsToInstallFlags(packagesetting), ((PackageSettingBase) (packagesetting)).codePathString, ((PackageSettingBase) (packagesetting)).resourcePathString, ((PackageSettingBase) (packagesetting)).nativeLibraryPathString); | |
synchronized(mInstallLock) | |
{ | |
installargs1.cleanUpResourcesLI(); | |
} | |
synchronized(mPackages) | |
{ | |
mSettings.enableSystemPackageLPw(((PackageSettingBase) (packagesetting)).name); | |
} | |
if(packagesetting1 != null) | |
k |= 1; | |
if(!collectCertificatesLI(packageparser, packagesetting, package1, file, k)) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Failed verifying certificates for package:").append(package1.packageName).toString()); | |
return null; | |
} | |
break MISSING_BLOCK_LABEL_638; | |
exception3; | |
hashmap2; | |
JVM INSTR monitorexit ; | |
throw exception3; | |
exception4; | |
obj1; | |
JVM INSTR monitorexit ; | |
throw exception4; | |
exception5; | |
hashmap3; | |
JVM INSTR monitorexit ; | |
throw exception5; | |
boolean flag1 = false; | |
String s3; | |
if(packagesetting1 == null) | |
{ | |
flag1 = false; | |
if(packagesetting != null) | |
{ | |
int j1 = k & 0x40; | |
flag1 = false; | |
if(j1 != 0) | |
{ | |
boolean flag2 = isSystemApp(packagesetting); | |
flag1 = false; | |
int i1; | |
if(!flag2) | |
if(compareSignatures(((PackageSettingBase) (packagesetting)).signatures.mSignatures, package1.mSignatures) != 0) | |
{ | |
deletePackageLI(package1.packageName, null, true, 0, null, false, false); | |
packagesetting = null; | |
} else | |
if(package1.mVersionCode < ((PackageSettingBase) (packagesetting)).versionCode) | |
{ | |
flag1 = true; | |
} else | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package ").append(((PackageSettingBase) (packagesetting)).name).append(" at ").append(file).append("reverting from ").append(((PackageSettingBase) (packagesetting)).codePathString).append(": new version ").append(package1.mVersionCode).append(" better than installed ").append(((PackageSettingBase) (packagesetting)).versionCode).toString()); | |
InstallArgs installargs = createInstallArgs(packageFlagsToInstallFlags(packagesetting), ((PackageSettingBase) (packagesetting)).codePathString, ((PackageSettingBase) (packagesetting)).resourcePathString, ((PackageSettingBase) (packagesetting)).nativeLibraryPathString); | |
synchronized(mInstallLock) | |
{ | |
installargs.cleanUpResourcesLI(); | |
} | |
flag1 = false; | |
} | |
} | |
} | |
} | |
if(packagesetting != null && !((PackageSettingBase) (packagesetting)).codePath.equals(((PackageSettingBase) (packagesetting)).resourcePath)) | |
k |= 0x10; | |
if((k & 0x10) != 0) | |
{ | |
if(packagesetting != null && ((PackageSettingBase) (packagesetting)).resourcePathString != null) | |
{ | |
s3 = ((PackageSettingBase) (packagesetting)).resourcePathString; | |
} else | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Resource path not set for pkg : ").append(package1.packageName).toString()); | |
s3 = null; | |
} | |
} else | |
{ | |
s3 = package1.mScanPath; | |
} | |
setApplicationInfoPaths(package1, package1.mScanPath, s3); | |
i1 = j | 8; | |
package2 = scanPackageLI(package1, k, i1, l, userhandle); | |
if(!flag1) goto _L5; else goto _L4 | |
_L4: | |
synchronized(mPackages) | |
{ | |
grantPermissionsLPw(package1, true); | |
mSettings.disableSystemPackageLPw(package1.packageName); | |
} | |
return package2; | |
exception1; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
exception2; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception2; | |
} | |
static final void sendPackageBroadcast(String s, String s1, Bundle bundle, String s2, IIntentReceiver iintentreceiver, int ai[]) | |
{ | |
IActivityManager iactivitymanager = ActivityManagerNative.getDefault(); | |
if(iactivitymanager == null) goto _L2; else goto _L1 | |
_L1: | |
if(ai != null) | |
break MISSING_BLOCK_LABEL_24; | |
ai = iactivitymanager.getRunningUserIds(); | |
int ai1[] = ai; | |
int i = ai1.length; | |
int j = 0; | |
_L6: | |
if(j >= i) goto _L2; else goto _L3 | |
_L3: | |
int k = ai1[j]; | |
if(s1 == null) | |
break MISSING_BLOCK_LABEL_200; | |
Uri uri = Uri.fromParts("package", s1, null); | |
_L4: | |
Intent intent = new Intent(s, uri); | |
if(bundle == null) | |
break MISSING_BLOCK_LABEL_87; | |
intent.putExtras(bundle); | |
if(s2 == null) | |
break MISSING_BLOCK_LABEL_98; | |
intent.setPackage(s2); | |
int l = intent.getIntExtra("android.intent.extra.UID", -1); | |
if(l <= 0) | |
break MISSING_BLOCK_LABEL_143; | |
if(UserHandle.getUserId(l) != k) | |
intent.putExtra("android.intent.extra.UID", UserHandle.getUid(k, UserHandle.getAppId(l))); | |
intent.putExtra("android.intent.extra.user_handle", k); | |
intent.addFlags(0x8000000); | |
boolean flag; | |
if(iintentreceiver != null) | |
flag = true; | |
else | |
flag = false; | |
iactivitymanager.broadcastIntent(null, intent, null, iintentreceiver, 0, null, null, null, flag, false, k); | |
j++; | |
continue; /* Loop/switch isn't completed */ | |
uri = null; | |
goto _L4 | |
RemoteException remoteexception; | |
remoteexception; | |
_L2: | |
return; | |
if(true) goto _L6; else goto _L5 | |
_L5: | |
} | |
private void sendPackageChangedBroadcast(String s, boolean flag, ArrayList arraylist, int i) | |
{ | |
Bundle bundle; | |
String as[]; | |
int ai[]; | |
try | |
{ | |
mContext.getPackageManager().getApplicationInfo(s, 0); | |
} | |
catch(android.content.pm.PackageManager.NameNotFoundException namenotfoundexception) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Package Not Found while sendPackageChanged: ").append(s).toString(), namenotfoundexception); | |
return; | |
} | |
bundle = new Bundle(4); | |
bundle.putString("android.intent.extra.changed_component_name", (String)arraylist.get(0)); | |
as = new String[arraylist.size()]; | |
arraylist.toArray(as); | |
bundle.putStringArray("android.intent.extra.changed_component_name_list", as); | |
bundle.putBoolean("android.intent.extra.DONT_KILL_APP", flag); | |
bundle.putInt("android.intent.extra.UID", i); | |
ai = new int[1]; | |
ai[0] = UserHandle.getUserId(i); | |
sendPackageBroadcast("android.intent.action.PACKAGE_CHANGED", s, bundle, null, null, ai); | |
} | |
private void sendResourcesChangedBroadcast(boolean flag, ArrayList arraylist, int ai[], IIntentReceiver iintentreceiver) | |
{ | |
int i = arraylist.size(); | |
if(i > 0) | |
{ | |
Bundle bundle = new Bundle(); | |
bundle.putStringArray("android.intent.extra.changed_package_list", (String[])arraylist.toArray(new String[i])); | |
if(ai != null) | |
bundle.putIntArray("android.intent.extra.changed_uid_list", ai); | |
String s; | |
if(flag) | |
s = "android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE"; | |
else | |
s = "android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE"; | |
sendPackageBroadcast(s, null, bundle, null, iintentreceiver, null); | |
} | |
} | |
private static void setApplicationInfoPaths(android.content.pm.PackageParser.Package package1, String s, String s1) | |
{ | |
package1.mScanPath = s; | |
package1.mPath = s; | |
package1.applicationInfo.sourceDir = s; | |
package1.applicationInfo.publicSourceDir = s1; | |
} | |
private void setEnabledSetting(String s, String s1, int i, int j, int k) | |
{ | |
int l; | |
boolean flag; | |
String s2; | |
HashMap hashmap; | |
PackageSetting packagesetting; | |
if(i != 0 && i != 1 && i != 2 && i != 3) | |
throw new IllegalArgumentException((new StringBuilder()).append("Invalid new component state: ").append(i).toString()); | |
l = Binder.getCallingUid(); | |
int i1 = mContext.checkCallingOrSelfPermission("android.permission.CHANGE_COMPONENT_ENABLED_STATE"); | |
enforceCrossUserPermission(l, k, false, "set enabled"); | |
boolean flag1; | |
Exception exception; | |
IllegalArgumentException illegalargumentexception1; | |
if(i1 == 0) | |
flag = true; | |
else | |
flag = false; | |
if(s1 == null) | |
flag1 = true; | |
else | |
flag1 = false; | |
if(flag1) | |
s2 = s; | |
else | |
s2 = s1; | |
hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
packagesetting = (PackageSetting)mSettings.mPackages.get(s); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_233; | |
if(s1 != null) | |
break MISSING_BLOCK_LABEL_191; | |
illegalargumentexception1 = new IllegalArgumentException((new StringBuilder()).append("Unknown package: ").append(s).toString()); | |
throw illegalargumentexception1; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
IllegalArgumentException illegalargumentexception2 = new IllegalArgumentException((new StringBuilder()).append("Unknown component: ").append(s).append("/").append(s1).toString()); | |
throw illegalargumentexception2; | |
if(flag) | |
break MISSING_BLOCK_LABEL_310; | |
if(!UserHandle.isSameApp(l, packagesetting.appId)) | |
{ | |
SecurityException securityexception = new SecurityException((new StringBuilder()).append("Permission Denial: attempt to change component state from pid=").append(Binder.getCallingPid()).append(", uid=").append(l).append(", package uid=").append(packagesetting.appId).toString()); | |
throw securityexception; | |
} | |
if(s1 != null) goto _L2; else goto _L1 | |
_L1: | |
if(packagesetting.getEnabled(k) != i) | |
break MISSING_BLOCK_LABEL_329; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
packagesetting.setEnabled(i, k); | |
_L9: | |
int j1; | |
ArrayList arraylist; | |
mSettings.writePackageRestrictionsLPr(k); | |
j1 = UserHandle.getUid(k, packagesetting.appId); | |
arraylist = (ArrayList)mPendingBroadcasts.get(s); | |
boolean flag2; | |
boolean flag3; | |
boolean flag4; | |
long l1; | |
boolean flag5; | |
Exception exception1; | |
android.content.pm.PackageParser.Package package1; | |
IllegalArgumentException illegalargumentexception; | |
if(arraylist == null) | |
flag2 = true; | |
else | |
flag2 = false; | |
if(!flag2) | |
break MISSING_BLOCK_LABEL_393; | |
arraylist = new ArrayList(); | |
if(!arraylist.contains(s2)) | |
arraylist.add(s2); | |
if((j & 1) != 0) goto _L4; else goto _L3 | |
_L3: | |
flag4 = true; | |
mPendingBroadcasts.remove(s); | |
_L13: | |
hashmap; | |
JVM INSTR monitorexit ; | |
l1 = Binder.clearCallingIdentity(); | |
if(!flag4) | |
break MISSING_BLOCK_LABEL_464; | |
if((j & 1) != 0) | |
flag5 = true; | |
else | |
flag5 = false; | |
sendPackageChangedBroadcast(s, flag5, arraylist, j1); | |
Binder.restoreCallingIdentity(l1); | |
return; | |
_L2: | |
package1 = packagesetting.pkg; | |
if(package1 == null) goto _L6; else goto _L5 | |
_L5: | |
if(package1.hasComponentClassName(s1)) goto _L7; else goto _L6 | |
_L6: | |
if(package1.applicationInfo.targetSdkVersion >= 16) | |
{ | |
illegalargumentexception = new IllegalArgumentException((new StringBuilder()).append("Component class ").append(s1).append(" does not exist in ").append(s).toString()); | |
throw illegalargumentexception; | |
} | |
Slog.w("PackageManager", (new StringBuilder()).append("Failed setComponentEnabledSetting: component class ").append(s1).append(" does not exist in ").append(s).toString()); | |
goto _L7 | |
_L14: | |
Slog.e("PackageManager", (new StringBuilder()).append("Invalid new component state: ").append(i).toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
_L16: | |
if(packagesetting.enableComponentLPw(s1, k)) goto _L9; else goto _L8 | |
_L8: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
_L17: | |
if(packagesetting.disableComponentLPw(s1, k)) goto _L9; else goto _L10 | |
_L10: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
_L15: | |
if(packagesetting.restoreComponentLPw(s1, k)) goto _L9; else goto _L11 | |
_L11: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
_L4: | |
if(!flag2) | |
break MISSING_BLOCK_LABEL_676; | |
mPendingBroadcasts.put(s, arraylist); | |
flag3 = mHandler.hasMessages(1); | |
flag4 = false; | |
if(flag3) goto _L13; else goto _L12 | |
_L12: | |
mHandler.sendEmptyMessageDelayed(1, 10000L); | |
flag4 = false; | |
goto _L13 | |
exception1; | |
Binder.restoreCallingIdentity(l1); | |
throw exception1; | |
_L7: | |
i; | |
JVM INSTR tableswitch 0 2: default 585 | |
// 0 645 | |
// 1 615 | |
// 2 630; | |
goto _L14 _L15 _L16 _L17 | |
} | |
private void setInternalAppNativeLibraryPath(android.content.pm.PackageParser.Package package1, PackageSetting packagesetting) | |
{ | |
String s = getApkName(((PackageSettingBase) (packagesetting)).codePathString); | |
String s1 = (new File(mAppLibInstallDir, s)).getPath(); | |
package1.applicationInfo.nativeLibraryDir = s1; | |
packagesetting.nativeLibraryPathString = s1; | |
} | |
private boolean shouldRemoveApk(String s) | |
{ | |
return hiddenApkList.contains(s); | |
} | |
static String[] splitString(String s, char c) | |
{ | |
int i = 1; | |
int j = 0; | |
do | |
{ | |
int k = s.indexOf(c, j); | |
if(k < 0) | |
break; | |
i++; | |
j = k + 1; | |
} while(true); | |
String as[] = new String[i]; | |
int l = 0; | |
int i1 = 0; | |
int j1 = 0; | |
do | |
{ | |
int k1 = s.indexOf(c, l); | |
if(k1 >= 0) | |
{ | |
as[i1] = s.substring(j1, k1); | |
i1++; | |
l = k1 + 1; | |
j1 = l; | |
} else | |
{ | |
as[i1] = s.substring(j1, s.length()); | |
return as; | |
} | |
} while(true); | |
} | |
private void unloadAllContainers(Set set) | |
{ | |
for(Iterator iterator = set.iterator(); iterator.hasNext();) | |
{ | |
AsecInstallArgs asecinstallargs = (AsecInstallArgs)iterator.next(); | |
synchronized(mInstallLock) | |
{ | |
asecinstallargs.doPostDeleteLI(false); | |
} | |
} | |
break MISSING_BLOCK_LABEL_55; | |
exception; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
private void unloadMediaPackages(HashMap hashmap, int ai[], final boolean reportStatus) | |
{ | |
ArrayList arraylist; | |
ArrayList arraylist1; | |
final Set keys; | |
Iterator iterator; | |
arraylist = new ArrayList(); | |
arraylist1 = new ArrayList(); | |
keys = hashmap.keySet(); | |
iterator = keys.iterator(); | |
_L4: | |
AsecInstallArgs asecinstallargs; | |
String s; | |
PackageRemovedInfo packageremovedinfo; | |
if(!iterator.hasNext()) | |
break MISSING_BLOCK_LABEL_156; | |
asecinstallargs = (AsecInstallArgs)iterator.next(); | |
s = asecinstallargs.getPackageName(); | |
packageremovedinfo = new PackageRemovedInfo(); | |
Object obj = mInstallLock; | |
obj; | |
JVM INSTR monitorenter ; | |
if(!deletePackageLI(s, null, false, 1, packageremovedinfo, false, true)) | |
break MISSING_BLOCK_LABEL_118; | |
arraylist.add(s); | |
_L2: | |
continue; /* Loop/switch isn't completed */ | |
Exception exception1; | |
exception1; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
Slog.e("PackageManager", (new StringBuilder()).append("Failed to delete pkg from sdcard : ").append(s).toString()); | |
arraylist1.add(asecinstallargs); | |
if(true) goto _L2; else goto _L1 | |
_L1: | |
synchronized(mPackages) | |
{ | |
mSettings.writeLPr(); | |
} | |
if(arraylist.size() > 0) | |
{ | |
sendResourcesChangedBroadcast(false, arraylist, ai, new android.content.IIntentReceiver.Stub() { | |
public void performReceive(Intent intent, int j, String s1, Bundle bundle, boolean flag, boolean flag1, int k) | |
throws RemoteException | |
{ | |
PackageHandler packagehandler1 = mHandler; | |
int l; | |
Message message1; | |
if(reportStatus) | |
l = 1; | |
else | |
l = 0; | |
message1 = packagehandler1.obtainMessage(12, l, 1, keys); | |
mHandler.sendMessage(message1); | |
} | |
final PackageManagerService this$0; | |
final Set val$keys; | |
final boolean val$reportStatus; | |
{ | |
this$0 = PackageManagerService.this; | |
reportStatus = flag; | |
keys = set; | |
super(); | |
} | |
} | |
); | |
return; | |
} | |
break MISSING_BLOCK_LABEL_211; | |
exception; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception; | |
PackageHandler packagehandler = mHandler; | |
int i; | |
Message message; | |
if(reportStatus) | |
i = 1; | |
else | |
i = 0; | |
message = packagehandler.obtainMessage(12, i, -1, keys); | |
mHandler.sendMessage(message); | |
return; | |
if(true) goto _L4; else goto _L3 | |
_L3: | |
} | |
private void updateExternalMediaStatusInner(boolean flag, boolean flag1, boolean flag2) | |
{ | |
int ai[]; | |
HashSet hashset; | |
HashMap hashmap; | |
String as[]; | |
ai = null; | |
hashset = new HashSet(); | |
hashmap = new HashMap(); | |
as = PackageHelper.getSecureContainerList(); | |
if(flag || as != null && as.length != 0) | |
break MISSING_BLOCK_LABEL_64; | |
IMountService imountservice = PackageHelper.getMountService(); | |
if(imountservice == null) | |
break MISSING_BLOCK_LABEL_64; | |
String as2[] = imountservice.getBackupSecureContainerList(); | |
as = as2; | |
_L3: | |
String as1[] = as; | |
if(as1 != null && as1.length != 0) goto _L2; else goto _L1 | |
_L1: | |
Log.i("PackageManager", "No secure containers on sdcard"); | |
_L16: | |
int ai1[]; | |
HashMap hashmap1; | |
Exception exception; | |
int i; | |
int j; | |
int k; | |
String s; | |
String s1; | |
int k1; | |
PackageSetting packagesetting; | |
AsecInstallArgs asecinstallargs; | |
int l1; | |
RemoteException remoteexception; | |
if(flag) | |
{ | |
loadMediaPackages(hashmap, ai, hashset); | |
startCleaningPackages(); | |
return; | |
} else | |
{ | |
unloadMediaPackages(hashmap, ai, flag1); | |
return; | |
} | |
remoteexception; | |
Log.e("PackageManager", "MountService not running?"); | |
goto _L3 | |
_L2: | |
ai1 = new int[as1.length]; | |
hashmap1 = mPackages; | |
hashmap1; | |
JVM INSTR monitorenter ; | |
i = as1.length; | |
j = 0; | |
k = 0; | |
_L18: | |
if(j >= i) goto _L5; else goto _L4 | |
_L4: | |
s = as1[j]; | |
s1 = getAsecPackageName(s); | |
if(s1 != null) goto _L7; else goto _L6 | |
_L6: | |
hashset.add(s); | |
k1 = k; | |
goto _L8 | |
_L7: | |
packagesetting = (PackageSetting)mSettings.mPackages.get(s1); | |
if(packagesetting != null) goto _L10; else goto _L9 | |
_L9: | |
Log.i("PackageManager", (new StringBuilder()).append("Deleting container with no matching settings ").append(s).toString()); | |
hashset.add(s); | |
k1 = k; | |
goto _L8 | |
_L10: | |
if(!flag2 || flag) goto _L12; else goto _L11 | |
_L11: | |
if(isExternal(packagesetting)) goto _L12; else goto _L13 | |
_L13: | |
k1 = k; | |
goto _L8 | |
_L12: | |
asecinstallargs = new AsecInstallArgs(s, isForwardLocked(packagesetting)); | |
if(((PackageSettingBase) (packagesetting)).codePathString == null || !((PackageSettingBase) (packagesetting)).codePathString.equals(asecinstallargs.getCodePath())) goto _L15; else goto _L14 | |
_L14: | |
hashmap.put(asecinstallargs, ((PackageSettingBase) (packagesetting)).codePathString); | |
l1 = packagesetting.appId; | |
if(l1 == -1) | |
break MISSING_BLOCK_LABEL_531; | |
k1 = k + 1; | |
ai1[k] = l1; | |
goto _L8 | |
_L17: | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L15: | |
Log.i("PackageManager", (new StringBuilder()).append("Deleting stale container for ").append(s).toString()); | |
hashset.add(s); | |
break MISSING_BLOCK_LABEL_531; | |
_L5: | |
hashmap1; | |
JVM INSTR monitorexit ; | |
ai = null; | |
if(k > 0) | |
{ | |
Arrays.sort(ai1, 0, k); | |
ai = new int[k]; | |
ai[0] = ai1[0]; | |
int l = 1; | |
int i1 = 0; | |
while(l < k) | |
{ | |
int j1; | |
if(ai1[l - 1] != ai1[l]) | |
{ | |
j1 = i1 + 1; | |
ai[i1] = ai1[l]; | |
} else | |
{ | |
j1 = i1; | |
} | |
l++; | |
i1 = j1; | |
} | |
} | |
goto _L16 | |
exception; | |
k; | |
goto _L17 | |
_L8: | |
j++; | |
k = k1; | |
goto _L18 | |
exception; | |
goto _L17 | |
k1 = k; | |
goto _L8 | |
} | |
private void updatePermissionsLPw(String s, android.content.pm.PackageParser.Package package1, int i) | |
{ | |
boolean flag = true; | |
Iterator iterator = mSettings.mPermissionTrees.values().iterator(); | |
do | |
{ | |
if(!iterator.hasNext()) | |
break; | |
BasePermission basepermission2 = (BasePermission)iterator.next(); | |
if(basepermission2.packageSetting == null) | |
basepermission2.packageSetting = (PackageSettingBase)mSettings.mPackages.get(basepermission2.sourcePackage); | |
if(basepermission2.packageSetting == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Removing dangling permission tree: ").append(basepermission2.name).append(" from package ").append(basepermission2.sourcePackage).toString()); | |
iterator.remove(); | |
} else | |
if(s != null && s.equals(basepermission2.sourcePackage) && (package1 == null || !hasPermission(package1, basepermission2.name))) | |
{ | |
Slog.i("PackageManager", (new StringBuilder()).append("Removing old permission tree: ").append(basepermission2.name).append(" from package ").append(basepermission2.sourcePackage).toString()); | |
i |= 1; | |
iterator.remove(); | |
} | |
} while(true); | |
Iterator iterator1 = mSettings.mPermissions.values().iterator(); | |
do | |
{ | |
if(!iterator1.hasNext()) | |
break; | |
BasePermission basepermission = (BasePermission)iterator1.next(); | |
if(basepermission.type == 2 && basepermission.packageSetting == null && basepermission.pendingInfo != null) | |
{ | |
BasePermission basepermission1 = findPermissionTreeLP(basepermission.name); | |
if(basepermission1 != null && basepermission1.perm != null) | |
{ | |
basepermission.packageSetting = basepermission1.packageSetting; | |
basepermission.perm = new android.content.pm.PackageParser.Permission(((android.content.pm.PackageParser.Component) (basepermission1.perm)).owner, new PermissionInfo(basepermission.pendingInfo)); | |
basepermission.perm.info.packageName = ((PackageItemInfo) (basepermission1.perm.info)).packageName; | |
basepermission.perm.info.name = basepermission.name; | |
basepermission.uid = basepermission1.uid; | |
} | |
} | |
if(basepermission.packageSetting == null) | |
basepermission.packageSetting = (PackageSettingBase)mSettings.mPackages.get(basepermission.sourcePackage); | |
if(basepermission.packageSetting == null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Removing dangling permission: ").append(basepermission.name).append(" from package ").append(basepermission.sourcePackage).toString()); | |
iterator1.remove(); | |
} else | |
if(s != null && s.equals(basepermission.sourcePackage) && (package1 == null || !hasPermission(package1, basepermission.name))) | |
{ | |
Slog.i("PackageManager", (new StringBuilder()).append("Removing old permission: ").append(basepermission.name).append(" from package ").append(basepermission.sourcePackage).toString()); | |
i |= 1; | |
iterator1.remove(); | |
} | |
} while(true); | |
if((i & 1) != 0) | |
{ | |
Iterator iterator2 = mPackages.values().iterator(); | |
do | |
{ | |
if(!iterator2.hasNext()) | |
break; | |
android.content.pm.PackageParser.Package package2 = (android.content.pm.PackageParser.Package)iterator2.next(); | |
if(package2 != package1) | |
{ | |
boolean flag1; | |
if((i & 4) != 0) | |
flag1 = flag; | |
else | |
flag1 = false; | |
grantPermissionsLPw(package2, flag1); | |
} | |
} while(true); | |
} | |
if(package1 != null) | |
{ | |
if((i & 2) == 0) | |
flag = false; | |
grantPermissionsLPw(package1, flag); | |
} | |
} | |
private void updateSettingsLI(android.content.pm.PackageParser.Package package1, String s, PackageInstalledInfo packageinstalledinfo) | |
{ | |
int i; | |
String s1; | |
i = 1; | |
s1 = package1.packageName; | |
clearThemePackageCache(s1); | |
synchronized(mPackages) | |
{ | |
mSettings.setInstallStatus(s1, 0); | |
mSettings.writeLPr(); | |
} | |
int j = moveDexFilesLI(package1); | |
packageinstalledinfo.returnCode = j; | |
if(j != i) | |
return; | |
break MISSING_BLOCK_LABEL_73; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
Log.d("PackageManager", (new StringBuilder()).append("New package installed in ").append(package1.mPath).toString()); | |
HashMap hashmap1 = mPackages; | |
hashmap1; | |
JVM INSTR monitorenter ; | |
String s2 = package1.packageName; | |
Exception exception1; | |
if(package1.permissions.size() <= 0) | |
i = 0; | |
updatePermissionsLPw(s2, package1, i | 2); | |
packageinstalledinfo.name = s1; | |
packageinstalledinfo.uid = package1.applicationInfo.uid; | |
packageinstalledinfo.pkg = package1; | |
mSettings.setInstallStatus(s1, 1); | |
mSettings.setInstallerPackageName(s1, s); | |
packageinstalledinfo.returnCode = 1; | |
mSettings.writeLPr(); | |
return; | |
exception1; | |
hashmap1; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
} | |
private boolean verifyPackageUpdateLPr(PackageSetting packagesetting, android.content.pm.PackageParser.Package package1) | |
{ | |
if((1 & ((GrantedPermissions) (packagesetting)).pkgFlags) == 0) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Unable to update from ").append(((PackageSettingBase) (packagesetting)).name).append(" to ").append(package1.packageName).append(": old package not in system partition").toString()); | |
return false; | |
} | |
if(mPackages.get(((PackageSettingBase) (packagesetting)).name) != null) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Unable to update from ").append(((PackageSettingBase) (packagesetting)).name).append(" to ").append(package1.packageName).append(": old package still exists").toString()); | |
return false; | |
} else | |
{ | |
return true; | |
} | |
} | |
private boolean verifySignaturesLP(PackageSetting packagesetting, android.content.pm.PackageParser.Package package1) | |
{ | |
if(((PackageSettingBase) (packagesetting)).signatures.mSignatures != null && compareSignatures(((PackageSettingBase) (packagesetting)).signatures.mSignatures, package1.mSignatures) != 0) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Package ").append(package1.packageName).append(" signatures do not match the previously installed version; ignoring!").toString()); | |
mLastScanError = -7; | |
return false; | |
} | |
if(packagesetting.sharedUser != null && packagesetting.sharedUser.signatures.mSignatures != null && compareSignatures(packagesetting.sharedUser.signatures.mSignatures, package1.mSignatures) != 0) | |
{ | |
Slog.e("PackageManager", (new StringBuilder()).append("Package ").append(package1.packageName).append(" has no signatures that match those in shared user ").append(packagesetting.sharedUser.name).append("; ignoring!").toString()); | |
mLastScanError = -8; | |
return false; | |
} else | |
{ | |
return true; | |
} | |
} | |
private boolean willScanFor3LM(InstallArgs installargs, File file) | |
{ | |
String s; | |
final byte nextState; | |
String as[] = mDeviceManager.getPackageScanner(); | |
if(as == null) | |
{ | |
Slog.d("PackageManager", "Could not talk to 3LM service, will skip scanning"); | |
return false; | |
} | |
if(as.length != 3) | |
{ | |
Slog.d("PackageManager", "Bad response from 3LM service, will skip scanning"); | |
return false; | |
} | |
s = as[0]; | |
if(s == null) | |
{ | |
Slog.d("PackageManager", "Empty scanner from 3LM service, will skip scanning"); | |
return false; | |
} | |
int i; | |
String as1[]; | |
int j; | |
if(Boolean.parseBoolean(as[1])) | |
nextState = 17; | |
else | |
nextState = 18; | |
i = 10000; | |
j = Integer.parseInt(as[2]); | |
i = j; | |
_L2: | |
final int timeout = i; | |
as1 = s.split("/"); | |
if(as1.length < 1 || as1[0].length() < 1 || getPackageInfo(as1[0], 0, 0) == null) | |
{ | |
Slog.d("PackageManager", (new StringBuilder()).append("Registered scan package ").append(s).append(" not found, will not scan").toString()); | |
return false; | |
} | |
Slog.d("PackageManager", (new StringBuilder()).append("Will use package ").append(s).append(" for installation scan").toString()); | |
final int scanId = mPendingVerificationToken; | |
mPendingVerificationToken = scanId + 1; | |
Intent intent = new Intent("com.threelm.SCAN_PACKAGE"); | |
intent.setDataAndType(installargs.packageURI, "application/vnd.android.package-archive"); | |
intent.addFlags(1); | |
intent.putExtra("android.content.pm.extra.VERIFICATION_ID", scanId); | |
String s1 = installargs.installerSourcePackageName; | |
if(s1 == null) | |
s1 = ""; | |
Slog.d("PackageManager", (new StringBuilder()).append("Passing source '").append(s1).append("' to scanner").toString()); | |
intent.putExtra("android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE", s1); | |
PackageScanState packagescanstate = new PackageScanState(installargs, file); | |
mPendingScans.append(scanId, packagescanstate); | |
intent.setComponent(ComponentName.unflattenFromString(s)); | |
mContext.sendOrderedBroadcast(intent, null, new BroadcastReceiver() { | |
public void onReceive(Context context, Intent intent1) | |
{ | |
Message message = mHandler.obtainMessage(nextState); | |
message.arg1 = scanId; | |
mHandler.sendMessageDelayed(message, timeout); | |
} | |
final PackageManagerService this$0; | |
final int val$nextState; | |
final int val$scanId; | |
final int val$timeout; | |
{ | |
this$0 = PackageManagerService.this; | |
nextState = i; | |
scanId = j; | |
timeout = k; | |
super(); | |
} | |
} | |
, null, 0, null, null); | |
return true; | |
NumberFormatException numberformatexception; | |
numberformatexception; | |
if(true) goto _L2; else goto _L1 | |
_L1: | |
} | |
public void addPackageToPreferred(String s) | |
{ | |
Slog.w("PackageManager", "addPackageToPreferred: this is now a no-op"); | |
} | |
public boolean addPermission(PermissionInfo permissioninfo) | |
{ | |
boolean flag; | |
synchronized(mPackages) | |
{ | |
flag = addPermissionLocked(permissioninfo, false); | |
} | |
return flag; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public boolean addPermissionAsync(PermissionInfo permissioninfo) | |
{ | |
boolean flag; | |
synchronized(mPackages) | |
{ | |
flag = addPermissionLocked(permissioninfo, true); | |
} | |
return flag; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
boolean addPermissionLocked(PermissionInfo permissioninfo, boolean flag) | |
{ | |
BasePermission basepermission; | |
BasePermission basepermission1; | |
boolean flag1; | |
boolean flag2; | |
int i; | |
if(((PackageItemInfo) (permissioninfo)).labelRes == 0 && ((PackageItemInfo) (permissioninfo)).nonLocalizedLabel == null) | |
throw new SecurityException("Label must be specified in permission"); | |
basepermission = checkPermissionTreeLP(((PackageItemInfo) (permissioninfo)).name); | |
basepermission1 = (BasePermission)mSettings.mPermissions.get(((PackageItemInfo) (permissioninfo)).name); | |
PermissionInfo permissioninfo1; | |
if(basepermission1 == null) | |
flag1 = true; | |
else | |
flag1 = false; | |
flag2 = true; | |
i = PermissionInfo.fixProtectionLevel(permissioninfo.protectionLevel); | |
if(!flag1) goto _L2; else goto _L1 | |
_L1: | |
basepermission1 = new BasePermission(((PackageItemInfo) (permissioninfo)).name, basepermission.sourcePackage, 2); | |
_L4: | |
basepermission1.protectionLevel = i; | |
permissioninfo1 = new PermissionInfo(permissioninfo); | |
permissioninfo1.protectionLevel = i; | |
basepermission1.perm = new android.content.pm.PackageParser.Permission(((android.content.pm.PackageParser.Component) (basepermission.perm)).owner, permissioninfo1); | |
basepermission1.perm.info.packageName = ((PackageItemInfo) (basepermission.perm.info)).packageName; | |
basepermission1.uid = basepermission.uid; | |
if(flag1) | |
mSettings.mPermissions.put(((PackageItemInfo) (permissioninfo1)).name, basepermission1); | |
if(flag2) | |
{ | |
if(flag) | |
break; /* Loop/switch isn't completed */ | |
mSettings.writeLPr(); | |
} | |
return flag1; | |
_L2: | |
if(basepermission1.type != 2) | |
throw new SecurityException((new StringBuilder()).append("Not allowed to modify non-dynamic permission ").append(((PackageItemInfo) (permissioninfo)).name).toString()); | |
if(basepermission1.protectionLevel == i && ((android.content.pm.PackageParser.Component) (basepermission1.perm)).owner.equals(((android.content.pm.PackageParser.Component) (basepermission.perm)).owner) && basepermission1.uid == basepermission.uid && comparePermissionInfos(basepermission1.perm.info, permissioninfo)) | |
flag2 = false; | |
if(true) goto _L4; else goto _L3 | |
_L3: | |
scheduleWriteSettingsLocked(); | |
return flag1; | |
} | |
public void addPreferredActivity(IntentFilter intentfilter, int i, ComponentName acomponentname[], ComponentName componentname, int j) | |
{ | |
int k; | |
k = Binder.getCallingUid(); | |
enforceCrossUserPermission(k, j, true, "add preferred activity"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
int l = -1; | |
Exception exception; | |
try | |
{ | |
if(ConfigBuildFlags.CAPP_UPLUSAPI) | |
l = mContext.getPackageManager().getApplicationInfo("com.lguplus.common", 0).uid; | |
} | |
catch(android.content.pm.PackageManager.NameNotFoundException namenotfoundexception) { } | |
if(ConfigBuildFlags.CAPP_UPLUSAPI && Binder.getCallingUid() == l || mContext.checkCallingOrSelfPermission("android.permission.SET_PREFERRED_APPLICATIONS") == 0) | |
break MISSING_BLOCK_LABEL_134; | |
if(getUidTargetSdkVersionLockedLPr(k) >= 8) | |
break MISSING_BLOCK_LABEL_123; | |
Slog.w("PackageManager", (new StringBuilder()).append("Ignoring addPreferredActivity() from uid ").append(k).toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
mContext.enforceCallingOrSelfPermission("android.permission.SET_PREFERRED_APPLICATIONS", null); | |
Slog.i("PackageManager", (new StringBuilder()).append("Adding preferred activity ").append(componentname).append(" for user ").append(j).append(" :").toString()); | |
intentfilter.dump(new LogPrinter(4, "PackageManager"), " "); | |
mSettings.editPreferredActivitiesLPw(j).addFilter(new PreferredActivity(intentfilter, i, acomponentname, componentname)); | |
mSettings.writePackageRestrictionsLPr(j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public String[] canonicalToCurrentPackageNames(String as[]) | |
{ | |
String as1[] = new String[as.length]; | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
int i = -1 + as.length; | |
_L3: | |
if(i < 0) | |
break MISSING_BLOCK_LABEL_69; | |
String s = (String)mSettings.mRenamedPackages.get(as[i]); | |
if(s == null) | |
break MISSING_BLOCK_LABEL_60; | |
_L1: | |
as1[i] = s; | |
i--; | |
continue; /* Loop/switch isn't completed */ | |
s = as[i]; | |
goto _L1 | |
hashmap; | |
JVM INSTR monitorexit ; | |
return as1; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
if(true) goto _L3; else goto _L2 | |
_L2: | |
} | |
public int checkPermission(String s, String s1) | |
{ | |
boolean flag; | |
label0: | |
{ | |
flag = isPermissionEnforcedDefault(s); | |
synchronized(mPackages) | |
{ | |
if(!ThreelmMdmConfig.THREELM_MDM || mDeviceManager.checkPackagePermission(s, s1)) | |
break label0; | |
} | |
return -1; | |
} | |
if(!ConfigBuildFlags.CAPP_UPLUSAPI || mLguplusPermissions == null || !mLguplusPermissions.checkByPkgName(s1, s)) | |
break MISSING_BLOCK_LABEL_68; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 0; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_149; | |
PackageSetting packagesetting; | |
if(package1.mExtras == null) | |
break MISSING_BLOCK_LABEL_149; | |
packagesetting = (PackageSetting)package1.mExtras; | |
if(packagesetting.sharedUser == null) | |
break MISSING_BLOCK_LABEL_132; | |
if(!((GrantedPermissions) (packagesetting.sharedUser)).grantedPermissions.contains(s)) | |
break MISSING_BLOCK_LABEL_149; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 0; | |
if(!((GrantedPermissions) (packagesetting)).grantedPermissions.contains(s)) | |
break MISSING_BLOCK_LABEL_149; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 0; | |
if(!isPermissionEnforcedLocked(s, flag)) | |
return 0; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -1; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public int checkSignatures(String s, String s1) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1; | |
android.content.pm.PackageParser.Package package2; | |
package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
package2 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_59; | |
if(package1.mExtras == null || package2 == null) | |
break MISSING_BLOCK_LABEL_59; | |
if(package2.mExtras != null) | |
break MISSING_BLOCK_LABEL_64; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -4; | |
int i = compareSignatures(package1.mSignatures, package2.mSignatures); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return i; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public int checkUidPermission(String s, int i) | |
{ | |
boolean flag; | |
label0: | |
{ | |
flag = isPermissionEnforcedDefault(s); | |
synchronized(mPackages) | |
{ | |
if(!ThreelmMdmConfig.THREELM_MDM || mDeviceManager.checkUidPermission(s, i)) | |
break label0; | |
} | |
return -1; | |
} | |
if(!ConfigBuildFlags.CAPP_UPLUSAPI || !mLguplusPermissions.checkByUid(i, s)) | |
break MISSING_BLOCK_LABEL_61; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 0; | |
if(!checkOverridePermission(s, i)) | |
break MISSING_BLOCK_LABEL_75; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 0; | |
Object obj = mSettings.getUserIdLPr(UserHandle.getAppId(i)); | |
if(obj == null) | |
break MISSING_BLOCK_LABEL_113; | |
if(!((GrantedPermissions)obj).grantedPermissions.contains(s)) | |
break MISSING_BLOCK_LABEL_145; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 0; | |
HashSet hashset = (HashSet)mSystemPermissions.get(i); | |
if(hashset == null) | |
break MISSING_BLOCK_LABEL_145; | |
if(!hashset.contains(s)) | |
break MISSING_BLOCK_LABEL_145; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 0; | |
if(!isPermissionEnforcedLocked(s, flag)) | |
return 0; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -1; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public int checkUidSignatures(int i, int j) | |
{ | |
int k; | |
int l; | |
k = UserHandle.getAppId(i); | |
l = UserHandle.getAppId(j); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
Object obj = mSettings.getUserIdLPr(k); | |
if(obj == null) goto _L2; else goto _L1 | |
_L1: | |
if(!(obj instanceof SharedUserSetting)) goto _L4; else goto _L3 | |
_L3: | |
Signature asignature[] = ((SharedUserSetting)obj).signatures.mSignatures; | |
_L11: | |
Object obj1 = mSettings.getUserIdLPr(l); | |
if(obj1 == null) goto _L6; else goto _L5 | |
_L5: | |
if(!(obj1 instanceof SharedUserSetting)) goto _L8; else goto _L7 | |
_L7: | |
Signature asignature1[] = ((SharedUserSetting)obj1).signatures.mSignatures; | |
_L9: | |
int i1 = compareSignatures(asignature, asignature1); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return i1; | |
_L4: | |
if(obj instanceof PackageSetting) | |
{ | |
asignature = ((PackageSettingBase) ((PackageSetting)obj)).signatures.mSignatures; | |
continue; /* Loop/switch isn't completed */ | |
} | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -4; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L2: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -4; | |
_L8: | |
label0: | |
{ | |
if(!(obj1 instanceof PackageSetting)) | |
break label0; | |
asignature1 = ((PackageSettingBase) ((PackageSetting)obj1)).signatures.mSignatures; | |
} | |
goto _L9 | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -4; | |
_L6: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -4; | |
if(true) goto _L11; else goto _L10 | |
_L10: | |
} | |
void cleanPackageDataStructuresLILPw(android.content.pm.PackageParser.Package package1, boolean flag) | |
{ | |
int i = package1.providers.size(); | |
StringBuilder stringbuilder = null; | |
int j = 0; | |
while(j < i) | |
{ | |
android.content.pm.PackageParser.Provider provider = (android.content.pm.PackageParser.Provider)package1.providers.get(j); | |
mProvidersByComponent.remove(new ComponentName(((PackageItemInfo) (provider.info)).packageName, ((PackageItemInfo) (provider.info)).name)); | |
if(provider.info.authority != null) | |
{ | |
String as[] = provider.info.authority.split(";"); | |
for(int i3 = 0; i3 < as.length; i3++) | |
if(mProviders.get(as[i3]) == provider) | |
mProviders.remove(as[i3]); | |
if(flag) | |
{ | |
if(stringbuilder == null) | |
stringbuilder = new StringBuilder(256); | |
else | |
stringbuilder.append(' '); | |
stringbuilder.append(((PackageItemInfo) (provider.info)).name); | |
} | |
} | |
j++; | |
} | |
if(stringbuilder == null); | |
int k = package1.services.size(); | |
StringBuilder stringbuilder1 = null; | |
int l = 0; | |
while(l < k) | |
{ | |
android.content.pm.PackageParser.Service service = (android.content.pm.PackageParser.Service)package1.services.get(l); | |
mServices.removeService(service); | |
if(flag) | |
{ | |
if(stringbuilder1 == null) | |
stringbuilder1 = new StringBuilder(256); | |
else | |
stringbuilder1.append(' '); | |
stringbuilder1.append(((PackageItemInfo) (service.info)).name); | |
} | |
l++; | |
} | |
if(stringbuilder1 == null); | |
int i1 = package1.receivers.size(); | |
StringBuilder stringbuilder2 = null; | |
int j1 = 0; | |
while(j1 < i1) | |
{ | |
android.content.pm.PackageParser.Activity activity1 = (android.content.pm.PackageParser.Activity)package1.receivers.get(j1); | |
mReceivers.removeActivity(activity1, "receiver"); | |
if(flag) | |
{ | |
if(stringbuilder2 == null) | |
stringbuilder2 = new StringBuilder(256); | |
else | |
stringbuilder2.append(' '); | |
stringbuilder2.append(((PackageItemInfo) (activity1.info)).name); | |
} | |
j1++; | |
} | |
if(stringbuilder2 == null); | |
int k1 = package1.activities.size(); | |
StringBuilder stringbuilder3 = null; | |
int l1 = 0; | |
while(l1 < k1) | |
{ | |
android.content.pm.PackageParser.Activity activity = (android.content.pm.PackageParser.Activity)package1.activities.get(l1); | |
mActivities.removeActivity(activity, "activity"); | |
if(flag) | |
{ | |
if(stringbuilder3 == null) | |
stringbuilder3 = new StringBuilder(256); | |
else | |
stringbuilder3.append(' '); | |
stringbuilder3.append(((PackageItemInfo) (activity.info)).name); | |
} | |
l1++; | |
} | |
if(stringbuilder3 == null); | |
int i2 = package1.permissions.size(); | |
StringBuilder stringbuilder4 = null; | |
int j2 = 0; | |
while(j2 < i2) | |
{ | |
android.content.pm.PackageParser.Permission permission = (android.content.pm.PackageParser.Permission)package1.permissions.get(j2); | |
BasePermission basepermission = (BasePermission)mSettings.mPermissions.get(((PackageItemInfo) (permission.info)).name); | |
if(basepermission == null) | |
basepermission = (BasePermission)mSettings.mPermissionTrees.get(((PackageItemInfo) (permission.info)).name); | |
if(basepermission == null || basepermission.perm != permission) | |
continue; | |
basepermission.perm = null; | |
if(flag) | |
{ | |
if(stringbuilder4 == null) | |
stringbuilder4 = new StringBuilder(256); | |
else | |
stringbuilder4.append(' '); | |
stringbuilder4.append(((PackageItemInfo) (permission.info)).name); | |
} | |
j2++; | |
} | |
if(stringbuilder4 == null); | |
int k2 = package1.instrumentation.size(); | |
StringBuilder stringbuilder5 = null; | |
int l2 = 0; | |
while(l2 < k2) | |
{ | |
android.content.pm.PackageParser.Instrumentation instrumentation = (android.content.pm.PackageParser.Instrumentation)package1.instrumentation.get(l2); | |
mInstrumentation.remove(instrumentation.getComponentName()); | |
if(flag) | |
{ | |
if(stringbuilder5 == null) | |
stringbuilder5 = new StringBuilder(256); | |
else | |
stringbuilder5.append(' '); | |
stringbuilder5.append(((PackageItemInfo) (instrumentation.info)).name); | |
} | |
l2++; | |
} | |
if(stringbuilder5 == null); | |
} | |
void cleanUpUserLILPw(int i) | |
{ | |
if(!mDirtyUsers.remove(Integer.valueOf(i))); | |
mSettings.removeUserLPr(i); | |
if(mInstaller != null) | |
mInstaller.removeUserDataDirs(i); | |
} | |
void cleanupInstallFailedPackage(PackageSetting packagesetting) | |
{ | |
Slog.i("PackageManager", (new StringBuilder()).append("Cleaning up incompletely installed app: ").append(((PackageSettingBase) (packagesetting)).name).toString()); | |
removeDataDirsLI(((PackageSettingBase) (packagesetting)).name); | |
if(((PackageSettingBase) (packagesetting)).codePath != null && !((PackageSettingBase) (packagesetting)).codePath.delete()) | |
Slog.w("PackageManager", (new StringBuilder()).append("Unable to remove old code file: ").append(((PackageSettingBase) (packagesetting)).codePath).toString()); | |
if(((PackageSettingBase) (packagesetting)).resourcePath != null && !((PackageSettingBase) (packagesetting)).resourcePath.delete() && !((PackageSettingBase) (packagesetting)).resourcePath.equals(((PackageSettingBase) (packagesetting)).codePath)) | |
Slog.w("PackageManager", (new StringBuilder()).append("Unable to remove old code file: ").append(((PackageSettingBase) (packagesetting)).resourcePath).toString()); | |
mSettings.removePackageLPw(((PackageSettingBase) (packagesetting)).name); | |
} | |
public void clearApplicationUserData(final String packageName, final IPackageDataObserver observer, final int userId) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.CLEAR_APP_USER_DATA", null); | |
enforceCrossUserPermission(Binder.getCallingUid(), userId, true, "clear application data"); | |
mHandler.post(new Runnable() { | |
public void run() | |
{ | |
boolean flag; | |
mHandler.removeCallbacks(this); | |
synchronized(mInstallLock) | |
{ | |
flag = clearApplicationUserDataLI(packageName, userId); | |
} | |
clearExternalStorageDataSync(packageName, userId, true); | |
if(flag) | |
{ | |
DeviceStorageMonitorService devicestoragemonitorservice = (DeviceStorageMonitorService)ServiceManager.getService("devicestoragemonitor"); | |
if(devicestoragemonitorservice != null) | |
devicestoragemonitorservice.updateMemory(); | |
} | |
if(observer == null) | |
break MISSING_BLOCK_LABEL_100; | |
observer.onRemoveCompleted(packageName, flag); | |
return; | |
exception; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception; | |
RemoteException remoteexception; | |
remoteexception; | |
Log.i("PackageManager", "Observer no longer exists."); | |
return; | |
} | |
final PackageManagerService this$0; | |
final IPackageDataObserver val$observer; | |
final String val$packageName; | |
final int val$userId; | |
{ | |
this$0 = PackageManagerService.this; | |
packageName = s; | |
userId = i; | |
observer = ipackagedataobserver; | |
super(); | |
} | |
} | |
); | |
} | |
public void clearPackagePreferredActivities(String s) | |
{ | |
int i = Binder.getCallingUid(); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
int j = -1; | |
Exception exception; | |
android.content.pm.PackageParser.Package package1; | |
try | |
{ | |
if(ConfigBuildFlags.CAPP_UPLUSAPI) | |
j = mContext.getPackageManager().getApplicationInfo("com.lguplus.common", 0).uid; | |
} | |
catch(android.content.pm.PackageManager.NameNotFoundException namenotfoundexception) { } | |
if(ConfigBuildFlags.CAPP_UPLUSAPI && i == j) | |
break MISSING_BLOCK_LABEL_148; | |
package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_81; | |
if(package1.applicationInfo.uid == i) | |
break MISSING_BLOCK_LABEL_148; | |
if(mContext.checkCallingOrSelfPermission("android.permission.SET_PREFERRED_APPLICATIONS") == 0) | |
break MISSING_BLOCK_LABEL_148; | |
if(getUidTargetSdkVersionLockedLPr(Binder.getCallingUid()) >= 8) | |
break MISSING_BLOCK_LABEL_137; | |
Slog.w("PackageManager", (new StringBuilder()).append("Ignoring clearPackagePreferredActivities() from uid ").append(Binder.getCallingUid()).toString()); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
mContext.enforceCallingOrSelfPermission("android.permission.SET_PREFERRED_APPLICATIONS", null); | |
if(clearPackagePreferredActivitiesLPw(s, UserHandle.getCallingUserId())) | |
scheduleWriteSettingsLocked(); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
boolean clearPackagePreferredActivitiesLPw(String s, int i) | |
{ | |
ArrayList arraylist = null; | |
boolean flag = false; | |
int j = 0; | |
while(j < mSettings.mPreferredActivities.size()) | |
{ | |
int k = mSettings.mPreferredActivities.keyAt(j); | |
PreferredIntentResolver preferredintentresolver = (PreferredIntentResolver)mSettings.mPreferredActivities.valueAt(j); | |
if(i == -1 || i == k) | |
{ | |
Iterator iterator = preferredintentresolver.filterIterator(); | |
do | |
{ | |
if(!iterator.hasNext()) | |
break; | |
PreferredActivity preferredactivity = (PreferredActivity)iterator.next(); | |
if(preferredactivity.mPref.mComponent.getPackageName().equals(s)) | |
{ | |
if(arraylist == null) | |
arraylist = new ArrayList(); | |
arraylist.add(preferredactivity); | |
} | |
} while(true); | |
if(arraylist != null) | |
{ | |
for(int l = 0; l < arraylist.size(); l++) | |
{ | |
preferredintentresolver.removeFilter((PreferredActivity)arraylist.get(l)); | |
if(s.equals("com.skt.tmode")) | |
{ | |
android.provider.Settings.System.putString(mContext.getContentResolver(), "t_entry_mode", "false"); | |
Log.i("PackageManager", "Setting t_entry_mode DB -> false"); | |
} | |
} | |
flag = true; | |
mSettings.writePackageRestrictionsLPr(k); | |
} | |
} | |
j++; | |
} | |
return flag; | |
} | |
void createNewUserLILPw(int i, File file) | |
{ | |
if(mInstaller != null) | |
mSettings.createNewUserLILPw(mInstaller, i, file); | |
} | |
public String[] currentToCanonicalPackageNames(String as[]) | |
{ | |
String as1[] = new String[as.length]; | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
int i = -1 + as.length; | |
_L3: | |
if(i < 0) | |
break MISSING_BLOCK_LABEL_84; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(as[i]); | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_75; | |
String s; | |
if(((PackageSettingBase) (packagesetting)).realName == null) | |
break MISSING_BLOCK_LABEL_75; | |
s = ((PackageSettingBase) (packagesetting)).realName; | |
_L1: | |
as1[i] = s; | |
i--; | |
continue; /* Loop/switch isn't completed */ | |
s = as[i]; | |
goto _L1 | |
hashmap; | |
JVM INSTR monitorexit ; | |
return as1; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
if(true) goto _L3; else goto _L2 | |
_L2: | |
} | |
public void deleteApplicationCacheFiles(final String packageName, final IPackageDataObserver observer) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.DELETE_CACHE_FILES", null); | |
final int userId = UserHandle.getCallingUserId(); | |
mHandler.post(new Runnable() { | |
public void run() | |
{ | |
boolean flag; | |
mHandler.removeCallbacks(this); | |
synchronized(mInstallLock) | |
{ | |
flag = deleteApplicationCacheFilesLI(packageName, userId); | |
} | |
clearExternalStorageDataSync(packageName, userId, false); | |
if(observer == null) | |
break MISSING_BLOCK_LABEL_76; | |
observer.onRemoveCompleted(packageName, flag); | |
return; | |
exception; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception; | |
RemoteException remoteexception; | |
remoteexception; | |
Log.i("PackageManager", "Observer no longer exists."); | |
return; | |
} | |
final PackageManagerService this$0; | |
final IPackageDataObserver val$observer; | |
final String val$packageName; | |
final int val$userId; | |
{ | |
this$0 = PackageManagerService.this; | |
packageName = s; | |
userId = i; | |
observer = ipackagedataobserver; | |
super(); | |
} | |
} | |
); | |
} | |
public void deletePackage(final String packageName, final IPackageDeleteObserver observer, final int flags) | |
{ | |
if(!ThreelmMdmConfig.THREELM_MDM) | |
break MISSING_BLOCK_LABEL_32; | |
if(mDeviceManager.checkAppUninstallPolicies(packageName)) | |
break MISSING_BLOCK_LABEL_32; | |
if(observer == null) | |
break MISSING_BLOCK_LABEL_29; | |
observer.packageDeleted(packageName, -1); | |
return; | |
RemoteException remoteexception; | |
remoteexception; | |
int i = -1; | |
final int uid; | |
try | |
{ | |
if(ConfigBuildFlags.CAPP_UPLUSAPI) | |
i = mContext.getPackageManager().getApplicationInfo("com.lguplus.common", 0).uid; | |
} | |
catch(android.content.pm.PackageManager.NameNotFoundException namenotfoundexception) { } | |
if(!ConfigBuildFlags.CAPP_UPLUSAPI || Binder.getCallingUid() != i) | |
mContext.enforceCallingOrSelfPermission("android.permission.DELETE_PACKAGES", null); | |
uid = Binder.getCallingUid(); | |
mHandler.post(new Runnable() { | |
public void run() | |
{ | |
int j; | |
mHandler.removeCallbacks(this); | |
j = deletePackageX(packageName, uid, flags); | |
if(1 == j) | |
{ | |
DeviceStorageMonitorService devicestoragemonitorservice = (DeviceStorageMonitorService)ServiceManager.getService("devicestoragemonitor"); | |
if(devicestoragemonitorservice != null) | |
devicestoragemonitorservice.updateMemory(); | |
} | |
if(observer == null) | |
break MISSING_BLOCK_LABEL_77; | |
observer.packageDeleted(packageName, j); | |
return; | |
RemoteException remoteexception1; | |
remoteexception1; | |
Log.i("PackageManager", "Observer no longer exists."); | |
return; | |
} | |
final PackageManagerService this$0; | |
final int val$flags; | |
final IPackageDeleteObserver val$observer; | |
final String val$packageName; | |
final int val$uid; | |
{ | |
this$0 = PackageManagerService.this; | |
packageName = s; | |
uid = i; | |
flags = j; | |
observer = ipackagedeleteobserver; | |
super(); | |
} | |
} | |
); | |
return; | |
} | |
protected void dump(FileDescriptor filedescriptor, PrintWriter printwriter, String as[]) | |
{ | |
DumpState dumpstate; | |
int i; | |
if(mContext.checkCallingOrSelfPermission("android.permission.DUMP") != 0) | |
{ | |
printwriter.println((new StringBuilder()).append("Permission Denial: can't dump ActivityManager from from pid=").append(Binder.getCallingPid()).append(", uid=").append(Binder.getCallingUid()).append(" without permission ").append("android.permission.DUMP").toString()); | |
return; | |
} | |
dumpstate = new DumpState(); | |
i = 0; | |
_L5: | |
int j = as.length; | |
if(i >= j) goto _L2; else goto _L1 | |
_L1: | |
String s9 = as[i]; | |
if(s9 != null && s9.length() > 0 && s9.charAt(0) == '-') goto _L3; else goto _L2 | |
_L2: | |
String s; | |
HashMap hashmap; | |
String s8; | |
int k = as.length; | |
int l = i; | |
s = null; | |
if(l < k) | |
{ | |
s8 = as[i]; | |
i + 1; | |
Exception exception; | |
Iterator iterator; | |
String s7; | |
if("android".equals(s8) || s8.contains(".")) | |
{ | |
s = s8; | |
} else | |
{ | |
label0: | |
{ | |
if(!"l".equals(s8) && !"libraries".equals(s8)) | |
break label0; | |
dumpstate.setDump(1); | |
s = null; | |
} | |
} | |
} | |
_L7: | |
hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
if(!dumpstate.isDumping(256) || s != null) | |
break MISSING_BLOCK_LABEL_261; | |
if(dumpstate.onTitlePrinted()) | |
printwriter.println(" "); | |
printwriter.println("Verifiers:"); | |
printwriter.print(" Required: "); | |
printwriter.print(mRequiredVerifierPackage); | |
printwriter.print(" (uid="); | |
printwriter.print(getPackageUid(mRequiredVerifierPackage, 0)); | |
printwriter.println(")"); | |
if(!dumpstate.isDumping(1) || s != null) | |
break MISSING_BLOCK_LABEL_961; | |
if(dumpstate.onTitlePrinted()) | |
printwriter.println(" "); | |
printwriter.println("Libraries:"); | |
for(iterator = mSharedLibraries.keySet().iterator(); iterator.hasNext(); printwriter.println((String)mSharedLibraries.get(s7))) | |
{ | |
s7 = (String)iterator.next(); | |
printwriter.print(" "); | |
printwriter.print(s7); | |
printwriter.print(" -> "); | |
} | |
break MISSING_BLOCK_LABEL_961; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L3: | |
i++; | |
if(!"-a".equals(s9)) | |
{ | |
if("-h".equals(s9)) | |
{ | |
printwriter.println("Package manager dump options:"); | |
printwriter.println(" [-h] [-f] [cmd] ..."); | |
printwriter.println(" -f: print details of intent filters"); | |
printwriter.println(" -h: print this help"); | |
printwriter.println(" cmd may be one of:"); | |
printwriter.println(" l[ibraries]: list known shared libraries"); | |
printwriter.println(" f[ibraries]: list device features"); | |
printwriter.println(" r[esolvers]: dump intent resolvers"); | |
printwriter.println(" perm[issions]: dump permissions"); | |
printwriter.println(" pref[erred]: print preferred package settings"); | |
printwriter.println(" preferred-xml: print preferred package settings as xml"); | |
printwriter.println(" prov[iders]: dump content providers"); | |
printwriter.println(" p[ackages]: dump installed packages"); | |
printwriter.println(" s[hared-users]: dump shared user IDs"); | |
printwriter.println(" m[essages]: print collected runtime messages"); | |
printwriter.println(" v[erifiers]: print package verifier info"); | |
printwriter.println(" <package.name>: info about given package"); | |
return; | |
} | |
if("-f".equals(s9)) | |
dumpstate.setOptionEnabled(1); | |
else | |
printwriter.println((new StringBuilder()).append("Unknown argument: ").append(s9).append("; use -h for help").toString()); | |
} | |
if(true) goto _L5; else goto _L4 | |
_L4: | |
label1: | |
{ | |
if(!"f".equals(s8) && !"features".equals(s8)) | |
break label1; | |
dumpstate.setDump(2); | |
s = null; | |
} | |
if(true) goto _L7; else goto _L6 | |
_L6: | |
label2: | |
{ | |
if(!"r".equals(s8) && !"resolvers".equals(s8)) | |
break label2; | |
dumpstate.setDump(4); | |
s = null; | |
} | |
if(true) goto _L7; else goto _L8 | |
_L8: | |
label3: | |
{ | |
if(!"perm".equals(s8) && !"permissions".equals(s8)) | |
break label3; | |
dumpstate.setDump(8); | |
s = null; | |
} | |
if(true) goto _L7; else goto _L9 | |
_L9: | |
label4: | |
{ | |
if(!"pref".equals(s8) && !"preferred".equals(s8)) | |
break label4; | |
dumpstate.setDump(512); | |
s = null; | |
} | |
if(true) goto _L7; else goto _L10 | |
_L10: | |
label5: | |
{ | |
if(!"preferred-xml".equals(s8)) | |
break label5; | |
dumpstate.setDump(1024); | |
s = null; | |
} | |
if(true) goto _L7; else goto _L11 | |
_L11: | |
label6: | |
{ | |
if(!"p".equals(s8) && !"packages".equals(s8)) | |
break label6; | |
dumpstate.setDump(16); | |
s = null; | |
} | |
if(true) goto _L7; else goto _L12 | |
_L12: | |
label7: | |
{ | |
if(!"s".equals(s8) && !"shared-users".equals(s8)) | |
break label7; | |
dumpstate.setDump(32); | |
s = null; | |
} | |
if(true) goto _L7; else goto _L13 | |
_L13: | |
label8: | |
{ | |
if(!"prov".equals(s8) && !"providers".equals(s8)) | |
break label8; | |
dumpstate.setDump(128); | |
s = null; | |
} | |
if(true) goto _L7; else goto _L14 | |
_L14: | |
label9: | |
{ | |
if(!"m".equals(s8) && !"messages".equals(s8)) | |
break label9; | |
dumpstate.setDump(64); | |
s = null; | |
} | |
if(true) goto _L7; else goto _L15 | |
_L15: | |
if("v".equals(s8)) goto _L17; else goto _L16 | |
_L16: | |
boolean flag2; | |
flag2 = "verifiers".equals(s8); | |
s = null; | |
if(!flag2) goto _L7; else goto _L17 | |
_L17: | |
dumpstate.setDump(256); | |
s = null; | |
goto _L7 | |
if(!dumpstate.isDumping(2) || s != null) | |
break MISSING_BLOCK_LABEL_1049; | |
if(dumpstate.onTitlePrinted()) | |
printwriter.println(" "); | |
printwriter.println("Features:"); | |
String s6; | |
for(Iterator iterator1 = mAvailableFeatures.keySet().iterator(); iterator1.hasNext(); printwriter.println(s6)) | |
{ | |
s6 = (String)iterator1.next(); | |
printwriter.print(" "); | |
} | |
ActivityIntentResolver activityintentresolver; | |
if(!dumpstate.isDumping(4)) | |
break MISSING_BLOCK_LABEL_1199; | |
activityintentresolver = mActivities; | |
int i1; | |
int j1; | |
PreferredIntentResolver preferredintentresolver; | |
int k1; | |
String s1; | |
boolean flag; | |
Iterator iterator2; | |
boolean flag1; | |
Iterator iterator3; | |
File file; | |
FileInputStream fileinputstream; | |
FileInputStream fileinputstream1; | |
FileNotFoundException filenotfoundexception; | |
IOException ioexception1; | |
FileInputStream fileinputstream2; | |
Exception exception1; | |
FileNotFoundException filenotfoundexception1; | |
java.util.Map.Entry entry; | |
android.content.pm.PackageParser.Provider provider; | |
android.content.pm.PackageParser.Provider provider1; | |
BufferedOutputStream bufferedoutputstream; | |
FastXmlSerializer fastxmlserializer; | |
IOException ioexception4; | |
IllegalStateException illegalstateexception; | |
IllegalArgumentException illegalargumentexception; | |
String s3; | |
ActivityIntentResolver activityintentresolver1; | |
String s4; | |
ServiceIntentResolver serviceintentresolver; | |
String s5; | |
if(dumpstate.getTitlePrinted()) | |
s3 = "\nActivity Resolver Table:"; | |
else | |
s3 = "Activity Resolver Table:"; | |
if(activityintentresolver.dump(printwriter, s3, " ", s, dumpstate.isOptionEnabled(1))) | |
dumpstate.setTitlePrinted(true); | |
activityintentresolver1 = mReceivers; | |
if(dumpstate.getTitlePrinted()) | |
s4 = "\nReceiver Resolver Table:"; | |
else | |
s4 = "Receiver Resolver Table:"; | |
if(activityintentresolver1.dump(printwriter, s4, " ", s, dumpstate.isOptionEnabled(1))) | |
dumpstate.setTitlePrinted(true); | |
serviceintentresolver = mServices; | |
if(dumpstate.getTitlePrinted()) | |
s5 = "\nService Resolver Table:"; | |
else | |
s5 = "Service Resolver Table:"; | |
if(serviceintentresolver.dump(printwriter, s5, " ", s, dumpstate.isOptionEnabled(1))) | |
dumpstate.setTitlePrinted(true); | |
if(!dumpstate.isDumping(512)) goto _L19; else goto _L18 | |
_L18: | |
i1 = 0; | |
_L35: | |
j1 = mSettings.mPreferredActivities.size(); | |
if(i1 >= j1) goto _L19; else goto _L20 | |
_L20: | |
preferredintentresolver = (PreferredIntentResolver)mSettings.mPreferredActivities.valueAt(i1); | |
k1 = mSettings.mPreferredActivities.keyAt(i1); | |
if(!dumpstate.getTitlePrinted()) goto _L22; else goto _L21 | |
_L21: | |
s1 = (new StringBuilder()).append("\nPreferred Activities User ").append(k1).append(":").toString(); | |
_L24: | |
if(preferredintentresolver.dump(printwriter, s1, " ", s, dumpstate.isOptionEnabled(1))) | |
dumpstate.setTitlePrinted(true); | |
goto _L23 | |
_L22: | |
s1 = (new StringBuilder()).append("Preferred Activities User ").append(k1).append(":").toString(); | |
goto _L24 | |
_L19: | |
if(!dumpstate.isDumping(1024)) | |
break MISSING_BLOCK_LABEL_1467; | |
printwriter.flush(); | |
FileOutputStream fileoutputstream = new FileOutputStream(filedescriptor); | |
bufferedoutputstream = new BufferedOutputStream(fileoutputstream); | |
fastxmlserializer = new FastXmlSerializer(); | |
fastxmlserializer.setOutput(bufferedoutputstream, "utf-8"); | |
fastxmlserializer.startDocument(null, Boolean.valueOf(true)); | |
fastxmlserializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true); | |
mSettings.writePreferredActivitiesLPr(fastxmlserializer, 0); | |
fastxmlserializer.endDocument(); | |
fastxmlserializer.flush(); | |
_L28: | |
if(dumpstate.isDumping(8)) | |
mSettings.dumpPermissionsLPr(printwriter, s, dumpstate); | |
if(!dumpstate.isDumping(128)) | |
break MISSING_BLOCK_LABEL_1916; | |
flag = false; | |
iterator2 = mProvidersByComponent.values().iterator(); | |
_L27: | |
if(!iterator2.hasNext()) | |
break MISSING_BLOCK_LABEL_1722; | |
provider1 = (android.content.pm.PackageParser.Provider)iterator2.next(); | |
if(s == null) goto _L26; else goto _L25 | |
_L25: | |
if(!s.equals(((PackageItemInfo) (provider1.info)).packageName)) goto _L27; else goto _L26 | |
_L26: | |
if(flag) | |
break MISSING_BLOCK_LABEL_1590; | |
if(dumpstate.onTitlePrinted()) | |
printwriter.println(" "); | |
printwriter.println("Registered ContentProviders:"); | |
flag = true; | |
printwriter.print(" "); | |
printwriter.print(provider1.getComponentShortName()); | |
printwriter.println(":"); | |
printwriter.print(" "); | |
printwriter.println(provider1.toString()); | |
goto _L27 | |
illegalargumentexception; | |
printwriter.println((new StringBuilder()).append("Failed writing: ").append(illegalargumentexception).toString()); | |
goto _L28 | |
illegalstateexception; | |
printwriter.println((new StringBuilder()).append("Failed writing: ").append(illegalstateexception).toString()); | |
goto _L28 | |
ioexception4; | |
printwriter.println((new StringBuilder()).append("Failed writing: ").append(ioexception4).toString()); | |
goto _L28 | |
flag1 = false; | |
iterator3 = mProviders.entrySet().iterator(); | |
_L31: | |
if(!iterator3.hasNext()) | |
break MISSING_BLOCK_LABEL_1916; | |
entry = (java.util.Map.Entry)iterator3.next(); | |
provider = (android.content.pm.PackageParser.Provider)entry.getValue(); | |
if(s == null) goto _L30; else goto _L29 | |
_L29: | |
if(!s.equals(((PackageItemInfo) (provider.info)).packageName)) goto _L31; else goto _L30 | |
_L30: | |
if(flag1) | |
break MISSING_BLOCK_LABEL_1824; | |
if(dumpstate.onTitlePrinted()) | |
printwriter.println(" "); | |
printwriter.println("ContentProvider Authorities:"); | |
flag1 = true; | |
printwriter.print(" ["); | |
printwriter.print((String)entry.getKey()); | |
printwriter.println("]:"); | |
printwriter.print(" "); | |
printwriter.println(provider.toString()); | |
if(provider.info != null && ((ComponentInfo) (provider.info)).applicationInfo != null) | |
{ | |
String s2 = ((ComponentInfo) (provider.info)).applicationInfo.toString(); | |
printwriter.print(" applicationInfo="); | |
printwriter.println(s2); | |
} | |
goto _L31 | |
if(dumpstate.isDumping(16)) | |
mSettings.dumpPackagesLPr(printwriter, s, dumpstate); | |
if(dumpstate.isDumping(32)) | |
mSettings.dumpSharedUsersLPr(printwriter, s, dumpstate); | |
if(!dumpstate.isDumping(64) || s != null) | |
break MISSING_BLOCK_LABEL_2073; | |
if(dumpstate.onTitlePrinted()) | |
printwriter.println(" "); | |
mSettings.dumpReadMessagesLPr(printwriter, dumpstate); | |
printwriter.println(" "); | |
printwriter.println("Package warning messages:"); | |
file = getSettingsProblemFile(); | |
fileinputstream = null; | |
fileinputstream1 = new FileInputStream(file); | |
byte abyte0[] = new byte[fileinputstream1.available()]; | |
fileinputstream1.read(abyte0); | |
printwriter.print(new String(abyte0)); | |
if(fileinputstream1 == null) | |
break MISSING_BLOCK_LABEL_2073; | |
try | |
{ | |
fileinputstream1.close(); | |
} | |
catch(IOException ioexception) { } | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
exception1; | |
_L32: | |
if(fileinputstream == null) | |
break MISSING_BLOCK_LABEL_2089; | |
try | |
{ | |
fileinputstream.close(); | |
} | |
catch(IOException ioexception2) { } | |
throw exception1; | |
filenotfoundexception1; | |
_L34: | |
if(fileinputstream == null) | |
break MISSING_BLOCK_LABEL_2073; | |
fileinputstream.close(); | |
break MISSING_BLOCK_LABEL_2073; | |
_L33: | |
if(fileinputstream2 == null) | |
break MISSING_BLOCK_LABEL_2073; | |
fileinputstream2.close(); | |
break MISSING_BLOCK_LABEL_2073; | |
exception1; | |
fileinputstream = fileinputstream1; | |
goto _L32 | |
ioexception1; | |
fileinputstream2 = fileinputstream1; | |
goto _L33 | |
filenotfoundexception; | |
fileinputstream = fileinputstream1; | |
goto _L34 | |
_L23: | |
i1++; | |
goto _L35 | |
IOException ioexception3; | |
ioexception3; | |
fileinputstream2 = null; | |
goto _L33 | |
} | |
public void enterSafeMode() | |
{ | |
enforceSystemOrRoot("Only the system can request entering safe mode"); | |
if(!mSystemReady) | |
mSafeMode = true; | |
} | |
public void extendVerificationTimeout(int i, int j, long l) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.PACKAGE_VERIFICATION_AGENT", "Only package verification agents can extend verification timeouts"); | |
PackageVerificationState packageverificationstate = (PackageVerificationState)mPendingVerification.get(i); | |
PackageVerificationResponse packageverificationresponse = new PackageVerificationResponse(j, Binder.getCallingUid()); | |
if(l > 0x36ee80L) | |
l = 0x36ee80L; | |
if(l < 0L) | |
l = 0L; | |
if(j != 1) | |
if(j == -1); | |
if(packageverificationstate != null && !packageverificationstate.timeoutExtended()) | |
{ | |
packageverificationstate.extendTimeout(); | |
Message message = mHandler.obtainMessage(15); | |
message.arg1 = i; | |
message.obj = packageverificationresponse; | |
mHandler.sendMessageDelayed(message, l); | |
} | |
} | |
ResolveInfo findPreferredActivity(Intent intent, String s, int i, List list, int j, int k) | |
{ | |
if(!sUserManager.exists(k)) | |
return null; | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
PreferredIntentResolver preferredintentresolver; | |
if(intent.getSelector() != null) | |
intent = intent.getSelector(); | |
preferredintentresolver = (PreferredIntentResolver)mSettings.mPreferredActivities.get(k); | |
if(preferredintentresolver == null) goto _L2; else goto _L1 | |
_L1: | |
Exception exception; | |
List list1; | |
int l; | |
int i1; | |
int j1; | |
int k1; | |
int l1; | |
int i2; | |
PreferredActivity preferredactivity; | |
ActivityInfo activityinfo; | |
int j2; | |
ResolveInfo resolveinfo1; | |
boolean flag; | |
if((0x10000 & i) != 0) | |
flag = true; | |
else | |
flag = false; | |
list1 = preferredintentresolver.queryIntent(intent, s, flag, k); | |
_L16: | |
if(list1 == null) goto _L4; else goto _L3 | |
_L3: | |
if(list1.size() <= 0) goto _L4; else goto _L5 | |
_L5: | |
l = 0; | |
i1 = list.size(); | |
j1 = 0; | |
_L15: | |
if(j1 >= i1) goto _L7; else goto _L6 | |
_L6: | |
ResolveInfo resolveinfo = (ResolveInfo)list.get(j1); | |
if(resolveinfo.match > l) | |
l = resolveinfo.match; | |
goto _L8 | |
_L7: | |
k1 = l & 0xfff0000; | |
l1 = list1.size(); | |
i2 = 0; | |
_L17: | |
if(i2 >= l1) goto _L4; else goto _L9 | |
_L9: | |
preferredactivity = (PreferredActivity)list1.get(i2); | |
if(preferredactivity.mPref.mMatch == k1) goto _L11; else goto _L10 | |
_L11: | |
activityinfo = getActivityInfo(preferredactivity.mPref.mComponent, i | 0x200, k); | |
if(activityinfo != null) goto _L13; else goto _L12 | |
_L12: | |
Slog.w("PackageManager", (new StringBuilder()).append("Removing dangling preferred activity: ").append(preferredactivity.mPref.mComponent).toString()); | |
preferredintentresolver.removeFilter(preferredactivity); | |
goto _L10 | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L13: | |
j2 = 0; | |
_L18: | |
if(j2 >= i1) goto _L10; else goto _L14 | |
_L14: | |
resolveinfo1 = (ResolveInfo)list.get(j2); | |
if(!((PackageItemInfo) (((ComponentInfo) (resolveinfo1.activityInfo)).applicationInfo)).packageName.equals(((PackageItemInfo) (((ComponentInfo) (activityinfo)).applicationInfo)).packageName)) | |
break MISSING_BLOCK_LABEL_494; | |
if(!((PackageItemInfo) (resolveinfo1.activityInfo)).name.equals(((PackageItemInfo) (activityinfo)).name)) | |
break MISSING_BLOCK_LABEL_494; | |
if(preferredactivity.mPref.sameSet(list, j)) | |
break MISSING_BLOCK_LABEL_459; | |
Slog.i("PackageManager", (new StringBuilder()).append("Result set changed, dropping preferred activity for ").append(intent).append(" type ").append(s).toString()); | |
preferredintentresolver.removeFilter(preferredactivity); | |
if(preferredactivity.getCategory(0).equals("android.intent.category.HOME")) | |
{ | |
android.provider.Settings.System.putString(mContext.getContentResolver(), "t_entry_mode", "false"); | |
Log.i("PackageManager", "Setting t_entry_mode DB -> false"); | |
} | |
return null; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return resolveinfo1; | |
_L4: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
_L8: | |
j1++; | |
goto _L15 | |
_L2: | |
list1 = null; | |
goto _L16 | |
_L10: | |
i2++; | |
goto _L17 | |
j2++; | |
goto _L18 | |
} | |
public void finishPackageInstall(int i) | |
{ | |
enforceSystemOrRoot("Only the system is allowed to finish installs"); | |
Message message = mHandler.obtainMessage(9, i, 0); | |
mHandler.sendMessage(message); | |
} | |
public void freeStorage(final long freeStorageSize, final IntentSender pi) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.CLEAR_APP_CACHE", null); | |
mHandler.post(new Runnable() { | |
public void run() | |
{ | |
mHandler.removeCallbacks(this); | |
Object obj = mInstallLock; | |
obj; | |
JVM INSTR monitorenter ; | |
int i = mInstaller.freeCache(freeStorageSize); | |
if(i >= 0) | |
break MISSING_BLOCK_LABEL_48; | |
Slog.w("PackageManager", "Couldn't clear application caches"); | |
obj; | |
JVM INSTR monitorexit ; | |
if(pi == null) | |
break MISSING_BLOCK_LABEL_77; | |
Exception exception; | |
int j; | |
if(i >= 0) | |
j = 1; | |
else | |
j = 0; | |
pi.sendIntent(null, j, null, null, null); | |
return; | |
exception; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception; | |
android.content.IntentSender.SendIntentException sendintentexception; | |
sendintentexception; | |
Slog.i("PackageManager", "Failed to send pending intent"); | |
return; | |
} | |
final PackageManagerService this$0; | |
final long val$freeStorageSize; | |
final IntentSender val$pi; | |
{ | |
this$0 = PackageManagerService.this; | |
freeStorageSize = l; | |
pi = intentsender; | |
super(); | |
} | |
} | |
); | |
} | |
public void freeStorageAndNotify(final long freeStorageSize, final IPackageDataObserver observer) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.CLEAR_APP_CACHE", null); | |
mHandler.post(new Runnable() { | |
public void run() | |
{ | |
mHandler.removeCallbacks(this); | |
Object obj = mInstallLock; | |
obj; | |
JVM INSTR monitorenter ; | |
int i = mInstaller.freeCache(freeStorageSize); | |
if(i >= 0) | |
break MISSING_BLOCK_LABEL_48; | |
Slog.w("PackageManager", "Couldn't clear application caches"); | |
obj; | |
JVM INSTR monitorexit ; | |
if(observer == null) | |
break MISSING_BLOCK_LABEL_80; | |
Exception exception; | |
IPackageDataObserver ipackagedataobserver; | |
boolean flag; | |
try | |
{ | |
ipackagedataobserver = observer; | |
} | |
catch(RemoteException remoteexception) | |
{ | |
Slog.w("PackageManager", "RemoveException when invoking call back"); | |
return; | |
} | |
if(i >= 0) | |
flag = true; | |
else | |
flag = false; | |
ipackagedataobserver.onRemoveCompleted(null, flag); | |
return; | |
exception; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
final PackageManagerService this$0; | |
final long val$freeStorageSize; | |
final IPackageDataObserver val$observer; | |
{ | |
this$0 = PackageManagerService.this; | |
freeStorageSize = l; | |
observer = ipackagedataobserver; | |
super(); | |
} | |
} | |
); | |
} | |
PackageInfo generatePackageInfo(android.content.pm.PackageParser.Package package1, int i, int j) | |
{ | |
PackageInfo packageinfo; | |
if(!sUserManager.exists(j)) | |
{ | |
packageinfo = null; | |
} else | |
{ | |
PackageSetting packagesetting = (PackageSetting)package1.mExtras; | |
if(packagesetting == null) | |
return null; | |
Object obj; | |
PackageUserState packageuserstate; | |
if(packagesetting.sharedUser != null) | |
obj = packagesetting.sharedUser; | |
else | |
obj = packagesetting; | |
packageuserstate = packagesetting.readUserState(j); | |
packageinfo = PackageParser.generatePackageInfo(package1, ((GrantedPermissions) (obj)).gids, i, ((PackageSettingBase) (packagesetting)).firstInstallTime, ((PackageSettingBase) (packagesetting)).lastUpdateTime, ((GrantedPermissions) (obj)).grantedPermissions, packageuserstate, j); | |
if(packageinfo != null) | |
{ | |
packageinfo.applicationInfo.enabledSetting = packageuserstate.enabled; | |
ApplicationInfo applicationinfo = packageinfo.applicationInfo; | |
boolean flag; | |
if(packageinfo.applicationInfo.enabledSetting == 0 || packageinfo.applicationInfo.enabledSetting == 1) | |
flag = true; | |
else | |
flag = false; | |
applicationinfo.enabled = flag; | |
return packageinfo; | |
} | |
} | |
return packageinfo; | |
} | |
public ActivityInfo getActivityInfo(ComponentName componentname, int i, int j) | |
{ | |
if(!sUserManager.exists(j)) | |
return null; | |
enforceCrossUserPermission(Binder.getCallingUid(), j, false, "get activity info"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Activity activity = (android.content.pm.PackageParser.Activity)mActivities.mActivities.get(componentname); | |
if(activity == null) | |
break MISSING_BLOCK_LABEL_129; | |
PackageSetting packagesetting; | |
if(!mSettings.isEnabledLPr(activity.info, i, j)) | |
break MISSING_BLOCK_LABEL_129; | |
packagesetting = (PackageSetting)mSettings.mPackages.get(componentname.getPackageName()); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_108; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
ActivityInfo activityinfo1 = PackageParser.generateActivityInfo(activity, i, packagesetting.readUserState(j), j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return activityinfo1; | |
ActivityInfo activityinfo; | |
if(!mResolveComponentName.equals(componentname)) | |
break MISSING_BLOCK_LABEL_152; | |
activityinfo = mResolveActivity; | |
return activityinfo; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public List getAllPermissionGroups(int i) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
ArrayList arraylist; | |
arraylist = new ArrayList(mPermissionGroups.size()); | |
for(Iterator iterator = mPermissionGroups.values().iterator(); iterator.hasNext(); arraylist.add(PackageParser.generatePermissionGroupInfo((android.content.pm.PackageParser.PermissionGroup)iterator.next(), i))); | |
break MISSING_BLOCK_LABEL_75; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return arraylist; | |
} | |
public int getApplicationEnabledSetting(String s, int i) | |
{ | |
if(!sUserManager.exists(i)) | |
return 2; | |
enforceCrossUserPermission(Binder.getCallingUid(), i, false, "get enabled"); | |
int j; | |
synchronized(mPackages) | |
{ | |
j = mSettings.getApplicationEnabledSettingLPr(s, i); | |
} | |
return j; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public ApplicationInfo getApplicationInfo(String s, int i, int j) | |
{ | |
if(!sUserManager.exists(j)) | |
return null; | |
enforceCrossUserPermission(Binder.getCallingUid(), j, false, "get application info"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_106; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_85; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
ApplicationInfo applicationinfo = PackageParser.generateApplicationInfo(package1, i, packagesetting.readUserState(j), j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return applicationinfo; | |
ApplicationInfo applicationinfo1; | |
if(!"android".equals(s) && !"system".equals(s)) | |
break MISSING_BLOCK_LABEL_138; | |
applicationinfo1 = mAndroidApplication; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return applicationinfo1; | |
if((i & 0x2000) == 0) | |
break MISSING_BLOCK_LABEL_161; | |
ApplicationInfo applicationinfo2 = generateApplicationInfoFromSettingsLPw(s, i, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return applicationinfo2; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public int getComponentEnabledSetting(ComponentName componentname, int i) | |
{ | |
if(!sUserManager.exists(i)) | |
return 2; | |
enforceCrossUserPermission(Binder.getCallingUid(), i, false, "get component enabled"); | |
int j; | |
synchronized(mPackages) | |
{ | |
j = mSettings.getComponentEnabledSettingLPr(componentname, i); | |
} | |
return j; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
File getDataPathForUser(int i) | |
{ | |
return new File((new StringBuilder()).append(mUserAppDataDir.getAbsolutePath()).append(File.separator).append(i).toString()); | |
} | |
public int getInstallLocation() | |
{ | |
return android.provider.Settings.Global.getInt(mContext.getContentResolver(), "default_install_location", 0); | |
} | |
public ParceledListSlice getInstalledApplications(int i, String s, int j) | |
{ | |
String as[]; | |
int i1; | |
int j1; | |
String s1; | |
PackageSetting packagesetting; | |
ApplicationInfo applicationinfo; | |
if(!sUserManager.exists(j)) | |
return null; | |
ParceledListSlice parceledlistslice = new ParceledListSlice(); | |
boolean flag; | |
HashMap hashmap; | |
Exception exception; | |
int k; | |
int l; | |
if((i & 0x2000) != 0) | |
flag = true; | |
else | |
flag = false; | |
hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
if(!flag) goto _L2; else goto _L1 | |
_L1: | |
as = (String[])mSettings.mPackages.keySet().toArray(new String[mSettings.mPackages.size()]); | |
_L7: | |
Arrays.sort(as); | |
k = getContinuationPoint(as, s); | |
l = as.length; | |
i1 = k; | |
_L12: | |
if(i1 >= l) goto _L4; else goto _L3 | |
_L3: | |
j1 = i1 + 1; | |
s1 = as[i1]; | |
packagesetting = (PackageSetting)mSettings.mPackages.get(s1); | |
if(!flag) goto _L6; else goto _L5 | |
_L5: | |
applicationinfo = null; | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_164; | |
applicationinfo = generateApplicationInfoFromSettingsLPw(((PackageSettingBase) (packagesetting)).name, i, j); | |
_L9: | |
if(applicationinfo == null) | |
continue; /* Loop/switch isn't completed */ | |
if(!parceledlistslice.append(applicationinfo)) | |
continue; /* Loop/switch isn't completed */ | |
_L13: | |
if(j1 != l) | |
break MISSING_BLOCK_LABEL_192; | |
parceledlistslice.setLastSlice(true); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return parceledlistslice; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L2: | |
as = (String[])mPackages.keySet().toArray(new String[mPackages.size()]); | |
goto _L7 | |
_L6: | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
applicationinfo = null; | |
if(package1 == null) goto _L9; else goto _L8 | |
_L8: | |
applicationinfo = null; | |
if(packagesetting == null) goto _L9; else goto _L10 | |
_L10: | |
ApplicationInfo applicationinfo1 = PackageParser.generateApplicationInfo(package1, i, packagesetting.readUserState(j), j); | |
applicationinfo = applicationinfo1; | |
if(true) goto _L9; else goto _L11 | |
_L11: | |
i1 = j1; | |
goto _L12 | |
_L4: | |
j1 = i1; | |
goto _L13 | |
} | |
public ParceledListSlice getInstalledPackages(int i, String s, int j) | |
{ | |
int i1; | |
int j1; | |
ParceledListSlice parceledlistslice = new ParceledListSlice(); | |
boolean flag; | |
HashMap hashmap; | |
Exception exception; | |
String as[]; | |
int k; | |
int l; | |
String s1; | |
PackageSetting packagesetting; | |
PackageInfo packageinfo; | |
android.content.pm.PackageParser.Package package1; | |
if((i & 0x2000) != 0) | |
flag = true; | |
else | |
flag = false; | |
enforceCrossUserPermission(Binder.getCallingUid(), j, true, "get installed packages"); | |
hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
if(!flag) goto _L2; else goto _L1 | |
_L1: | |
as = (String[])mSettings.mPackages.keySet().toArray(new String[mSettings.mPackages.size()]); | |
_L7: | |
Arrays.sort(as); | |
k = getContinuationPoint(as, s); | |
l = as.length; | |
i1 = k; | |
_L11: | |
if(i1 >= l) goto _L4; else goto _L3 | |
_L3: | |
j1 = i1 + 1; | |
s1 = as[i1]; | |
if(!flag) goto _L6; else goto _L5 | |
_L5: | |
packagesetting = (PackageSetting)mSettings.mPackages.get(s1); | |
packageinfo = null; | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_164; | |
packageinfo = generatePackageInfoFromSettingsLPw(((PackageSettingBase) (packagesetting)).name, i, j); | |
_L9: | |
if(packageinfo == null) | |
break MISSING_BLOCK_LABEL_284; | |
if(!parceledlistslice.append(packageinfo)) | |
break MISSING_BLOCK_LABEL_284; | |
_L10: | |
if(j1 != l) | |
break MISSING_BLOCK_LABEL_192; | |
parceledlistslice.setLastSlice(true); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return parceledlistslice; | |
_L2: | |
as = (String[])mPackages.keySet().toArray(new String[mPackages.size()]); | |
goto _L7 | |
_L6: | |
package1 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
packageinfo = null; | |
if(package1 == null) goto _L9; else goto _L8 | |
_L8: | |
packageinfo = generatePackageInfo(package1, i, j); | |
goto _L9 | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L4: | |
j1 = i1; | |
goto _L10 | |
i1 = j1; | |
goto _L11 | |
} | |
public String getInstallerPackageName(String s) | |
{ | |
String s1; | |
synchronized(mPackages) | |
{ | |
s1 = mSettings.getInstallerPackageNameLPr(s); | |
} | |
return s1; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public InstrumentationInfo getInstrumentationInfo(ComponentName componentname, int i) | |
{ | |
InstrumentationInfo instrumentationinfo; | |
synchronized(mPackages) | |
{ | |
instrumentationinfo = PackageParser.generateInstrumentationInfo((android.content.pm.PackageParser.Instrumentation)mInstrumentation.get(componentname), i); | |
} | |
return instrumentationinfo; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public String getNameForUid(int i) | |
{ | |
Object obj; | |
label0: | |
{ | |
String s1; | |
synchronized(mPackages) | |
{ | |
obj = mSettings.getUserIdLPr(UserHandle.getAppId(i)); | |
if(!(obj instanceof SharedUserSetting)) | |
break label0; | |
SharedUserSetting sharedusersetting = (SharedUserSetting)obj; | |
s1 = (new StringBuilder()).append(sharedusersetting.name).append(":").append(sharedusersetting.userId).toString(); | |
} | |
return s1; | |
} | |
String s; | |
if(!(obj instanceof PackageSetting)) | |
break MISSING_BLOCK_LABEL_102; | |
s = ((PackageSettingBase) ((PackageSetting)obj)).name; | |
return s; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public String getOverlayPath(String s) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = null; | |
Iterator iterator = mPackages.keySet().iterator(); | |
_L2: | |
boolean flag = iterator.hasNext(); | |
boolean flag1; | |
flag1 = false; | |
if(!flag) | |
break MISSING_BLOCK_LABEL_97; | |
String s1 = (String)iterator.next(); | |
package1 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
if(package1 == null) goto _L2; else goto _L1 | |
_L1: | |
if(!s.equals(package1.mScanPath)) goto _L2; else goto _L3 | |
_L3: | |
String s2 = package1.mOverlayPath; | |
flag1 = false; | |
if(s2 != null) | |
flag1 = true; | |
if(flag1) | |
break MISSING_BLOCK_LABEL_106; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
String s3 = package1.mOverlayPath; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return s3; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public int[] getPackageGids(String s) | |
{ | |
boolean flag = isPermissionEnforcedDefault("android.permission.READ_EXTERNAL_STORAGE"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_147; | |
PackageSetting packagesetting; | |
SharedUserSetting sharedusersetting; | |
packagesetting = (PackageSetting)package1.mExtras; | |
sharedusersetting = packagesetting.sharedUser; | |
if(sharedusersetting == null) | |
break MISSING_BLOCK_LABEL_125; | |
int ai[] = ((GrantedPermissions) (sharedusersetting)).gids; | |
_L1: | |
int ai1[]; | |
if(!isPermissionEnforcedLocked("android.permission.READ_EXTERNAL_STORAGE", flag)) | |
ai = appendInts(ai, ((BasePermission)mSettings.mPermissions.get("android.permission.READ_EXTERNAL_STORAGE")).gids); | |
if(!ConfigBuildFlags.CAPP_UPLUSAPI) | |
break MISSING_BLOCK_LABEL_135; | |
ai1 = appendInts(ai, mLguplusPermissions.getGids(s)); | |
return ai1; | |
ai = ((GrantedPermissions) (packagesetting)).gids; | |
goto _L1 | |
hashmap; | |
JVM INSTR monitorexit ; | |
return ai; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return new int[0]; | |
} | |
public PackageInfo getPackageInfo(String s, int i, int j) | |
{ | |
if(!sUserManager.exists(j)) | |
return null; | |
enforceCrossUserPermission(Binder.getCallingUid(), j, false, "get package info"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_75; | |
PackageInfo packageinfo = generatePackageInfo(package1, i, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return packageinfo; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
if((i & 0x2000) == 0) | |
break MISSING_BLOCK_LABEL_98; | |
PackageInfo packageinfo1 = generatePackageInfoFromSettingsLPw(s, i, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return packageinfo1; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public void getPackageSizeInfo(String s, int i, IPackageStatsObserver ipackagestatsobserver) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.GET_PACKAGE_SIZE", null); | |
PackageStats packagestats = new PackageStats(s, i); | |
Message message = mHandler.obtainMessage(5); | |
message.obj = new MeasureParams(packagestats, ipackagestatsobserver); | |
mHandler.sendMessage(message); | |
} | |
public int getPackageUid(String s, int i) | |
{ | |
int j; | |
j = -1; | |
if(!sUserManager.exists(i)) | |
return j; | |
enforceCrossUserPermission(Binder.getCallingUid(), i, false, "get package uid"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_81; | |
int k = UserHandle.getUid(i, package1.applicationInfo.uid); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return k; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s); | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_121; | |
if(packagesetting.pkg != null && packagesetting.pkg.applicationInfo != null) | |
break MISSING_BLOCK_LABEL_126; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return j; | |
android.content.pm.PackageParser.Package package2 = packagesetting.pkg; | |
if(package2 == null) | |
break MISSING_BLOCK_LABEL_151; | |
j = UserHandle.getUid(i, package2.applicationInfo.uid); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return j; | |
} | |
public String[] getPackagesForUid(int i) | |
{ | |
int j = UserHandle.getAppId(i); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
Object obj; | |
String as1[]; | |
Iterator iterator; | |
obj = mSettings.getUserIdLPr(j); | |
if(!(obj instanceof SharedUserSetting)) | |
break MISSING_BLOCK_LABEL_109; | |
SharedUserSetting sharedusersetting = (SharedUserSetting)obj; | |
as1 = new String[sharedusersetting.packages.size()]; | |
iterator = sharedusersetting.packages.iterator(); | |
int k = 0; | |
_L2: | |
if(!iterator.hasNext()) | |
break; /* Loop/switch isn't completed */ | |
int l = k + 1; | |
as1[k] = ((PackageSettingBase) ((PackageSetting)iterator.next())).name; | |
k = l; | |
if(true) goto _L2; else goto _L1 | |
_L1: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return as1; | |
String as[]; | |
if(!(obj instanceof PackageSetting)) | |
break MISSING_BLOCK_LABEL_151; | |
PackageSetting packagesetting = (PackageSetting)obj; | |
as = new String[1]; | |
as[0] = ((PackageSettingBase) (packagesetting)).name; | |
return as; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public PermissionGroupInfo getPermissionGroupInfo(String s, int i) | |
{ | |
PermissionGroupInfo permissiongroupinfo; | |
synchronized(mPackages) | |
{ | |
permissiongroupinfo = PackageParser.generatePermissionGroupInfo((android.content.pm.PackageParser.PermissionGroup)mPermissionGroups.get(s), i); | |
} | |
return permissiongroupinfo; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public PermissionInfo getPermissionInfo(String s, int i) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
BasePermission basepermission = (BasePermission)mSettings.mPermissions.get(s); | |
if(basepermission == null) | |
break MISSING_BLOCK_LABEL_41; | |
PermissionInfo permissioninfo = generatePermissionInfo(basepermission, i); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return permissioninfo; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public List getPersistentApplications(int i) | |
{ | |
ArrayList arraylist = new ArrayList(); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
Iterator iterator; | |
int j; | |
iterator = mPackages.values().iterator(); | |
j = UserHandle.getCallingUserId(); | |
_L2: | |
android.content.pm.PackageParser.Package package1; | |
PackageSetting packagesetting; | |
do | |
{ | |
do | |
{ | |
if(!iterator.hasNext()) | |
break MISSING_BLOCK_LABEL_157; | |
package1 = (android.content.pm.PackageParser.Package)iterator.next(); | |
} while(package1.applicationInfo == null || (8 & package1.applicationInfo.flags) == 0 || mSafeMode && !isSystemApp(package1)); | |
packagesetting = (PackageSetting)mSettings.mPackages.get(package1.packageName); | |
} while(packagesetting == null); | |
ApplicationInfo applicationinfo = PackageParser.generateApplicationInfo(package1, i, packagesetting.readUserState(j), j); | |
if(applicationinfo == null) goto _L2; else goto _L1 | |
_L1: | |
arraylist.add(applicationinfo); | |
goto _L2 | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return arraylist; | |
} | |
public int getPreferredActivities(List list, List list1, String s) | |
{ | |
int i = UserHandle.getCallingUserId(); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
PreferredIntentResolver preferredintentresolver = (PreferredIntentResolver)mSettings.mPreferredActivities.get(i); | |
if(preferredintentresolver == null) | |
break MISSING_BLOCK_LABEL_137; | |
Iterator iterator = preferredintentresolver.filterIterator(); | |
_L3: | |
PreferredActivity preferredactivity; | |
if(!iterator.hasNext()) | |
break MISSING_BLOCK_LABEL_137; | |
preferredactivity = (PreferredActivity)iterator.next(); | |
if(s == null) goto _L2; else goto _L1 | |
_L1: | |
if(!preferredactivity.mPref.mComponent.getPackageName().equals(s)) goto _L3; else goto _L2 | |
_L2: | |
if(list == null) goto _L5; else goto _L4 | |
_L4: | |
list.add(new IntentFilter(preferredactivity)); | |
_L5: | |
if(list1 == null) goto _L3; else goto _L6 | |
_L6: | |
list1.add(preferredactivity.mPref.mComponent); | |
goto _L3 | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return 0; | |
} | |
public List getPreferredPackages(int i) | |
{ | |
return new ArrayList(); | |
} | |
public ProviderInfo getProviderInfo(ComponentName componentname, int i, int j) | |
{ | |
if(!sUserManager.exists(j)) | |
return null; | |
enforceCrossUserPermission(Binder.getCallingUid(), j, false, "get provider info"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Provider provider = (android.content.pm.PackageParser.Provider)mProvidersByComponent.get(componentname); | |
if(provider == null) | |
break MISSING_BLOCK_LABEL_126; | |
PackageSetting packagesetting; | |
if(!mSettings.isEnabledLPr(provider.info, i, j)) | |
break MISSING_BLOCK_LABEL_126; | |
packagesetting = (PackageSetting)mSettings.mPackages.get(componentname.getPackageName()); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_105; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
ProviderInfo providerinfo = PackageParser.generateProviderInfo(provider, i, packagesetting.readUserState(j), j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return providerinfo; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public ActivityInfo getReceiverInfo(ComponentName componentname, int i, int j) | |
{ | |
if(!sUserManager.exists(j)) | |
return null; | |
enforceCrossUserPermission(Binder.getCallingUid(), j, false, "get receiver info"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Activity activity = (android.content.pm.PackageParser.Activity)mReceivers.mActivities.get(componentname); | |
if(activity == null) | |
break MISSING_BLOCK_LABEL_129; | |
PackageSetting packagesetting; | |
if(!mSettings.isEnabledLPr(activity.info, i, j)) | |
break MISSING_BLOCK_LABEL_129; | |
packagesetting = (PackageSetting)mSettings.mPackages.get(componentname.getPackageName()); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_108; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
ActivityInfo activityinfo = PackageParser.generateActivityInfo(activity, i, packagesetting.readUserState(j), j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return activityinfo; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public ServiceInfo getServiceInfo(ComponentName componentname, int i, int j) | |
{ | |
if(!sUserManager.exists(j)) | |
return null; | |
enforceCrossUserPermission(Binder.getCallingUid(), j, false, "get service info"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Service service = (android.content.pm.PackageParser.Service)mServices.mServices.get(componentname); | |
if(service == null) | |
break MISSING_BLOCK_LABEL_129; | |
PackageSetting packagesetting; | |
if(!mSettings.isEnabledLPr(service.info, i, j)) | |
break MISSING_BLOCK_LABEL_129; | |
packagesetting = (PackageSetting)mSettings.mPackages.get(componentname.getPackageName()); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_108; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
ServiceInfo serviceinfo = PackageParser.generateServiceInfo(service, i, packagesetting.readUserState(j), j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return serviceinfo; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public FeatureInfo[] getSystemAvailableFeatures() | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
Collection collection; | |
int i; | |
collection = mAvailableFeatures.values(); | |
i = collection.size(); | |
if(i <= 0) | |
break MISSING_BLOCK_LABEL_79; | |
FeatureInfo afeatureinfo[]; | |
afeatureinfo = new FeatureInfo[i + 1]; | |
collection.toArray(afeatureinfo); | |
FeatureInfo featureinfo = new FeatureInfo(); | |
featureinfo.reqGlEsVersion = SystemProperties.getInt("ro.opengles.version", 0); | |
afeatureinfo[i] = featureinfo; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return afeatureinfo; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public String[] getSystemSharedLibraryNames() | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
Set set; | |
int i; | |
set = mSharedLibraries.keySet(); | |
i = set.size(); | |
if(i <= 0) | |
break MISSING_BLOCK_LABEL_49; | |
String as[]; | |
as = new String[i]; | |
set.toArray(as); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return as; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public int getUidForSharedUser(String s) | |
{ | |
if(s == null) | |
return -1; | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
SharedUserSetting sharedusersetting = mSettings.getSharedUserLPw(s, 0, false); | |
if(sharedusersetting != null) | |
break MISSING_BLOCK_LABEL_39; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return -1; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
int i = sharedusersetting.userId; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return i; | |
} | |
public VerifierDeviceIdentity getVerifierDeviceIdentity() | |
throws RemoteException | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.PACKAGE_VERIFICATION_AGENT", "Only package verification agents can read the verifier device identity"); | |
VerifierDeviceIdentity verifierdeviceidentity; | |
synchronized(mPackages) | |
{ | |
verifierdeviceidentity = mSettings.getVerifierDeviceIdentityLPw(); | |
} | |
return verifierdeviceidentity; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public void grantPermission(String s, String s1) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.GRANT_REVOKE_PERMISSIONS", null); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 != null) | |
break MISSING_BLOCK_LABEL_71; | |
throw new IllegalArgumentException((new StringBuilder()).append("Unknown package: ").append(s).toString()); | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
BasePermission basepermission = (BasePermission)mSettings.mPermissions.get(s1); | |
if(basepermission != null) | |
break MISSING_BLOCK_LABEL_120; | |
throw new IllegalArgumentException((new StringBuilder()).append("Unknown permission: ").append(s).toString()); | |
PackageSetting packagesetting; | |
if(!package1.requestedPermissions.contains(s1)) | |
throw new SecurityException((new StringBuilder()).append("Package ").append(s).append(" has not requested permission ").append(s1).toString()); | |
if((0x20 & basepermission.protectionLevel) == 0) | |
throw new SecurityException((new StringBuilder()).append("Permission ").append(s1).append(" is not a development permission").toString()); | |
packagesetting = (PackageSetting)package1.mExtras; | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_233; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
Object obj; | |
if(packagesetting.sharedUser == null) | |
break MISSING_BLOCK_LABEL_296; | |
obj = packagesetting.sharedUser; | |
_L1: | |
if(((GrantedPermissions) (obj)).grantedPermissions.add(s1)) | |
{ | |
if(((PackageSettingBase) (packagesetting)).haveGids) | |
obj.gids = appendInts(((GrantedPermissions) (obj)).gids, basepermission.gids); | |
mSettings.writeLPr(); | |
} | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
obj = packagesetting; | |
goto _L1 | |
} | |
public boolean hasSystemFeature(String s) | |
{ | |
boolean flag; | |
synchronized(mPackages) | |
{ | |
flag = mAvailableFeatures.containsKey(s); | |
} | |
return flag; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public boolean hasSystemUidErrors() | |
{ | |
return mHasSystemUidErrors; | |
} | |
public int installExistingPackage(String s) | |
{ | |
int i; | |
long l; | |
mContext.enforceCallingOrSelfPermission("android.permission.INSTALL_PACKAGES", null); | |
i = UserHandle.getUserId(Binder.getCallingUid()); | |
l = Binder.clearCallingIdentity(); | |
Bundle bundle = new Bundle(1); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_72; | |
hashmap; | |
JVM INSTR monitorexit ; | |
Binder.restoreCallingIdentity(l); | |
return -3; | |
boolean flag = packagesetting.getInstalled(i); | |
boolean flag1; | |
flag1 = false; | |
if(flag) | |
break MISSING_BLOCK_LABEL_123; | |
packagesetting.setInstalled(true, i); | |
mSettings.writePackageRestrictionsLPr(i); | |
bundle.putInt("android.intent.extra.UID", UserHandle.getUid(i, packagesetting.appId)); | |
flag1 = true; | |
hashmap; | |
JVM INSTR monitorexit ; | |
if(!flag1) | |
break MISSING_BLOCK_LABEL_149; | |
sendPackageBroadcast("android.intent.action.PACKAGE_ADDED", s, bundle, null, null, new int[] { | |
i | |
}); | |
Binder.restoreCallingIdentity(l); | |
return 1; | |
Exception exception1; | |
exception1; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
Exception exception; | |
exception; | |
Binder.restoreCallingIdentity(l); | |
throw exception; | |
} | |
public void installPackage(Uri uri, IPackageInstallObserver ipackageinstallobserver, int i) | |
{ | |
installPackage(uri, ipackageinstallobserver, i, null); | |
} | |
public void installPackage(Uri uri, IPackageInstallObserver ipackageinstallobserver, int i, String s) | |
{ | |
installPackageWithVerification(uri, ipackageinstallobserver, i, s, null, null, null); | |
} | |
public void installPackageWithVerification(Uri uri, IPackageInstallObserver ipackageinstallobserver, int i, String s, Uri uri1, ManifestDigest manifestdigest, ContainerEncryptionParams containerencryptionparams) | |
{ | |
installPackageWithVerificationAndEncryption(uri, ipackageinstallobserver, i, s, new VerificationParams(uri1, null, null, -1, manifestdigest), containerencryptionparams); | |
} | |
public void installPackageWithVerificationAndEncryption(Uri uri, IPackageInstallObserver ipackageinstallobserver, int i, String s, VerificationParams verificationparams, ContainerEncryptionParams containerencryptionparams) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.INSTALL_PACKAGES", null); | |
int j = Binder.getCallingUid(); | |
UserHandle userhandle; | |
if((i & 0x40) != 0) | |
userhandle = UserHandle.ALL; | |
else | |
userhandle = new UserHandle(UserHandle.getUserId(j)); | |
if((0x10000000 & i) != 0 && j == 2000) | |
throw new SecurityException((new StringBuilder()).append("User ").append(j).append(" does not have a permission for this flag: ").append(0x10000000).toString()); | |
int k; | |
Message message; | |
if(j == 2000 || j == 0) | |
k = i | 0x20; | |
else | |
k = i & 0xffffffdf; | |
verificationparams.setInstallerUid(j); | |
message = mHandler.obtainMessage(5); | |
message.obj = new InstallParams(uri, ipackageinstallobserver, k, s, Integer.toString(j), verificationparams, containerencryptionparams, userhandle); | |
mHandler.sendMessage(message); | |
} | |
public boolean isFirstBoot() | |
{ | |
return !mRestoredSettings; | |
} | |
public boolean isOnlyCoreApps() | |
{ | |
return mOnlyCore; | |
} | |
public boolean isPermissionEnforced(String s) | |
{ | |
boolean flag = isPermissionEnforcedDefault(s); | |
boolean flag1; | |
synchronized(mPackages) | |
{ | |
flag1 = isPermissionEnforcedLocked(s, flag); | |
} | |
return flag1; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public boolean isProtectedBroadcast(String s) | |
{ | |
boolean flag; | |
synchronized(mPackages) | |
{ | |
flag = mProtectedBroadcasts.contains(s); | |
} | |
return flag; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public boolean isSafeMode() | |
{ | |
return mSafeMode; | |
} | |
public boolean isStorageLow() | |
{ | |
long l = Binder.clearCallingIdentity(); | |
boolean flag = ((DeviceStorageMonitorService)ServiceManager.getService("devicestoragemonitor")).isMemoryLow(); | |
Binder.restoreCallingIdentity(l); | |
return flag; | |
Exception exception; | |
exception; | |
Binder.restoreCallingIdentity(l); | |
throw exception; | |
} | |
public void movePackage(String s, IPackageMoveObserver ipackagemoveobserver, int i) | |
{ | |
UserHandle userhandle; | |
byte byte0; | |
int j; | |
int k; | |
mContext.enforceCallingOrSelfPermission("android.permission.MOVE_PACKAGE", null); | |
userhandle = new UserHandle(UserHandle.getCallingUserId()); | |
byte0 = 1; | |
j = 0; | |
k = 0; | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 != null) goto _L2; else goto _L1 | |
_L1: | |
byte0 = -2; | |
_L3: | |
if(byte0 == 1) | |
break MISSING_BLOCK_LABEL_279; | |
processPendingMove(new MoveParams(null, ipackagemoveobserver, 0, s, null, -1, userhandle), byte0); | |
_L11: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
_L2: | |
if(package1.applicationInfo == null || !isSystemApp(package1)) | |
break MISSING_BLOCK_LABEL_133; | |
Slog.w("PackageManager", "Cannot move system application"); | |
byte0 = -3; | |
j = 0; | |
k = 0; | |
goto _L3 | |
if(!package1.mOperationPending) | |
break MISSING_BLOCK_LABEL_163; | |
Slog.w("PackageManager", "Attempt to move package which has pending operations"); | |
byte0 = -7; | |
j = 0; | |
k = 0; | |
goto _L3 | |
if((i & 2) == 0 || (i & 1) == 0) goto _L5; else goto _L4 | |
_L4: | |
Slog.w("PackageManager", "Ambigous flags specified for move location."); | |
byte0 = -5; | |
_L9: | |
if(byte0 != 1) goto _L3; else goto _L6 | |
_L6: | |
package1.mOperationPending = true; | |
goto _L3 | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L5: | |
if((i & 2) != 0) | |
k = 8; | |
else | |
k = 16; | |
if(isExternal(package1)) | |
j = 8; | |
else | |
j = 16; | |
if(k != j) goto _L8; else goto _L7 | |
_L7: | |
Slog.w("PackageManager", "No move required. Trying to move to same location"); | |
byte0 = -5; | |
goto _L9 | |
_L8: | |
if(!isForwardLocked(package1)) goto _L9; else goto _L10 | |
_L10: | |
j |= 1; | |
k |= 1; | |
goto _L9 | |
Message message = mHandler.obtainMessage(5); | |
InstallArgs installargs = createInstallArgs(j, package1.applicationInfo.sourceDir, package1.applicationInfo.publicSourceDir, package1.applicationInfo.nativeLibraryDir); | |
String s1 = package1.applicationInfo.dataDir; | |
int l = package1.applicationInfo.uid; | |
message.obj = new MoveParams(installargs, ipackagemoveobserver, k, s, s1, l, userhandle); | |
mHandler.sendMessage(message); | |
goto _L11 | |
} | |
public PackageCleanItem nextPackageToClean(PackageCleanItem packagecleanitem) | |
{ | |
label0: | |
{ | |
synchronized(mPackages) | |
{ | |
if(isExternalMediaAvailable()) | |
break label0; | |
} | |
return null; | |
} | |
ArrayList arraylist = mSettings.mPackagesToBeCleaned; | |
if(packagecleanitem == null) | |
break MISSING_BLOCK_LABEL_38; | |
arraylist.remove(packagecleanitem); | |
PackageCleanItem packagecleanitem1; | |
if(arraylist.size() <= 0) | |
break MISSING_BLOCK_LABEL_67; | |
packagecleanitem1 = (PackageCleanItem)arraylist.get(0); | |
return packagecleanitem1; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public boolean onTransact(int i, Parcel parcel, Parcel parcel1, int j) | |
throws RemoteException | |
{ | |
boolean flag; | |
try | |
{ | |
flag = super.onTransact(i, parcel, parcel1, j); | |
} | |
catch(RuntimeException runtimeexception) | |
{ | |
if(!(runtimeexception instanceof SecurityException) && !(runtimeexception instanceof IllegalArgumentException)) | |
Slog.e("PackageManager", "Package Manager Crash", runtimeexception); | |
throw runtimeexception; | |
} | |
return flag; | |
} | |
public void performBootDexOpt() | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
int i = mDeferredDexOpt.size(); | |
ArrayList arraylist; | |
arraylist = null; | |
if(i <= 0) | |
break MISSING_BLOCK_LABEL_46; | |
ArrayList arraylist1 = new ArrayList(mDeferredDexOpt); | |
mDeferredDexOpt.clear(); | |
arraylist = arraylist1; | |
hashmap; | |
JVM INSTR monitorexit ; | |
goto _L1 | |
Exception exception; | |
exception; | |
_L3: | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
exception1; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
_L1: | |
if(arraylist != null) | |
{ | |
int j = 0; | |
while(j < arraylist.size()) | |
{ | |
android.content.pm.PackageParser.Package package1; | |
if(!isFirstBoot()) | |
try | |
{ | |
IActivityManager iactivitymanager = ActivityManagerNative.getDefault(); | |
Resources resources = mContext.getResources(); | |
Object aobj[] = new Object[2]; | |
aobj[0] = Integer.valueOf(j + 1); | |
aobj[1] = Integer.valueOf(arraylist.size()); | |
iactivitymanager.showBootMessage(resources.getString(0x1040413, aobj), true); | |
} | |
catch(RemoteException remoteexception) { } | |
package1 = (android.content.pm.PackageParser.Package)arraylist.get(j); | |
synchronized(mInstallLock) | |
{ | |
if(!package1.mDidDexOpt) | |
performDexOptLI(package1, false, false); | |
} | |
j++; | |
} | |
} | |
return; | |
exception; | |
if(true) goto _L3; else goto _L2 | |
_L2: | |
} | |
public boolean performDexOpt(String s) | |
{ | |
enforceSystemOrRoot("Only the system can request dexopt be performed"); | |
if(!mNoDexOpt) | |
return false; | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_48; | |
if(!package1.mDidDexOpt) | |
break MISSING_BLOCK_LABEL_57; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return false; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
Object obj = mInstallLock; | |
obj; | |
JVM INSTR monitorenter ; | |
int i = performDexOptLI(package1, false, false); | |
boolean flag; | |
flag = false; | |
if(i == 1) | |
flag = true; | |
obj; | |
JVM INSTR monitorexit ; | |
return flag; | |
Exception exception1; | |
exception1; | |
obj; | |
JVM INSTR monitorexit ; | |
throw exception1; | |
} | |
public List queryContentProviders(String s, int i, int j) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
Iterator iterator = mProvidersByComponent.values().iterator(); | |
if(s == null) goto _L2; else goto _L1 | |
_L1: | |
int k = UserHandle.getUserId(i); | |
int l = k; | |
_L13: | |
Object obj = null; | |
_L16: | |
if(!iterator.hasNext()) goto _L4; else goto _L3 | |
_L3: | |
android.content.pm.PackageParser.Provider provider; | |
PackageSetting packagesetting; | |
provider = (android.content.pm.PackageParser.Provider)iterator.next(); | |
packagesetting = (PackageSetting)mSettings.mPackages.get(((android.content.pm.PackageParser.Component) (provider)).owner.packageName); | |
if(packagesetting == null) goto _L6; else goto _L5 | |
_L5: | |
if(provider.info.authority == null) goto _L6; else goto _L7 | |
_L7: | |
if(s == null) goto _L9; else goto _L8 | |
_L8: | |
if(!((ComponentInfo) (provider.info)).processName.equals(s) || !UserHandle.isSameApp(((ComponentInfo) (provider.info)).applicationInfo.uid, i)) goto _L6; else goto _L9 | |
_L9: | |
if(!mSettings.isEnabledLPr(provider.info, j, l) || mSafeMode && (1 & ((ComponentInfo) (provider.info)).applicationInfo.flags) == 0) goto _L6; else goto _L10 | |
_L10: | |
if(obj != null) goto _L12; else goto _L11 | |
_L11: | |
Object obj1 = new ArrayList(3); | |
_L15: | |
ProviderInfo providerinfo = PackageParser.generateProviderInfo(provider, j, packagesetting.readUserState(l), l); | |
if(providerinfo == null) | |
break MISSING_BLOCK_LABEL_285; | |
((ArrayList) (obj1)).add(providerinfo); | |
break MISSING_BLOCK_LABEL_285; | |
_L2: | |
int i1 = UserHandle.getCallingUserId(); | |
l = i1; | |
goto _L13 | |
_L4: | |
hashmap; | |
JVM INSTR monitorexit ; | |
if(obj != null) | |
Collections.sort(((List) (obj)), mProviderInitOrderSorter); | |
return ((List) (obj)); | |
Exception exception; | |
exception; | |
_L14: | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
exception; | |
obj; | |
if(true) goto _L14; else goto _L12 | |
_L12: | |
obj1 = obj; | |
goto _L15 | |
_L6: | |
obj1 = obj; | |
obj = obj1; | |
goto _L16 | |
} | |
public List queryInstrumentation(String s, int i) | |
{ | |
ArrayList arraylist = new ArrayList(); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
Iterator iterator = mInstrumentation.values().iterator(); | |
_L3: | |
android.content.pm.PackageParser.Instrumentation instrumentation; | |
if(!iterator.hasNext()) | |
break MISSING_BLOCK_LABEL_103; | |
instrumentation = (android.content.pm.PackageParser.Instrumentation)iterator.next(); | |
if(s == null) goto _L2; else goto _L1 | |
_L1: | |
if(!s.equals(instrumentation.info.targetPackage)) goto _L3; else goto _L2 | |
_L2: | |
InstrumentationInfo instrumentationinfo = PackageParser.generateInstrumentationInfo(instrumentation, i); | |
if(instrumentationinfo == null) goto _L3; else goto _L4 | |
_L4: | |
arraylist.add(instrumentationinfo); | |
goto _L3 | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return arraylist; | |
} | |
public List queryIntentActivities(Intent intent, String s, int i, int j) | |
{ | |
if(sUserManager.exists(j)) goto _L2; else goto _L1 | |
_L1: | |
Object obj = Collections.emptyList(); | |
_L4: | |
return ((List) (obj)); | |
_L2: | |
enforceCrossUserPermission(Binder.getCallingUid(), j, false, "query intent activities"); | |
ComponentName componentname = intent.getComponent(); | |
if(componentname == null && intent.getSelector() != null) | |
{ | |
intent = intent.getSelector(); | |
componentname = intent.getComponent(); | |
} | |
if(componentname == null) | |
break; /* Loop/switch isn't completed */ | |
obj = new ArrayList(1); | |
ActivityInfo activityinfo = getActivityInfo(componentname, i, j); | |
if(activityinfo != null) | |
{ | |
ResolveInfo resolveinfo = new ResolveInfo(); | |
resolveinfo.activityInfo = activityinfo; | |
((List) (obj)).add(resolveinfo); | |
return ((List) (obj)); | |
} | |
if(true) goto _L4; else goto _L3 | |
_L3: | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
String s1 = intent.getPackage(); | |
if(s1 != null) | |
break MISSING_BLOCK_LABEL_169; | |
List list = mActivities.queryIntent(intent, s, i, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return list; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_221; | |
List list1; | |
ActivityIntentResolver activityintentresolver = mActivities; | |
ArrayList arraylist = package1.activities; | |
list1 = activityintentresolver.queryIntentForPackage(intent, s, i, arraylist, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return list1; | |
ArrayList arraylist1 = new ArrayList(); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return arraylist1; | |
} | |
public List queryIntentActivityOptions(ComponentName componentname, Intent aintent[], String as[], Intent intent, String s, int i, int j) | |
{ | |
if(sUserManager.exists(j)) goto _L2; else goto _L1 | |
_L1: | |
List list = Collections.emptyList(); | |
_L10: | |
return list; | |
_L2: | |
String s1; | |
int k; | |
int k2; | |
enforceCrossUserPermission(Binder.getCallingUid(), j, false, "query intent activity options"); | |
s1 = intent.getAction(); | |
list = queryIntentActivities(intent, s, i | 0x40, j); | |
k = 0; | |
if(aintent == null) | |
break MISSING_BLOCK_LABEL_392; | |
k2 = 0; | |
_L4: | |
Intent intent1; | |
if(k2 >= aintent.length) | |
break MISSING_BLOCK_LABEL_392; | |
intent1 = aintent[k2]; | |
if(intent1 != null) | |
break; /* Loop/switch isn't completed */ | |
_L7: | |
k2++; | |
if(true) goto _L4; else goto _L3 | |
_L3: | |
String s3; | |
ComponentName componentname1; | |
s3 = intent1.getAction(); | |
if(s1 != null && s1.equals(s3)) | |
s3 = null; | |
componentname1 = intent1.getComponent(); | |
if(componentname1 != null) goto _L6; else goto _L5 | |
_L5: | |
ActivityInfo activityinfo1; | |
ResolveInfo resolveinfo2; | |
label0: | |
{ | |
int l2; | |
int i3; | |
ResolveInfo resolveinfo3; | |
String s4; | |
if(as != null) | |
s4 = as[k2]; | |
else | |
s4 = null; | |
resolveinfo2 = resolveIntent(intent1, s4, i, j); | |
if(resolveinfo2 != null) | |
{ | |
if(resolveinfo2 != mResolveInfo); | |
activityinfo1 = resolveinfo2.activityInfo; | |
componentname1 = new ComponentName(((PackageItemInfo) (((ComponentInfo) (activityinfo1)).applicationInfo)).packageName, ((PackageItemInfo) (activityinfo1)).name); | |
break label0; | |
} | |
} | |
goto _L7 | |
_L6: | |
activityinfo1 = getActivityInfo(componentname1, i, j); | |
resolveinfo2 = null; | |
if(activityinfo1 != null) goto _L8; else goto _L7 | |
_L8: | |
l2 = list.size(); | |
for(i3 = k; i3 < l2; i3++) | |
{ | |
resolveinfo3 = (ResolveInfo)list.get(i3); | |
if(((PackageItemInfo) (resolveinfo3.activityInfo)).name.equals(componentname1.getClassName()) && ((PackageItemInfo) (((ComponentInfo) (resolveinfo3.activityInfo)).applicationInfo)).packageName.equals(componentname1.getPackageName()) || s3 != null && resolveinfo3.filter.matchAction(s3)) | |
{ | |
list.remove(i3); | |
if(resolveinfo2 == null) | |
resolveinfo2 = resolveinfo3; | |
i3--; | |
l2--; | |
} | |
} | |
if(resolveinfo2 == null) | |
{ | |
resolveinfo2 = new ResolveInfo(); | |
resolveinfo2.activityInfo = activityinfo1; | |
} | |
list.add(k, resolveinfo2); | |
resolveinfo2.specificIndex = k2; | |
k++; | |
break; /* Loop/switch isn't completed */ | |
int l1; | |
int i2; | |
int l = list.size(); | |
int i1 = k; | |
while(i1 < l - 1) | |
{ | |
ResolveInfo resolveinfo = (ResolveInfo)list.get(i1); | |
if(resolveinfo.filter != null) | |
{ | |
Iterator iterator = resolveinfo.filter.actionsIterator(); | |
if(iterator != null) | |
{ | |
do | |
{ | |
if(!iterator.hasNext()) | |
break; | |
String s2 = (String)iterator.next(); | |
if(s1 == null || !s1.equals(s2)) | |
{ | |
int j2 = i1 + 1; | |
while(j2 < l) | |
{ | |
ResolveInfo resolveinfo1 = (ResolveInfo)list.get(j2); | |
if(resolveinfo1.filter != null && resolveinfo1.filter.hasAction(s2)) | |
{ | |
list.remove(j2); | |
j2--; | |
l--; | |
} | |
j2++; | |
} | |
} | |
} while(true); | |
if((i & 0x40) == 0) | |
resolveinfo.filter = null; | |
} | |
} | |
i1++; | |
} | |
if(componentname == null) | |
continue; /* Loop/switch isn't completed */ | |
l1 = list.size(); | |
i2 = 0; | |
_L11: | |
if(i2 >= l1) | |
continue; /* Loop/switch isn't completed */ | |
ActivityInfo activityinfo = ((ResolveInfo)list.get(i2)).activityInfo; | |
if(!componentname.getPackageName().equals(((PackageItemInfo) (((ComponentInfo) (activityinfo)).applicationInfo)).packageName) || !componentname.getClassName().equals(((PackageItemInfo) (activityinfo)).name)) | |
break MISSING_BLOCK_LABEL_713; | |
list.remove(i2); | |
if((i & 0x40) != 0) goto _L10; else goto _L9 | |
_L9: | |
int j1 = list.size(); | |
int k1 = 0; | |
while(k1 < j1) | |
{ | |
((ResolveInfo)list.get(k1)).filter = null; | |
k1++; | |
} | |
goto _L10 | |
i2++; | |
goto _L11 | |
} | |
public List queryIntentReceivers(Intent intent, String s, int i, int j) | |
{ | |
if(sUserManager.exists(j)) goto _L2; else goto _L1 | |
_L1: | |
Object obj = Collections.emptyList(); | |
_L4: | |
return ((List) (obj)); | |
_L2: | |
ComponentName componentname = intent.getComponent(); | |
if(componentname == null && intent.getSelector() != null) | |
{ | |
intent = intent.getSelector(); | |
componentname = intent.getComponent(); | |
} | |
if(componentname == null) | |
break; /* Loop/switch isn't completed */ | |
obj = new ArrayList(1); | |
ActivityInfo activityinfo = getReceiverInfo(componentname, i, j); | |
if(activityinfo != null) | |
{ | |
ResolveInfo resolveinfo = new ResolveInfo(); | |
resolveinfo.activityInfo = activityinfo; | |
((List) (obj)).add(resolveinfo); | |
return ((List) (obj)); | |
} | |
if(true) goto _L4; else goto _L3 | |
_L3: | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
String s1 = intent.getPackage(); | |
if(s1 != null) | |
break MISSING_BLOCK_LABEL_156; | |
List list = mReceivers.queryIntent(intent, s, i, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return list; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_208; | |
List list1; | |
ActivityIntentResolver activityintentresolver = mReceivers; | |
ArrayList arraylist = package1.receivers; | |
list1 = activityintentresolver.queryIntentForPackage(intent, s, i, arraylist, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return list1; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public List queryIntentServices(Intent intent, String s, int i, int j) | |
{ | |
if(sUserManager.exists(j)) goto _L2; else goto _L1 | |
_L1: | |
Object obj = Collections.emptyList(); | |
_L4: | |
return ((List) (obj)); | |
_L2: | |
ComponentName componentname = intent.getComponent(); | |
if(componentname == null && intent.getSelector() != null) | |
{ | |
intent = intent.getSelector(); | |
componentname = intent.getComponent(); | |
} | |
if(componentname == null) | |
break; /* Loop/switch isn't completed */ | |
obj = new ArrayList(1); | |
ServiceInfo serviceinfo = getServiceInfo(componentname, i, j); | |
if(serviceinfo != null) | |
{ | |
ResolveInfo resolveinfo = new ResolveInfo(); | |
resolveinfo.serviceInfo = serviceinfo; | |
((List) (obj)).add(resolveinfo); | |
return ((List) (obj)); | |
} | |
if(true) goto _L4; else goto _L3 | |
_L3: | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
String s1 = intent.getPackage(); | |
if(s1 != null) | |
break MISSING_BLOCK_LABEL_156; | |
List list = mServices.queryIntent(intent, s, i, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return list; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s1); | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_208; | |
List list1; | |
ServiceIntentResolver serviceintentresolver = mServices; | |
ArrayList arraylist = package1.services; | |
list1 = serviceintentresolver.queryIntentForPackage(intent, s, i, arraylist, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return list1; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return null; | |
} | |
public List queryPermissionsByGroup(String s, int i) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
ArrayList arraylist; | |
Iterator iterator; | |
arraylist = new ArrayList(10); | |
iterator = mSettings.mPermissions.values().iterator(); | |
_L4: | |
BasePermission basepermission; | |
if(!iterator.hasNext()) | |
break MISSING_BLOCK_LABEL_149; | |
basepermission = (BasePermission)iterator.next(); | |
if(s != null) goto _L2; else goto _L1 | |
_L1: | |
if(basepermission.perm != null && basepermission.perm.info.group != null) goto _L4; else goto _L3 | |
_L3: | |
arraylist.add(generatePermissionInfo(basepermission, i)); | |
goto _L4 | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L2: | |
if(basepermission.perm == null || !s.equals(basepermission.perm.info.group)) goto _L4; else goto _L5 | |
_L5: | |
arraylist.add(PackageParser.generatePermissionInfo(basepermission.perm, i)); | |
goto _L4 | |
if(arraylist.size() <= 0) | |
break MISSING_BLOCK_LABEL_162; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return arraylist; | |
if(!mPermissionGroups.containsKey(s)) | |
arraylist = null; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return arraylist; | |
} | |
public void querySyncProviders(List list, List list1) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
Iterator iterator; | |
int i; | |
iterator = mProviders.entrySet().iterator(); | |
i = UserHandle.getCallingUserId(); | |
_L2: | |
java.util.Map.Entry entry; | |
android.content.pm.PackageParser.Provider provider; | |
PackageSetting packagesetting; | |
do | |
{ | |
if(!iterator.hasNext()) | |
break MISSING_BLOCK_LABEL_174; | |
entry = (java.util.Map.Entry)iterator.next(); | |
provider = (android.content.pm.PackageParser.Provider)entry.getValue(); | |
packagesetting = (PackageSetting)mSettings.mPackages.get(((android.content.pm.PackageParser.Component) (provider)).owner.packageName); | |
} while(packagesetting == null); | |
if(!provider.syncable || mSafeMode && (1 & ((ComponentInfo) (provider.info)).applicationInfo.flags) == 0) goto _L2; else goto _L1 | |
_L1: | |
ProviderInfo providerinfo = PackageParser.generateProviderInfo(provider, 0, packagesetting.readUserState(i), i); | |
if(providerinfo == null) goto _L2; else goto _L3 | |
_L3: | |
list.add(entry.getKey()); | |
list1.add(providerinfo); | |
goto _L2 | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
} | |
void readPermission(XmlPullParser xmlpullparser, String s) | |
throws IOException, XmlPullParserException | |
{ | |
String s1 = s.intern(); | |
BasePermission basepermission = (BasePermission)mSettings.mPermissions.get(s1); | |
if(basepermission == null) | |
{ | |
basepermission = new BasePermission(s1, null, 1); | |
mSettings.mPermissions.put(s1, basepermission); | |
} | |
int i = xmlpullparser.getDepth(); | |
do | |
{ | |
int j = xmlpullparser.next(); | |
if(j == 1 || j == 3 && xmlpullparser.getDepth() <= i) | |
break; | |
if(j != 3 && j != 4) | |
{ | |
if("group".equals(xmlpullparser.getName())) | |
{ | |
String s2 = xmlpullparser.getAttributeValue(null, "gid"); | |
if(s2 != null) | |
{ | |
int k = Process.getGidForName(s2); | |
basepermission.gids = ArrayUtils.appendInt(basepermission.gids, k); | |
} else | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("<group> without gid at ").append(xmlpullparser.getPositionDescription()).toString()); | |
} | |
} | |
XmlUtils.skipCurrentTag(xmlpullparser); | |
} | |
} while(true); | |
} | |
void readPermissions() | |
{ | |
File file = new File(Environment.getRootDirectory(), "etc/permissions"); | |
if(!file.exists() || !file.isDirectory()) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("No directory ").append(file).append(", skipping").toString()); | |
return; | |
} | |
if(!file.canRead()) | |
{ | |
Slog.w("PackageManager", (new StringBuilder()).append("Directory ").append(file).append(" cannot be read").toString()); | |
return; | |
} | |
File afile[] = file.listFiles(); | |
int i = afile.length; | |
int j = 0; | |
while(j < i) | |
{ | |
File file1 = afile[j]; | |
if(!file1.getPath().endsWith("etc/permissions/platform.xml")) | |
if(!file1.getPath().endsWith(".xml")) | |
Slog.i("PackageManager", (new StringBuilder()).append("Non-xml file ").append(file1).append(" in ").append(file).append(" directory, ignoring").toString()); | |
else | |
if(!file1.canRead()) | |
Slog.w("PackageManager", (new StringBuilder()).append("Permissions library file ").append(file1).append(" cannot be read").toString()); | |
else | |
readPermissionsFromXml(file1); | |
j++; | |
} | |
readPermissionsFromXml(new File(Environment.getRootDirectory(), "etc/permissions/platform.xml")); | |
} | |
void removeInstalledPackageLI(android.content.pm.PackageParser.Package package1, boolean flag) | |
{ | |
clearThemePackageCache(package1.packageName); | |
synchronized(mPackages) | |
{ | |
if(ConfigBuildFlags.CAPP_UPLUSAPI && mLguplusPermissions != null) | |
mLguplusPermissions.onDelPkg(package1); | |
mPackages.remove(((PackageItemInfo) (package1.applicationInfo)).packageName); | |
if(package1.mPath != null) | |
mAppDirs.remove(package1.mPath); | |
cleanPackageDataStructuresLILPw(package1, flag); | |
} | |
return; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public void removePackageFromPreferred(String s) | |
{ | |
Slog.w("PackageManager", "removePackageFromPreferred: this is now a no-op"); | |
} | |
void removePackageLI(PackageSetting packagesetting, boolean flag) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1; | |
mPackages.remove(((PackageSettingBase) (packagesetting)).name); | |
if(((PackageSettingBase) (packagesetting)).codePathString != null) | |
mAppDirs.remove(((PackageSettingBase) (packagesetting)).codePathString); | |
package1 = packagesetting.pkg; | |
if(package1 == null) | |
break MISSING_BLOCK_LABEL_78; | |
if(ConfigBuildFlags.CAPP_UPLUSAPI && mLguplusPermissions != null) | |
mLguplusPermissions.onDelPkg(package1); | |
cleanPackageDataStructuresLILPw(package1, flag); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public void removePermission(String s) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
BasePermission basepermission; | |
checkPermissionTreeLP(s); | |
basepermission = (BasePermission)mSettings.mPermissions.get(s); | |
if(basepermission == null) | |
break MISSING_BLOCK_LABEL_95; | |
if(basepermission.type != 2) | |
throw new SecurityException((new StringBuilder()).append("Not allowed to modify non-dynamic permission ").append(s).toString()); | |
break MISSING_BLOCK_LABEL_76; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
mSettings.mPermissions.remove(s); | |
mSettings.writeLPr(); | |
hashmap; | |
JVM INSTR monitorexit ; | |
} | |
public void replacePreferredActivity(IntentFilter intentfilter, int i, ComponentName acomponentname[], ComponentName componentname) | |
{ | |
label0: | |
{ | |
if(intentfilter.countActions() != 1) | |
throw new IllegalArgumentException("replacePreferredActivity expects filter to have only 1 action."); | |
if(intentfilter.countCategories() != 1) | |
throw new IllegalArgumentException("replacePreferredActivity expects filter to have only 1 category."); | |
if(intentfilter.countDataAuthorities() != 0 || intentfilter.countDataPaths() != 0 || intentfilter.countDataSchemes() != 0 || intentfilter.countDataTypes() != 0) | |
throw new IllegalArgumentException("replacePreferredActivity expects filter to have no data authorities, paths, schemes or types."); | |
synchronized(mPackages) | |
{ | |
if(mContext.checkCallingOrSelfPermission("android.permission.SET_PREFERRED_APPLICATIONS") == 0) | |
break MISSING_BLOCK_LABEL_154; | |
if(getUidTargetSdkVersionLockedLPr(Binder.getCallingUid()) >= 8) | |
break label0; | |
Slog.w("PackageManager", (new StringBuilder()).append("Ignoring replacePreferredActivity() from uid ").append(Binder.getCallingUid()).toString()); | |
} | |
return; | |
} | |
mContext.enforceCallingOrSelfPermission("android.permission.SET_PREFERRED_APPLICATIONS", null); | |
int j = UserHandle.getCallingUserId(); | |
ArrayList arraylist = null; | |
PreferredIntentResolver preferredintentresolver = (PreferredIntentResolver)mSettings.mPreferredActivities.get(j); | |
if(preferredintentresolver == null) goto _L2; else goto _L1 | |
_L1: | |
Iterator iterator; | |
String s; | |
String s1; | |
iterator = preferredintentresolver.filterIterator(); | |
s = intentfilter.getAction(0); | |
s1 = intentfilter.getCategory(0); | |
_L3: | |
PreferredActivity preferredactivity; | |
do | |
{ | |
if(!iterator.hasNext()) | |
break MISSING_BLOCK_LABEL_344; | |
preferredactivity = (PreferredActivity)iterator.next(); | |
} while(!preferredactivity.getAction(0).equals(s) || !preferredactivity.getCategory(0).equals(s1)); | |
if(arraylist != null) | |
break MISSING_BLOCK_LABEL_269; | |
arraylist = new ArrayList(); | |
arraylist.add(preferredactivity); | |
Log.i("PackageManager", (new StringBuilder()).append("Removing preferred activity ").append(preferredactivity.mPref.mComponent).append(":").toString()); | |
intentfilter.dump(new LogPrinter(4, "PackageManager"), " "); | |
goto _L3 | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
if(arraylist == null) goto _L2; else goto _L4 | |
_L4: | |
int k = 0; | |
_L5: | |
if(k >= arraylist.size()) | |
break; /* Loop/switch isn't completed */ | |
preferredintentresolver.removeFilter((PreferredActivity)arraylist.get(k)); | |
k++; | |
if(true) goto _L5; else goto _L2 | |
_L2: | |
addPreferredActivity(intentfilter, i, acomponentname, componentname, j); | |
hashmap; | |
JVM INSTR monitorexit ; | |
} | |
public ProviderInfo resolveContentProvider(String s, int i, int j) | |
{ | |
if(!sUserManager.exists(j)) | |
return null; | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Provider provider = (android.content.pm.PackageParser.Provider)mProviders.get(s); | |
if(provider == null) goto _L2; else goto _L1 | |
_L1: | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(((android.content.pm.PackageParser.Component) (provider)).owner.packageName); | |
_L3: | |
if(packagesetting == null) | |
break MISSING_BLOCK_LABEL_142; | |
ProviderInfo providerinfo; | |
if(!mSettings.isEnabledLPr(provider.info, i, j) || mSafeMode && (1 & ((ComponentInfo) (provider.info)).applicationInfo.flags) == 0) | |
break MISSING_BLOCK_LABEL_142; | |
providerinfo = PackageParser.generateProviderInfo(provider, i, packagesetting.readUserState(j), j); | |
_L4: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return providerinfo; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L2: | |
packagesetting = null; | |
goto _L3 | |
providerinfo = null; | |
goto _L4 | |
} | |
public ResolveInfo resolveIntent(Intent intent, String s, int i, int j) | |
{ | |
if(!sUserManager.exists(j)) | |
{ | |
return null; | |
} else | |
{ | |
enforceCrossUserPermission(Binder.getCallingUid(), j, false, "resolve intent"); | |
return chooseBestActivity(intent, s, i, queryIntentActivities(intent, s, i, j), j); | |
} | |
} | |
public ResolveInfo resolveService(Intent intent, String s, int i, int j) | |
{ | |
List list; | |
for(list = queryIntentServices(intent, s, i, j); !sUserManager.exists(j) || list == null || list.size() < 1;) | |
return null; | |
return (ResolveInfo)list.get(0); | |
} | |
public void revokePermission(String s, String s1) | |
{ | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
android.content.pm.PackageParser.Package package1 = (android.content.pm.PackageParser.Package)mPackages.get(s); | |
if(package1 != null) | |
break MISSING_BLOCK_LABEL_60; | |
throw new IllegalArgumentException((new StringBuilder()).append("Unknown package: ").append(s).toString()); | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
BasePermission basepermission; | |
if(package1.applicationInfo.uid != Binder.getCallingUid()) | |
mContext.enforceCallingOrSelfPermission("android.permission.GRANT_REVOKE_PERMISSIONS", null); | |
basepermission = (BasePermission)mSettings.mPermissions.get(s1); | |
if(basepermission != null) | |
break MISSING_BLOCK_LABEL_134; | |
throw new IllegalArgumentException((new StringBuilder()).append("Unknown permission: ").append(s).toString()); | |
PackageSetting packagesetting; | |
if(!package1.requestedPermissions.contains(s1)) | |
throw new SecurityException((new StringBuilder()).append("Package ").append(s).append(" has not requested permission ").append(s1).toString()); | |
if((0x20 & basepermission.protectionLevel) == 0) | |
throw new SecurityException((new StringBuilder()).append("Permission ").append(s1).append(" is not a development permission").toString()); | |
packagesetting = (PackageSetting)package1.mExtras; | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_247; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
Object obj; | |
if(packagesetting.sharedUser == null) | |
break MISSING_BLOCK_LABEL_320; | |
obj = packagesetting.sharedUser; | |
_L1: | |
if(((GrantedPermissions) (obj)).grantedPermissions.remove(s1)) | |
{ | |
((GrantedPermissions) (obj)).grantedPermissions.remove(s1); | |
if(((PackageSettingBase) (packagesetting)).haveGids) | |
obj.gids = removeInts(((GrantedPermissions) (obj)).gids, basepermission.gids); | |
mSettings.writeLPr(); | |
} | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
obj = packagesetting; | |
goto _L1 | |
} | |
public void scanAvailableAsecs() | |
{ | |
updateExternalMediaStatusInner(true, false, false); | |
} | |
void schedulePackageCleaning(String s, int i, boolean flag) | |
{ | |
PackageHandler packagehandler = mHandler; | |
PackageHandler packagehandler1 = mHandler; | |
int j; | |
if(flag) | |
j = 1; | |
else | |
j = 0; | |
packagehandler.sendMessage(packagehandler1.obtainMessage(7, i, j, s)); | |
} | |
void scheduleWritePackageRestrictionsLocked(int i) | |
{ | |
if(sUserManager.exists(i)) | |
{ | |
mDirtyUsers.add(Integer.valueOf(i)); | |
if(!mHandler.hasMessages(14)) | |
{ | |
mHandler.sendEmptyMessageDelayed(14, 10000L); | |
return; | |
} | |
} | |
} | |
void scheduleWriteSettingsLocked() | |
{ | |
if(!mHandler.hasMessages(13)) | |
mHandler.sendEmptyMessageDelayed(13, 10000L); | |
} | |
public void setApplicationEnabledSetting(String s, int i, int j, int k) | |
{ | |
label0: | |
{ | |
if(ThreelmMdmConfig.THREELM_MDM && k == -1) | |
{ | |
int ai[] = sUserManager.getUserIds(); | |
int l = ai.length; | |
for(int i1 = 0; i1 < l; i1++) | |
setEnabledSetting(s, null, i, j, ai[i1]); | |
} else | |
if(sUserManager.exists(k)) | |
break label0; | |
return; | |
} | |
setEnabledSetting(s, null, i, j, k); | |
} | |
public void setComponentEnabledSetting(ComponentName componentname, int i, int j, int k) | |
{ | |
if(!sUserManager.exists(k)) | |
{ | |
return; | |
} else | |
{ | |
setEnabledSetting(componentname.getPackageName(), componentname.getClassName(), i, j, k); | |
return; | |
} | |
} | |
public boolean setInstallLocation(int i) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.WRITE_SECURE_SETTINGS", null); | |
if(getInstallLocation() == i) | |
return true; | |
if(i == 0 || i == 1 || i == 2) | |
{ | |
android.provider.Settings.Global.putInt(mContext.getContentResolver(), "default_install_location", i); | |
return true; | |
} else | |
{ | |
return false; | |
} | |
} | |
public void setInstallerPackageName(String s, String s1) | |
{ | |
int i = Binder.getCallingUid(); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
PackageSetting packagesetting = (PackageSetting)mSettings.mPackages.get(s); | |
if(packagesetting != null) | |
break MISSING_BLOCK_LABEL_70; | |
throw new IllegalArgumentException((new StringBuilder()).append("Unknown target package: ").append(s).toString()); | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
if(s1 == null) | |
break MISSING_BLOCK_LABEL_394; | |
PackageSetting packagesetting1 = (PackageSetting)mSettings.mPackages.get(s1); | |
if(packagesetting1 != null) | |
break MISSING_BLOCK_LABEL_123; | |
throw new IllegalArgumentException((new StringBuilder()).append("Unknown installer package: ").append(s1).toString()); | |
_L2: | |
Object obj = mSettings.getUserIdLPr(i); | |
if(obj == null) | |
break MISSING_BLOCK_LABEL_271; | |
Signature asignature[]; | |
if(!(obj instanceof SharedUserSetting)) | |
break MISSING_BLOCK_LABEL_208; | |
asignature = ((SharedUserSetting)obj).signatures.mSignatures; | |
_L1: | |
if(packagesetting1 == null) | |
break MISSING_BLOCK_LABEL_299; | |
if(compareSignatures(asignature, ((PackageSettingBase) (packagesetting1)).signatures.mSignatures) != 0) | |
throw new SecurityException((new StringBuilder()).append("Caller does not have same cert as new installer package ").append(s1).toString()); | |
break MISSING_BLOCK_LABEL_299; | |
if(!(obj instanceof PackageSetting)) | |
break MISSING_BLOCK_LABEL_232; | |
asignature = ((PackageSettingBase) ((PackageSetting)obj)).signatures.mSignatures; | |
goto _L1 | |
throw new SecurityException((new StringBuilder()).append("Bad object ").append(obj).append(" for uid ").append(i).toString()); | |
throw new SecurityException((new StringBuilder()).append("Unknown calling uid ").append(i).toString()); | |
PackageSetting packagesetting2; | |
if(((PackageSettingBase) (packagesetting)).installerPackageName == null) | |
break MISSING_BLOCK_LABEL_380; | |
packagesetting2 = (PackageSetting)mSettings.mPackages.get(((PackageSettingBase) (packagesetting)).installerPackageName); | |
if(packagesetting2 == null) | |
break MISSING_BLOCK_LABEL_380; | |
if(compareSignatures(asignature, ((PackageSettingBase) (packagesetting2)).signatures.mSignatures) != 0) | |
throw new SecurityException((new StringBuilder()).append("Caller does not have same cert as old installer package ").append(((PackageSettingBase) (packagesetting)).installerPackageName).toString()); | |
packagesetting.installerPackageName = s1; | |
scheduleWriteSettingsLocked(); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
packagesetting1 = null; | |
goto _L2 | |
} | |
public void setPackageStoppedState(String s, boolean flag, int i) | |
{ | |
if(!sUserManager.exists(i)) | |
return; | |
int j = Binder.getCallingUid(); | |
boolean flag1; | |
if(mContext.checkCallingOrSelfPermission("android.permission.CHANGE_COMPONENT_ENABLED_STATE") == 0) | |
flag1 = true; | |
else | |
flag1 = false; | |
enforceCrossUserPermission(j, i, true, "stop package"); | |
synchronized(mPackages) | |
{ | |
if(mSettings.setPackageStoppedStateLPw(s, flag, flag1, j, i)) | |
scheduleWritePackageRestrictionsLocked(i); | |
} | |
return; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public void setPermissionEnforced(String s, boolean flag) | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.GRANT_REVOKE_PERMISSIONS", null); | |
if(!"android.permission.READ_EXTERNAL_STORAGE".equals(s)) goto _L2; else goto _L1 | |
_L1: | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
IActivityManager iactivitymanager; | |
if(mSettings.mReadExternalStorageEnforced != null && mSettings.mReadExternalStorageEnforced.booleanValue() == flag) | |
break MISSING_BLOCK_LABEL_101; | |
mSettings.mReadExternalStorageEnforced = Boolean.valueOf(flag); | |
mSettings.writeLPr(); | |
iactivitymanager = ActivityManagerNative.getDefault(); | |
if(iactivitymanager == null) | |
break MISSING_BLOCK_LABEL_101; | |
long l = Binder.clearCallingIdentity(); | |
iactivitymanager.killProcessesBelowForeground("setPermissionEnforcement"); | |
Binder.restoreCallingIdentity(l); | |
_L3: | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
Exception exception1; | |
exception1; | |
Binder.restoreCallingIdentity(l); | |
throw exception1; | |
Exception exception; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
_L2: | |
throw new IllegalArgumentException((new StringBuilder()).append("No selective enforcement for ").append(s).toString()); | |
RemoteException remoteexception; | |
remoteexception; | |
Binder.restoreCallingIdentity(l); | |
goto _L3 | |
} | |
void startCleaningPackages() | |
{ | |
label0: | |
{ | |
synchronized(mPackages) | |
{ | |
if(isExternalMediaAvailable()) | |
break label0; | |
} | |
return; | |
} | |
if(!mSettings.mPackagesToBeCleaned.isEmpty()) | |
break MISSING_BLOCK_LABEL_38; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
Intent intent = new Intent("android.content.pm.CLEAN_EXTERNAL_STORAGE"); | |
intent.setComponent(DEFAULT_CONTAINER_COMPONENT); | |
IActivityManager iactivitymanager = ActivityManagerNative.getDefault(); | |
if(iactivitymanager != null) | |
try | |
{ | |
iactivitymanager.startService(null, intent, null, 0); | |
return; | |
} | |
catch(RemoteException remoteexception) { } | |
return; | |
} | |
public void systemReady() | |
{ | |
HashMap hashmap; | |
ArrayList arraylist; | |
int i; | |
PreferredIntentResolver preferredintentresolver; | |
boolean flag = true; | |
mSystemReady = flag; | |
Exception exception; | |
Iterator iterator; | |
PreferredActivity preferredactivity1; | |
if(android.provider.Settings.Global.getInt(mContext.getContentResolver(), "compatibility_mode", flag) != flag) | |
flag = false; | |
PackageParser.setCompatibilityModeEnabled(flag); | |
hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
arraylist = new ArrayList(); | |
i = 0; | |
_L4: | |
if(i >= mSettings.mPreferredActivities.size()) | |
break MISSING_BLOCK_LABEL_258; | |
preferredintentresolver = (PreferredIntentResolver)mSettings.mPreferredActivities.valueAt(i); | |
arraylist.clear(); | |
iterator = preferredintentresolver.filterSet().iterator(); | |
do | |
{ | |
if(!iterator.hasNext()) | |
break; | |
preferredactivity1 = (PreferredActivity)iterator.next(); | |
if(mActivities.mActivities.get(preferredactivity1.mPref.mComponent) == null) | |
arraylist.add(preferredactivity1); | |
} while(true); | |
break MISSING_BLOCK_LABEL_160; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
if(arraylist.size() <= 0) | |
break MISSING_BLOCK_LABEL_261; | |
int j = 0; | |
_L2: | |
if(j >= arraylist.size()) | |
break; /* Loop/switch isn't completed */ | |
PreferredActivity preferredactivity = (PreferredActivity)arraylist.get(i); | |
Slog.w("PackageManager", (new StringBuilder()).append("Removing dangling preferred activity: ").append(preferredactivity.mPref.mComponent).toString()); | |
preferredintentresolver.removeFilter(preferredactivity); | |
j++; | |
if(true) goto _L2; else goto _L1 | |
_L1: | |
mSettings.writePackageRestrictionsLPr(mSettings.mPreferredActivities.keyAt(i)); | |
break MISSING_BLOCK_LABEL_261; | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
i++; | |
if(true) goto _L4; else goto _L3 | |
_L3: | |
} | |
public void updateExternalMediaStatus(final boolean mediaStatus, final boolean reportStatus) | |
{ | |
int i = Binder.getCallingUid(); | |
if(i != 0 && i != 1000) | |
throw new SecurityException("Media status can only be updated by the system"); | |
HashMap hashmap = mPackages; | |
hashmap; | |
JVM INSTR monitorenter ; | |
StringBuilder stringbuilder = (new StringBuilder()).append("Updating external media status from "); | |
Exception exception; | |
String s; | |
StringBuilder stringbuilder1; | |
String s1; | |
PackageHandler packagehandler; | |
int j; | |
Message message; | |
if(mMediaMounted) | |
s = "mounted"; | |
else | |
s = "unmounted"; | |
stringbuilder1 = stringbuilder.append(s).append(" to "); | |
if(mediaStatus) | |
s1 = "mounted"; | |
else | |
s1 = "unmounted"; | |
Log.i("PackageManager", stringbuilder1.append(s1).toString()); | |
if(mediaStatus != mMediaMounted) | |
break MISSING_BLOCK_LABEL_149; | |
packagehandler = mHandler; | |
if(reportStatus) | |
j = 1; | |
else | |
j = 0; | |
message = packagehandler.obtainMessage(12, j, -1); | |
mHandler.sendMessage(message); | |
hashmap; | |
JVM INSTR monitorexit ; | |
return; | |
mMediaMounted = mediaStatus; | |
hashmap; | |
JVM INSTR monitorexit ; | |
mHandler.post(new Runnable() { | |
public void run() | |
{ | |
updateExternalMediaStatusInner(mediaStatus, reportStatus, true); | |
} | |
final PackageManagerService this$0; | |
final boolean val$mediaStatus; | |
final boolean val$reportStatus; | |
{ | |
this$0 = PackageManagerService.this; | |
mediaStatus = flag; | |
reportStatus = flag1; | |
super(); | |
} | |
} | |
); | |
return; | |
exception; | |
hashmap; | |
JVM INSTR monitorexit ; | |
throw exception; | |
} | |
public void verifyPendingInstall(int i, int j) | |
throws RemoteException | |
{ | |
mContext.enforceCallingOrSelfPermission("android.permission.PACKAGE_VERIFICATION_AGENT", "Only package verification agents can verify applications"); | |
if(ThreelmMdmConfig.THREELM_MDM && (j == 1000 || j == 1001 || mPendingScans.get(i) != null)) | |
{ | |
enforceSystemOrRoot("Only the system can complete scans"); | |
Message message1 = mHandler.obtainMessage(19); | |
message1.arg1 = i; | |
message1.obj = new Integer(j); | |
mHandler.sendMessage(message1); | |
return; | |
} else | |
{ | |
Message message = mHandler.obtainMessage(15); | |
PackageVerificationResponse packageverificationresponse = new PackageVerificationResponse(j, Binder.getCallingUid()); | |
message.arg1 = i; | |
message.obj = packageverificationresponse; | |
mHandler.sendMessage(message); | |
return; | |
} | |
} | |
static final String ACTION_PACKAGE_SCAN_3LM = "com.threelm.SCAN_PACKAGE"; | |
private static final int ADD_EVENTS = 136; | |
private static final int BLUETOOTH_UID = 1002; | |
static final int BROADCAST_DELAY = 10000; | |
static final int CHECK_PENDING_VERIFICATION = 16; | |
private static final boolean DEBUG_APP_DIR_OBSERVER = false; | |
private static final boolean DEBUG_BROADCASTS = false; | |
private static final boolean DEBUG_INSTALL = false; | |
private static final boolean DEBUG_INTENT_MATCHING = false; | |
private static final boolean DEBUG_PACKAGE_INFO = false; | |
private static final boolean DEBUG_PACKAGE_SCANNING = false; | |
private static final boolean DEBUG_PREFERRED = false; | |
private static final boolean DEBUG_REMOVE = false; | |
static final boolean DEBUG_SD_INSTALL = false; | |
static final boolean DEBUG_SETTINGS = false; | |
private static final boolean DEBUG_SHOW_INFO = false; | |
static final boolean DEBUG_UPGRADE = false; | |
private static final boolean DEBUG_VERIFY = false; | |
static final ComponentName DEFAULT_CONTAINER_COMPONENT = new ComponentName("com.android.defcontainer", "com.android.defcontainer.DefaultContainerService"); | |
static final String DEFAULT_CONTAINER_PACKAGE = "com.android.defcontainer"; | |
private static final int DEFAULT_VERIFICATION_RESPONSE = 1; | |
private static final long DEFAULT_VERIFICATION_TIMEOUT = 10000L; | |
private static final boolean DEFAULT_VERIFY_ENABLE = true; | |
static final int DEX_OPT_DEFERRED = 2; | |
static final int DEX_OPT_FAILED = -1; | |
static final int DEX_OPT_PERFORMED = 1; | |
static final int DEX_OPT_SKIPPED = 0; | |
static final int END_COPY = 4; | |
static final int FIND_INSTALL_LOC = 8; | |
static final int FIRST_APPLICATION_UID = 10000; | |
private static final int FM_RADIO_UID = 1029; | |
private static final boolean GET_CERTIFICATES = true; | |
static final int INIT_COPY = 5; | |
private static final String INSTALL_PACKAGE_SUFFIX = "-"; | |
private static final String LIB_DIR_NAME = "lib"; | |
private static final int LOG_UID = 1007; | |
static final int MAX_APPLICATION_UIDS = 1000; | |
static final int MCS_BOUND = 3; | |
static final int MCS_GIVE_UP = 11; | |
static final int MCS_RECONNECT = 10; | |
static final int MCS_UNBIND = 6; | |
static final boolean MULTIPLE_APPLICATION_UIDS = true; | |
private static final int NFCLOCK_UID = 1030; | |
private static final int NFC_UID = 1027; | |
private static final int OBSERVER_EVENTS = 712; | |
private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive"; | |
static final int PACKAGE_VERIFIED = 15; | |
static final int POST_INSTALL = 9; | |
private static final int RADIO_UID = 1001; | |
static final int REMOVE_CHATTY = 0x10000; | |
private static final int REMOVE_EVENTS = 584; | |
static final int SCAN_3LM_COMPLETE = 19; | |
static final int SCAN_3LM_RESULT_ALLOW = 1000; | |
static final int SCAN_3LM_RESULT_DENY = 1001; | |
static final int SCAN_3LM_TIMEOUT_FAIL = 17; | |
static final int SCAN_3LM_TIMEOUT_SUCCEED = 18; | |
static final int SCAN_BOOTING = 256; | |
static final int SCAN_DEFER_DEX = 128; | |
static final int SCAN_FORCE_DEX = 4; | |
static final int SCAN_MONITOR = 1; | |
static final int SCAN_NEW_INSTALL = 16; | |
static final int SCAN_NO_DEX = 2; | |
static final int SCAN_NO_PATHS = 32; | |
static final int SCAN_SYSTEM_APP_JNI = 32768; | |
static final int SCAN_UPDATE_SIGNATURE = 8; | |
static final int SCAN_UPDATE_TIME = 64; | |
private static final String SD_ENCRYPTION_ALGORITHM = "AES"; | |
private static final String SD_ENCRYPTION_KEYSTORE_NAME = "AppsOnSD"; | |
private static final String SECURITY_BRIDGE_NAME = "com.android.services.SecurityBridge.core.PackageManagerSB"; | |
static final int SEND_PENDING_BROADCAST = 1; | |
static final int START_CLEANING_PACKAGE = 7; | |
static final String TAG = "PackageManager"; | |
private static final int UID_NET_ADMIN = 3005; | |
private static final int UID_NET_RAW = 3004; | |
private static final int UID_QCOM_DIAG = 3009; | |
static final int UPDATED_MEDIA_STATUS = 12; | |
static final int UPDATE_PERMISSIONS_ALL = 1; | |
static final int UPDATE_PERMISSIONS_REPLACE_ALL = 4; | |
static final int UPDATE_PERMISSIONS_REPLACE_PKG = 2; | |
static final int WRITE_PACKAGE_RESTRICTIONS = 14; | |
static final int WRITE_SETTINGS = 13; | |
static final int WRITE_SETTINGS_DELAY = 10000; | |
private static final Comparator mProviderInitOrderSorter = new Comparator() { | |
public int compare(ProviderInfo providerinfo, ProviderInfo providerinfo1) | |
{ | |
int i = providerinfo.initOrder; | |
int j = providerinfo1.initOrder; | |
if(i > j) | |
return -1; | |
return i >= j ? 0 : 1; | |
} | |
public volatile int compare(Object obj, Object obj1) | |
{ | |
return compare((ProviderInfo)obj, (ProviderInfo)obj1); | |
} | |
} | |
; | |
private static final Comparator mResolvePrioritySorter = new Comparator() { | |
public int compare(ResolveInfo resolveinfo, ResolveInfo resolveinfo1) | |
{ | |
int i; | |
int j; | |
i = resolveinfo.priority; | |
j = resolveinfo1.priority; | |
if(i == j) goto _L2; else goto _L1 | |
_L1: | |
if(i <= j) goto _L4; else goto _L3 | |
_L3: | |
return -1; | |
_L4: | |
return 1; | |
_L2: | |
int k = resolveinfo.preferredOrder; | |
int l = resolveinfo1.preferredOrder; | |
if(k == l) | |
break; /* Loop/switch isn't completed */ | |
if(k <= l) | |
return 1; | |
if(true) goto _L3; else goto _L5 | |
_L5: | |
if(resolveinfo.isDefault == resolveinfo1.isDefault) | |
break; /* Loop/switch isn't completed */ | |
if(!resolveinfo.isDefault) | |
return 1; | |
if(true) goto _L3; else goto _L6 | |
_L6: | |
int i1 = resolveinfo.match; | |
int j1 = resolveinfo1.match; | |
if(i1 == j1) | |
break; /* Loop/switch isn't completed */ | |
if(i1 <= j1) | |
return 1; | |
if(true) goto _L3; else goto _L7 | |
_L7: | |
if(resolveinfo.system != resolveinfo1.system) | |
{ | |
if(!resolveinfo.system) | |
return 1; | |
} else | |
{ | |
return 0; | |
} | |
if(true) goto _L3; else goto _L8 | |
_L8: | |
} | |
public volatile int compare(Object obj, Object obj1) | |
{ | |
return compare((ResolveInfo)obj, (ResolveInfo)obj1); | |
} | |
} | |
; | |
static final String mTempContainerPrefix = "smdl2tmp"; | |
static UserManagerService sUserManager; | |
final HashSet hiddenApkList; | |
final ActivityIntentResolver mActivities; | |
ApplicationInfo mAndroidApplication; | |
final File mAppDataDir; | |
final HashMap mAppDirs; | |
final File mAppInstallDir; | |
final FileObserver mAppInstallObserver; | |
private File mAppLibInstallDir; | |
final String mAsecInternalPath; | |
final HashMap mAvailableFeatures; | |
private IMediaContainerService mContainerService; | |
final Context mContext; | |
final File mDalvikCacheDir; | |
private final DefaultContainerConnection mDefContainerConn; | |
final int mDefParseFlags; | |
final ArrayList mDeferredDexOpt; | |
private DeviceManager3LMService mDeviceManager; | |
private HashSet mDirtyUsers; | |
final FileObserver mDrmAppInstallObserver; | |
final File mDrmAppPrivateInstallDir; | |
final boolean mFactoryTest; | |
final File mForcedSystemAppInstallDir; | |
final FileObserver mForcedSystemAppInstallObserver; | |
final File mFrameworkDir; | |
final FileObserver mFrameworkInstallObserver; | |
int mGlobalGids[]; | |
final PackageHandler mHandler; | |
final HandlerThread mHandlerThread; | |
boolean mHasSystemUidErrors; | |
final Object mInstallLock; | |
final Installer mInstaller; | |
final HashMap mInstrumentation; | |
int mLastScanError; | |
PermissionsProxy mLguplusPermissions; | |
private boolean mMediaMounted; | |
final DisplayMetrics mMetrics; | |
int mNextInstallToken; | |
final boolean mNoDexOpt; | |
final boolean mOnlyCore; | |
final HashMap mPackages; | |
final HashMap mPendingBroadcasts; | |
final SparseArray mPendingScans; | |
final SparseArray mPendingVerification; | |
private int mPendingVerificationToken; | |
final HashMap mPermissionGroups; | |
android.content.pm.PackageParser.Package mPlatformPackage; | |
final HashSet mProtectedBroadcasts; | |
final HashMap mProviders; | |
final HashMap mProvidersByComponent; | |
final ActivityIntentResolver mReceivers; | |
private final String mRequiredVerifierPackage; | |
final ActivityInfo mResolveActivity; | |
ComponentName mResolveComponentName; | |
final ResolveInfo mResolveInfo; | |
boolean mRestoredSettings; | |
final SparseArray mRunningInstalls; | |
boolean mSafeMode; | |
File mScanningPath; | |
final String mSdkCodename; | |
final int mSdkVersion; | |
private PackageManagerMonitor mSecurityBridge; | |
final String mSeparateProcesses[]; | |
final ServiceIntentResolver mServices; | |
final Settings mSettings; | |
final HashMap mSharedLibraries; | |
final File mSystemAppDir; | |
final FileObserver mSystemInstallObserver; | |
final SparseArray mSystemPermissions; | |
boolean mSystemReady; | |
String mTmpSharedLibraries[]; | |
final HashSet mTransferedPackages; | |
final File mUserAppDataDir; | |
final File mVendorAppDir; | |
final FileObserver mVendorInstallObserver; | |
/* | |
static int access$2708(PackageManagerService packagemanagerservice) | |
{ | |
int i = packagemanagerservice.mPendingVerificationToken; | |
packagemanagerservice.mPendingVerificationToken = i + 1; | |
return i; | |
} | |
*/ | |
/* | |
static IMediaContainerService access$302(PackageManagerService packagemanagerservice, IMediaContainerService imediacontainerservice) | |
{ | |
packagemanagerservice.mContainerService = imediacontainerservice; | |
return imediacontainerservice; | |
} | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment