Post Reply

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

31st January 2014, 12:10 AM   |  #1  
EMSpilot's Avatar
OP Recognized Themer
Flag Havasu
Thanks Meter: 1,149
 
623 posts
Join Date:Joined: May 2012
Donate to Me
More
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.
The Following 2 Users Say Thank You to EMSpilot For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Verizon Samsung Galaxy S 4 Android Development by ThreadRank