[MOD][HOW-TO]To disable signature checks

one_love_420

Senior Member
Oct 24, 2010
452
564
0
onerhythmprojects.org
This is how to disable signature checks using seo's code that has been around forever, now for the EVO LTE on ICS.

Gonna loosely quote SteelH's [How To] post opener:

This reference guide is to tell you what to edit to disable Signature Checks for the EVO 4G LTE in Services.jar. It is not an all-inclusive how-to on adb, decompiling/recompiling apks, etc. There are already several very good sources right here on XDA for that information.

Decompile Services.jar and look for \com\android\server\pm\PackageManagerService.smali

Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
    .locals 7

    if-nez p0, :cond_8

    if-nez p1, :cond_6

    const/4 v6, 0x1

    :goto_5
    return v6

    :cond_6
    const/4 v6, -0x1

    goto :goto_5

    :cond_8
    if-nez p1, :cond_c

    const/4 v6, -0x2

    goto :goto_5

    :cond_c
    new-instance v3, Ljava/util/HashSet;

    invoke-direct {v3}, Ljava/util/HashSet;-><init>()V

    move-object v0, p0

    array-length v2, v0

    const/4 v1, 0x0

    :goto_14
    if-ge v1, v2, :cond_1e

    aget-object v5, v0, v1

    invoke-virtual {v3, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_14

    :cond_1e
    new-instance v4, Ljava/util/HashSet;

    invoke-direct {v4}, Ljava/util/HashSet;-><init>()V

    move-object v0, p1

    array-length v2, v0

    const/4 v1, 0x0

    :goto_26
    if-ge v1, v2, :cond_30

    aget-object v5, v0, v1

    invoke-virtual {v4, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_26

    :cond_30
    invoke-virtual {v3, v4}, Ljava/util/HashSet;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_38

    const/4 v6, 0x0

    goto :goto_5

    :cond_38
    const/4 v6, -0x3

    goto :goto_5
.end method
Do a whole-sale .method change and replace the entire .method with this one:

Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
    .locals 7

    const/4 v0, 0x0

    return v0
.end method
p.s. you will notice that there is no .line numbers and the .registers are now .locals, that is because I use a different baksmali cmd than what is the norm. I use:

Code:
java -Xmx1024M -jar baksmali.jar -l -b -o smali/ classes.dex
notice the extra -l -b
the -l(thats a lower case L not and upper case i) changes the .registers to .locals and the -b removes the smali debugging stuff that is not needed. Most custom rom builders know about this edits but this is for the average user that would like to make edits on their own and want to make edits to system/apps.

One_Love
 

one_love_420

Senior Member
Oct 24, 2010
452
564
0
onerhythmprojects.org
In what situation would this fix be applicable?
This is for anyone that wants to edit a /system/app and not want to re-sign their rom so that the framework and system apps have the same signatures. As i stated in the OP this is already done by many rom devs but this is for anyone that wants to make their own rom/edits. If this edit isn't done and signatures dont match on /system/apps then there will be problems, like not working/showing up, that sorta thing.
 

tonyparisi

Member
Feb 16, 2008
6
1
0
This is for anyone that wants to edit a /system/app and not want to re-sign their rom so that the framework and system apps have the same signatures. As i stated in the OP this is already done by many rom devs but this is for anyone that wants to make their own rom/edits. If this edit isn't done and signatures dont match on /system/apps then there will be problems, like not working/showing up, that sorta thing.
So sorry to seem dumb here but I have a oxed version so I can't decompile (which I dont know how to do anyway but I am sure there are tons of tutorials out there) But does anyone have this done for the stock services.jar?
 

one_love_420

Senior Member
Oct 24, 2010
452
564
0
onerhythmprojects.org
When to do your baksmali lines?
There wrote class.dex so after editing?
If before there's no class.dex yet, only jar.
I'm not quite sure what this says? But "I think" what you're asking is you have no classes.dex in the .jar.That would mean you are not deodexed. The .odex is the classes.dex. I hope this answered your question if not please re-word your post.

Sent from my EVO using Tapatalk 2
 

regit66

Senior Member
Jun 25, 2013
141
112
0
This is how to disable signature checks using seo's code that has been around forever, now for the EVO LTE on ICS.

Gonna loosely quote SteelH's [How To] post opener:

This reference guide is to tell you what to edit to disable Signature Checks for the EVO 4G LTE in Services.jar. It is not an all-inclusive how-to on adb, decompiling/recompiling apks, etc. There are already several very good sources right here on XDA for that information.

Decompile Services.jar and look for \com\android\server\pm\PackageManagerService.smali

Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
    .locals 7

    if-nez p0, :cond_8

    if-nez p1, :cond_6

    const/4 v6, 0x1

    :goto_5
    return v6

    :cond_6
    const/4 v6, -0x1

    goto :goto_5

    :cond_8
    if-nez p1, :cond_c

    const/4 v6, -0x2

    goto :goto_5

    :cond_c
    new-instance v3, Ljava/util/HashSet;

    invoke-direct {v3}, Ljava/util/HashSet;-><init>()V

    move-object v0, p0

    array-length v2, v0

    const/4 v1, 0x0

    :goto_14
    if-ge v1, v2, :cond_1e

    aget-object v5, v0, v1

    invoke-virtual {v3, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_14

    :cond_1e
    new-instance v4, Ljava/util/HashSet;

    invoke-direct {v4}, Ljava/util/HashSet;-><init>()V

    move-object v0, p1

    array-length v2, v0

    const/4 v1, 0x0

    :goto_26
    if-ge v1, v2, :cond_30

    aget-object v5, v0, v1

    invoke-virtual {v4, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_26

    :cond_30
    invoke-virtual {v3, v4}, Ljava/util/HashSet;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_38

    const/4 v6, 0x0

    goto :goto_5

    :cond_38
    const/4 v6, -0x3

    goto :goto_5
.end method
Do a whole-sale .method change and replace the entire .method with this one:

Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
    .locals 7

    const/4 v0, 0x0

    return v0
.end method
p.s. you will notice that there is no .line numbers and the .registers are now .locals, that is because I use a different baksmali cmd than what is the norm. I use:

Code:
java -Xmx1024M -jar baksmali.jar -l -b -o smali/ classes.dex
notice the extra -l -b
the -l(thats a lower case L not and upper case i) changes the .registers to .locals and the -b removes the smali debugging stuff that is not needed. Most custom rom builders know about this edits but this is for the average user that would like to make edits on their own and want to make edits to system/apps.

One_Love
Hi
I do this with my servicer.jar from CM9 .It s work good editet apk work , but i can t install app in data/app ant app ther don t work .
Thanks
 

dedichthui

Senior Member
Oct 31, 2010
930
231
0
This is how to disable signature checks using seo's code that has been around forever, now for the EVO LTE on ICS.

Gonna loosely quote SteelH's [How To] post opener:

This reference guide is to tell you what to edit to disable Signature Checks for the EVO 4G LTE in Services.jar. It is not an all-inclusive how-to on adb, decompiling/recompiling apks, etc. There are already several very good sources right here on XDA for that information.

Decompile Services.jar and look for \com\android\server\pm\PackageManagerService.smali

Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
    .locals 7

    if-nez p0, :cond_8

    if-nez p1, :cond_6

    const/4 v6, 0x1

    :goto_5
    return v6

    :cond_6
    const/4 v6, -0x1

    goto :goto_5

    :cond_8
    if-nez p1, :cond_c

    const/4 v6, -0x2

    goto :goto_5

    :cond_c
    new-instance v3, Ljava/util/HashSet;

    invoke-direct {v3}, Ljava/util/HashSet;-><init>()V

    move-object v0, p0

    array-length v2, v0

    const/4 v1, 0x0

    :goto_14
    if-ge v1, v2, :cond_1e

    aget-object v5, v0, v1

    invoke-virtual {v3, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_14

    :cond_1e
    new-instance v4, Ljava/util/HashSet;

    invoke-direct {v4}, Ljava/util/HashSet;-><init>()V

    move-object v0, p1

    array-length v2, v0

    const/4 v1, 0x0

    :goto_26
    if-ge v1, v2, :cond_30

    aget-object v5, v0, v1

    invoke-virtual {v4, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_26

    :cond_30
    invoke-virtual {v3, v4}, Ljava/util/HashSet;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_38

    const/4 v6, 0x0

    goto :goto_5

    :cond_38
    const/4 v6, -0x3

    goto :goto_5
.end method
Do a whole-sale .method change and replace the entire .method with this one:

Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
    .locals 7

    const/4 v0, 0x0

    return v0
.end method
p.s. you will notice that there is no .line numbers and the .registers are now .locals, that is because I use a different baksmali cmd than what is the norm. I use:

Code:
java -Xmx1024M -jar baksmali.jar -l -b -o smali/ classes.dex
notice the extra -l -b
the -l(thats a lower case L not and upper case i) changes the .registers to .locals and the -b removes the smali debugging stuff that is not needed. Most custom rom builders know about this edits but this is for the average user that would like to make edits on their own and want to make edits to system/apps.

One_Love

Done. But how to know it is working properly? I have copied to the phone and do not know, it works exactly as requested. Can not fault or whatever happened. ;)
How to check it?
 

kumbangdesa

Senior Member
Aug 25, 2011
889
394
0
Kuala Terengganu
Done. But how to know it is working properly? I have copied to the phone and do not know, it works exactly as requested. Can not fault or whatever happened. ;)
How to check it?
This mod work. I recompile and sign systemui.apk before but it blank when flash it. After made this disable signature check and flash again it work like a charmed.

Sent from my lolipop phone
 
  • Like
Reactions: dedichthui

gandolf007

Senior Member
Feb 6, 2011
142
9
0
hi
when i decompile Services.jar (g920p) 6.0.1 ican't find this path (\com\android\server\pm\PackageManagerService.smali)
how to disable signature verification on android marshmalow ?