Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,785,416 Members 39,191 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE]Disable signature verification -Kang helper!

Tip us?
 
xXx~~~SHLOK~~~xXx
Old
(Last edited by xXx~~~SHLOK~~~xXx; 20th April 2014 at 08:48 PM.)
#1  
xXx~~~SHLOK~~~xXx's Avatar
Senior Member - OP
Thanks Meter 395
Posts: 518
Join Date: Jul 2012
Location: Delhi
Default [GUIDE]Disable signature verification -Kang helper!

Whats signature verification?
The system always checks for different signatures for system apps and if they dont match the app doesnt get installed.
So if you try to make changes to Android Manifest and sign it it will not work untill you sign the whole rom with the same signature.
It's pretty annoying! If you are a kanger this will help you too, you will be easily able to replace system apps from other roms without any problems
Unless they dont require something (lib's , png's from framework).
I think every rom maker should do it in their rom,so its a bit more easy to modify


I wont guide you how to decompile,recompile or flash the file,You can find a good tutorial on xda for that.



How to Do it.

1. Pull out services.jar from system/framework (use any root explorer)
2. Decompile it - I prefer vts(virtous ten studio)
3. Then open \smali\com\android\server\pm\PackageManagerService .smali ( my recomdation use notepad++ )

Now find the method

.method static compareSignatures

It would look something like this

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

    .prologue
    .line 2160
    if-nez p0, :cond_8

    .line 2161
    if-nez p1, :cond_6

    const/4 v6, 0x1

    .line 2180
    :goto_5
    return v6

    .line 2161
    :cond_6
    const/4 v6, -0x1

    goto :goto_5

    .line 2165
    :cond_8
    if-nez p1, :cond_c

    .line 2166
    const/4 v6, -0x2

    goto :goto_5

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

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

    .line 2169
    .local v3, set1:Ljava/util/HashSet;,"Ljava/util/HashSet<Landroid/content/pm/Signature;>;"
    move-object v0, p0

    .local v0, arr$:[Landroid/content/pm/Signature;
    array-length v2, v0

    .local v2, len$:I
    const/4 v1, 0x0

    .local v1, i$:I
    :goto_14
    if-ge v1, v2, :cond_1e

    aget-object v5, v0, v1

    .line 2170
    .local v5, sig:Landroid/content/pm/Signature;
    invoke-virtual {v3, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    .line 2169
    add-int/lit8 v1, v1, 0x1

    goto :goto_14

    .line 2172
    .end local v5           #sig:Landroid/content/pm/Signature;
    :cond_1e
    new-instance v4, Ljava/util/HashSet;

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

    .line 2173
    .local v4, set2:Ljava/util/HashSet;,"Ljava/util/HashSet<Landroid/content/pm/Signature;>;"
    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

    .line 2174
    .restart local v5       #sig:Landroid/content/pm/Signature;
    invoke-virtual {v4, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    .line 2173
    add-int/lit8 v1, v1, 0x1

    goto :goto_26

    .line 2177
    .end local v5           #sig:Landroid/content/pm/Signature;
    :cond_30
    invoke-virtual {v3, v4}, Ljava/util/HashSet;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_38

    .line 2178
    const/4 v6, 0x0

    goto :goto_5

    .line 2180
    :cond_38
    const/4 v6, -0x3

    goto :goto_5
.end method
Replace the whole method by this

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

    const/4 v0, 0x0

    return v0
.end method
Now Just recompile your services.jar and use a flashable zip to flash it to your system.
I have attached a sample zip for flashing(you will have to add your services.jar into this) ,in case you dont have a flashable zip.



If that doesnt work for you,you can try d3cka's Method here.
http://forum.xda-developers.com/show....php?t=2342262

I am not a pro this just worked for me if you have problems ask.


And If you find this helpful Just press the thanks button. and let me know if i forgot something...
Attached Files
File Type: zip Flashablezip.zip - [Click for QR Code] (122.3 KB, 43 views)
My Works

MiniS3,MiniJb And Jellybean Launcher
http://forum.xda-developers.com/show....php?t=2206040


Themes For These Launchers
http://forum.xda-developers.com/show....php?t=2226226
The Following 4 Users Say Thank You to xXx~~~SHLOK~~~xXx For This Useful Post: [ Click to Expand ]
 
Pocket Fan
Old
#2  
Pocket Fan's Avatar
Member
Thanks Meter 5
Posts: 45
Join Date: Mar 2014
Great guide!
The Following User Says Thank You to Pocket Fan For This Useful Post: [ Click to Expand ]
 
xXx~~~SHLOK~~~xXx
Old
#3  
xXx~~~SHLOK~~~xXx's Avatar
Senior Member - OP
Thanks Meter 395
Posts: 518
Join Date: Jul 2012
Location: Delhi
Quote:
Originally Posted by Pocket Fan View Post
Great guide!
Its my first one. Did you try it?
My Works

MiniS3,MiniJb And Jellybean Launcher
http://forum.xda-developers.com/show....php?t=2206040


Themes For These Launchers
http://forum.xda-developers.com/show....php?t=2226226
The Following User Says Thank You to xXx~~~SHLOK~~~xXx For This Useful Post: [ Click to Expand ]
 
Pocket Fan
Old
#4  
Pocket Fan's Avatar
Member
Thanks Meter 5
Posts: 45
Join Date: Mar 2014
Yes, I really will to try it.
But I don't know how to deodex the system.
 
rush25
Old
#5  
rush25's Avatar
Recognized Themer
Thanks Meter 4,908
Posts: 3,151
Join Date: Nov 2011
Location: Mumbai

 
DONATE TO ME
very helpful
My Themes :-



 
xXx~~~SHLOK~~~xXx
Old
#6  
xXx~~~SHLOK~~~xXx's Avatar
Senior Member - OP
Thanks Meter 395
Posts: 518
Join Date: Jul 2012
Location: Delhi
Quote:
Originally Posted by Pocket Fan View Post
Yes, I really will to try it.
But I don't know how to deodex the system.
Try this, i deodexed my stock rom with this.



http://forum.xda-developers.com/show....php?t=2213235

And I think it would work in odexed roms also.


Quote:
Originally Posted by rush25 View Post
very helpful
Thanks


Sent from my GT-I9500 using Tapatalk
My Works

MiniS3,MiniJb And Jellybean Launcher
http://forum.xda-developers.com/show....php?t=2206040


Themes For These Launchers
http://forum.xda-developers.com/show....php?t=2226226
 
Pocket Fan
Old
#7  
Pocket Fan's Avatar
Member
Thanks Meter 5
Posts: 45
Join Date: Mar 2014
Thank you very much.
I wiil try it.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Fix KitKat WiFi Drops on Your Own

Despite introducing many useful features and overall great performance and enhancements,Android 4.4 KitKat … more

Bring Back Tablet UI on KitKat

Google presented their brand new UI for tablets alongsidethe release of Android 3.0 Honeycomb back in early … more

Give Your Notification Shade a Facelift with these Modding Guides

Modification has always been one of the strong suits of Android, due in … more

Keep Track of How Much Your Car Truly Costs with Car Logbook

It’s a very well established fact that cars are expensive. In addition to … more