Default [MOD][HACK] Disable ASEC (Forward locked packages)

This is not my Mod but I wanted to share it with Verizon S4 users.

Please thank Cosmic Dan for this.

1) Decompile services.jar
2) Open smali/com/android/server/pm/PackageManagerService.smali in a Unix line-ending compatible editor (GEdit, Notepad++)
3) Search for this text...

 
.method public installPackageWithVerificationAndEncryption(Landro id/net/Uri;Landroid/content/pm/IPackageInstallObserver;ILjava/lang/String;Landroid/content/pm/VerificationParams;Landroid/content/pm/ContainerEncryptionParamsV
.locals 14
.parameter "packageURI"
.parameter "observer"
.parameter "flags"
.parameter "installerPackageName"
.parameter "verificationParams"
.parameter "encryptionParams"

.prologue
.line 7922
iget-object v1, p0, Lcom/android/server/pm/PackageManagerService;->mContext:Landroid/content/Context;

const-string v2, "android.permission.INSTALL_PACKAGES"

const/4 v3, 0x0

invoke-virtual {v1, v2, v3}, Landroid/content/Context;->enforceCallingOrSelfPermission(Ljava/lang/String;Ljava/lang/StringV

.line 7925
invoke-static {}, Landroid/os/Binder;->getCallingUid()I

move-result v13

.line 7926
.local v13, uid:I
invoke-static {v13}, Landroid/os/UserHandle;->getUserId(I)I

move-result v1

const-string v2, "no_install_apps"

invoke-direct {p0, v1, v2}, Lcom/android/server/pm/PackageManagerService;->isUserRestricted(ILjava/lang/StringZ

move-result v1

if-eqz v1, :cond_0


5) Add the text in RED.

 
.method public installPackageWithVerificationAndEncryption(Landro id/net/Uri;Landroid/content/pm/IPackageInstallObserver;ILjava/lang/String;Landroid/content/pm/VerificationParams;Landroid/content/pm/ContainerEncryptionParamsV
.locals 14
.parameter "packageURI"
.parameter "observer"
.parameter "flags"
.parameter "installerPackageName"
.parameter "verificationParams"
.parameter "encryptionParams"

.prologue
.line 7922
iget-object v1, p0, Lcom/android/server/pm/PackageManagerService;->mContext:Landroid/content/Context;

const-string v2, "android.permission.INSTALL_PACKAGES"

const/4 v3, 0x0

invoke-virtual {v1, v2, v3}, Landroid/content/Context;->enforceCallingOrSelfPermission(Ljava/lang/String;Ljava/lang/StringV

and-int/lit8 p3, p3, -0x2

.line 7925
invoke-static {}, Landroid/os/Binder;->getCallingUid()I

move-result v13

.line 7926
.local v13, uid:I
invoke-static {v13}, Landroid/os/UserHandle;->getUserId(I)I

move-result v1

const-string v2, "no_install_apps"

invoke-direct {p0, v1, v2}, Lcom/android/server/pm/PackageManagerService;->isUserRestricted(ILjava/lang/StringZ

move-result v1

if-eqz v1, :cond_0


...recompile and push back to device. All done.

With this mod, any APK you install from market that would usually go in an ASEC container should now install as a standard APK, allowing you to move it to sd-ext with e.g. Link2SD. If you have existing ASEC apps already, uninstall and reinstall them.


- - - - - - - - - - - - - - - - - - - - -

Device: Verizon GS4 SCH-1545
Modem: I545VRUEMK2
ROM:MY OWN BUILD BASED OFF MK2
Nova Launcher


- - - - - - - - - - - - - - - - - - - - -

ASU Sun Devil Theme & Alum!!!
Purple Green Jelly Bean Theme
MOAR MA6 Text Colors