FORUMS

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

879 posts
Thanks Meter: 1,754
 
By EMSpilot, Recognized Themer on 31st January 2014, 12:10 AM
Post Reply Subscribe to Thread Email Thread
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 ]
 
 
7th August 2015, 06:04 PM |#2  
Junior Member
Thanks Meter: 2
 
More
i dont find this string , my rom is tochwitz resurection 2.5
-> http://forum.xda-developers.com/show....php?t=2778000

need this , its essential ...low memory device and link2sd ...has some problems with this stupid asec folder ....dont wonder while its on sd .. mayby u can do this for me ... have serched the whole day and night to fix this ... no suscess....
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes