Post Reply

[MOD][HOW-TO] Fully disable app verification (FOR USER APPS)

OP CNexus

13th May 2014, 10:50 PM   |  #21  
CNexus's Avatar
OP Recognized Contributor
Flag /home/cnexus/android
Thanks Meter: 13,632
 
9,039 posts
Join Date:Joined: May 2012
Donate to Me
More
Well, that's the wrong method to be replacing to begin with.
4th October 2014, 05:35 AM   |  #22  
Sami Kabir's Avatar
Senior Member
Flag Manama
Thanks Meter: 895
 
1,844 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Quote:
Originally Posted by CNexus

Part 2: Allows installing older versions on top of newer versions

Note that this mod also lets you install unsigned versions over other current versions, as well as installing older versions on top of newer versions of an app

This is what .method private installLocationPolicy(Landroid/content/pm/PackageInfoLite;I)I looks like in my PackageManagerService$InstallParams.smali:

Code:
.method private installLocationPolicy(Landroid/content/pm/PackageInfoLite;I)I
    .locals 8

    const/4 v5, 0x2

    const/4 v4, 0x1

    iget-object v2, p1, Landroid/content/pm/PackageInfoLite;->packageName:Ljava/lang/String;

    iget v0, p1, Landroid/content/pm/PackageInfoLite;->installLocation:I

    and-int/lit8 v6, p2, 0x8

    if-eqz v6, :cond_0

    move v1, v4

    :goto_0
    iget-object v6, p0, Lcom/android/server/pm/PackageManagerService$InstallParams;->this$0:Lcom/android/server/pm/PackageManagerService;

    iget-object v6, v6, Lcom/android/server/pm/PackageManagerService;->mPackages:Ljava/util/HashMap;

    monitor-enter v6

    :try_start_0
    iget-object v7, p0, Lcom/android/server/pm/PackageManagerService$InstallParams;->this$0:Lcom/android/server/pm/PackageManagerService;

    iget-object v7, v7, Lcom/android/server/pm/PackageManagerService;->mPackages:Ljava/util/HashMap;

    invoke-virtual {v7, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/content/pm/PackageParser$Package;

    if-eqz v3, :cond_5

    and-int/lit8 v7, p2, 0x2

    if-eqz v7, :cond_8

    iget-object v7, v3, Landroid/content/pm/PackageParser$Package;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    iget v7, v7, Landroid/content/pm/ApplicationInfo;->flags:I

    and-int/lit8 v7, v7, 0x1

    if-eqz v7, :cond_2

    if-eqz v1, :cond_1

    const-string v4, "PackageManager"

    const-string v5, "Cannot install update to system app on sdcard"

    invoke-static {v4, v5}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I

    const/4 v4, -0x3

    monitor-exit v6

    :goto_1
    return v4

    :cond_0
    const/4 v1, 0x0

    goto :goto_0

    :cond_1
    monitor-exit v6

    goto :goto_1

    :catchall_0
    move-exception v4

    monitor-exit v6
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v4

    :cond_2
    if-eqz v1, :cond_3

    :try_start_1
    monitor-exit v6

    move v4, v5

    goto :goto_1

    :cond_3
    if-ne v0, v4, :cond_4

    monitor-exit v6

    goto :goto_1

    :cond_4
    if-ne v0, v5, :cond_6

    :cond_5
    monitor-exit v6

    if-eqz v1, :cond_9

    move v4, v5

    goto :goto_1

    :cond_6
    #calls: Lcom/android/server/pm/PackageManagerService;->isExternal(Landroid/content/pm/PackageParser$Package;)Z
    invoke-static {v3}, Lcom/android/server/pm/PackageManagerService;->access$1900(Landroid/content/pm/PackageParser$Package;)Z

    move-result v7

    if-eqz v7, :cond_7

    monitor-exit v6

    move v4, v5

    goto :goto_1

    :cond_7
    monitor-exit v6

    goto :goto_1

    :cond_8
    const/4 v4, -0x4

    monitor-exit v6
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_1

    :cond_9
    iget v4, p1, Landroid/content/pm/PackageInfoLite;->recommendedInstallLocation:I

    goto :goto_1
.end method


I can't find the codes you mentioned...
Code:
if-nez v7, :cond_1

iget v7, p1, Landroid/content/pm/PackageInfoLite;->versionCode:I

iget v8, v3, Landroid/content/pm/PackageParser$Package;->mVersionCode:I

if-ge v7, v8, :cond_1

const-string v4, "PackageManager"

new-instance v5, Ljava/lang/StringBuilder;

invoke-direct {v5}, Ljava/lang/StringBuilder;->()V

const-string v7, "Can\'t install update of "
Last edited by Sami Kabir; 4th October 2014 at 05:38 AM.
Post Reply Subscribe to Thread

Tags
disable checking, disable signature, disable verification, remove signature checking, signature checking
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Sprint Galaxy S III Android Development by ThreadRank