Disable ASEC (Forward locked packages)

Search This thread

EMSpilot

Recognized Themer
May 31, 2012
1,096
2,054
Havasu
ASEC mod for Verizon Samsung S5

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(Landroid/net/Uri;Landroid/content/pm/IPackageInstallObserver;ILjava/lang/String;Landroid/content/pm/VerificationParams;Landroid/content/pm/ContainerEncryptionParams;)V
.locals 16
.param p1, "packageURI" # Landroid/net/Uri;
.param p2, "observer" # Landroid/content/pm/IPackageInstallObserver;
.param p3, "flags" # I
.param p4, "installerPackageName" # Ljava/lang/String;
.param p5, "verificationParams" # Landroid/content/pm/VerificationParams;
.param p6, "encryptionParams" # Landroid/content/pm/ContainerEncryptionParams;

.prologue
.line 8756
move-object/from16 v0, p0

iget-object v1, v0, 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/String;)V

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

move-result v10

.line 8762
.local v10, "uid":I
sget-object v1, Lcom/android/server/pm/PackageManagerService;->sPersonaManager:Lcom/android/server/pm/PersonaManagerService;

if-eqz v1, :cond_1


5) Add the text in RED.

.method public installPackageWithVerificationAndEncryption(Landroid/net/Uri;Landroid/content/pm/IPackageInstallObserver;ILjava/lang/String;Landroid/content/pm/VerificationParams;Landroid/content/pm/ContainerEncryptionParams;)V
.locals 16
.param p1, "packageURI" # Landroid/net/Uri;
.param p2, "observer" # Landroid/content/pm/IPackageInstallObserver;
.param p3, "flags" # I
.param p4, "installerPackageName" # Ljava/lang/String;
.param p5, "verificationParams" # Landroid/content/pm/VerificationParams;
.param p6, "encryptionParams" # Landroid/content/pm/ContainerEncryptionParams;

.prologue
.line 8756
move-object/from16 v0, p0

iget-object v1, v0, 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/String;)V

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

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

move-result v10

.line 8762
.local v10, "uid":I
sget-object v1, Lcom/android/server/pm/PackageManagerService;->sPersonaManager:Lcom/android/server/pm/PersonaManagerService;

if-eqz v1, :cond_1


...recompile and flash back to 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 mod the apk if so desired. If you have existing ASEC apps already, uninstall and reinstall them. ASEC apps are located in data/app-asec.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    ASEC mod for Verizon Samsung S5

    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(Landroid/net/Uri;Landroid/content/pm/IPackageInstallObserver;ILjava/lang/String;Landroid/content/pm/VerificationParams;Landroid/content/pm/ContainerEncryptionParams;)V
    .locals 16
    .param p1, "packageURI" # Landroid/net/Uri;
    .param p2, "observer" # Landroid/content/pm/IPackageInstallObserver;
    .param p3, "flags" # I
    .param p4, "installerPackageName" # Ljava/lang/String;
    .param p5, "verificationParams" # Landroid/content/pm/VerificationParams;
    .param p6, "encryptionParams" # Landroid/content/pm/ContainerEncryptionParams;

    .prologue
    .line 8756
    move-object/from16 v0, p0

    iget-object v1, v0, 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/String;)V

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

    move-result v10

    .line 8762
    .local v10, "uid":I
    sget-object v1, Lcom/android/server/pm/PackageManagerService;->sPersonaManager:Lcom/android/server/pm/PersonaManagerService;

    if-eqz v1, :cond_1


    5) Add the text in RED.

    .method public installPackageWithVerificationAndEncryption(Landroid/net/Uri;Landroid/content/pm/IPackageInstallObserver;ILjava/lang/String;Landroid/content/pm/VerificationParams;Landroid/content/pm/ContainerEncryptionParams;)V
    .locals 16
    .param p1, "packageURI" # Landroid/net/Uri;
    .param p2, "observer" # Landroid/content/pm/IPackageInstallObserver;
    .param p3, "flags" # I
    .param p4, "installerPackageName" # Ljava/lang/String;
    .param p5, "verificationParams" # Landroid/content/pm/VerificationParams;
    .param p6, "encryptionParams" # Landroid/content/pm/ContainerEncryptionParams;

    .prologue
    .line 8756
    move-object/from16 v0, p0

    iget-object v1, v0, 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/String;)V

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

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

    move-result v10

    .line 8762
    .local v10, "uid":I
    sget-object v1, Lcom/android/server/pm/PackageManagerService;->sPersonaManager:Lcom/android/server/pm/PersonaManagerService;

    if-eqz v1, :cond_1


    ...recompile and flash back to 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 mod the apk if so desired. If you have existing ASEC apps already, uninstall and reinstall them. ASEC apps are located in data/app-asec.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone