FORUMS
Remove All Ads from XDA

[Guide] SuperuserMod for all 6.x Devices/Roms

2,188 posts
Thanks Meter: 10,545
 
Post Reply Email Thread
Updated the SuperUser mode .. Click here

Firstly thanks to sagitt67 from 4PDA ( he did it )
I grabbed it and tested and working

Hope this should help all others

Requirements :-

* core-libart.jar
* services.jar
* Apktool/tickle my android
and patience

1. Decompile core-libart.jar
2. open core-libart/smali/java/security/Signature.smali
look for this method
Code:
.method public final verify([B)Z
in that method find this line
Code:
invoke-virtual {p0, p1}, Ljava/security/Signature;->engineVerify([B)Z

    move-result v0
Replace the red code with this
Code:
const/4 v0, 0x1
now find this method
Code:
.method public final verify([BII)Z
in that method find this line

Code:
invoke-virtual {p0, p1, p2, p3}, Ljava/security/Signature;->engineVerify([BII)Z

    move-result v0
replace the red line with this
Code:
const/4 v0, 0x1
save and close

3. Now open this core-libart/smali/java/security/MessageDigest.smali

find this method
Code:
.method public static isEqual([B[B)Z
    .registers 7

    const/4 v2, 0x0 
Change the red line to this
Code:
const/4 v2, 0x1
save and close
Compile it and Replace

and Continued in next post
The Following 15 Users Say Thank You to venkat kamesh For This Useful Post: [ View ] Gift venkat kamesh Ad-Free
 
 
2nd November 2016, 09:46 AM |#2  
venkat kamesh's Avatar
OP Recognized Contributor
Flag Tirupati
Thanks Meter: 10,545
 
Donate to Me
More
Continued
Now decompile services.jar

1. open services/smali/com/android/server/accounts/AccountManagerService.smali
Find this method
Code:
.method private isAccountPresentForCaller(Ljava/lang/String;Ljava/lang/String;)Z
look for this lines

Code:
iget-object v4, v0, Landroid/accounts/Account;->name:Ljava/lang/String;

    invoke-virtual {v4, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

if-eqz v4, :cond_2c
cond_2c may vary with your code

in that 2 lines do the changes like this
Code:
move-result v4   to const/4 v4, 0x0
if-eqz v4, :cond_2c to  if-nez v4, :cond_2c
save and Close

3. Now open this services/smali/com/android/server/pm/PackageManagerService$InstallParams.smali

look for this method
Code:
.method private installLocationPolicy(Landroid/content/pm/PackageInfoLite;)I
find these lines
Code:
    iget v8, p0, Lcom/android/server/pm/PackageManagerService$InstallParams;->installFlags:I
    :try_end_22
    .catchall {:try_start_10 .. :try_end_22} :catchall_5f

    and-int/lit16 v8, v8, 0x80
Change the red to this

Code:
or-int/lit16 v8, v8, 0x80
save and Close

4. Now open this services/smali/com/android/server/pm/PackageManagerService.smali
in that look for this method
Code:
.method private checkUpgradeKeySetLP(Lcom/android/server/pm/PackageSetting;Landroid/content/pm/PackageParser$Package;)Z
in that look for these lines

Code:
    iget-object v4, p2, Landroid/content/pm/PackageParser$Package;->mSigningKeys:Landroid/util/ArraySet;

    invoke-virtual {v4, v3}, Landroid/util/ArraySet;->containsAll(Ljava/util/Collection;)Z

    move-result v4

    if-eqz v4, :cond_20
cond_20 may be different with your code

Change re lines to these
Code:
move-result v4 to this const/4 v4, 0x0

if-eqz v4, :cond_20  to this  if-nez v4, :cond_20
Now look for this method
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
and replace with this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
    .locals 11

    const/4 v7, 0x0

    return v7
.end method
and look for this method
Code:
.method private packageIsBrowser(Ljava/lang/String;I)Z
in that find these lines

Code:
iget-object v4, v4, Landroid/content/pm/ActivityInfo;->packageName:Ljava/lang/String;

    invoke-virtual {p1, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4 

    if-eqz v4, :cond_22
cond_22 may be different with your code

Change re lines to these
Code:
move-result v4 to this const/4 v4, 0x0

if-eqz v4, :cond_22  to this  if-nez v4, :cond_22

Now save all and compile

replace both and Reboot
Tada
SuperUserMod Done....

#YourWish for this
Additional for Unlocked Bootloaders click here (complete mod)


Have Fun guys
Dont forget to mention me If you use my work
The Following 14 Users Say Thank You to venkat kamesh For This Useful Post: [ View ] Gift venkat kamesh Ad-Free
2nd November 2016, 11:32 AM |#3  
DeathStroke's Avatar
Senior Member
Flag 31.3300° N, 75.5800° E
Thanks Meter: 354
 
Donate to Me
More
Thanks alot Buddy, really useful, I've been looking for this on some old thread.

Sent from my E6683 using Tapatalk
The Following User Says Thank You to DeathStroke For This Useful Post: [ View ] Gift DeathStroke Ad-Free
4th November 2016, 12:18 PM |#4  
Hamidreza2010's Avatar
Senior Member
Thanks Meter: 467
 
More
@venkat kamesh bro thanks for your tut
i do this but get error in service.jar

after edit , i want to recompile it but get this error:

Code:
Recompiling "services.jar" With Original Signature,
in work area "_WorkArea1", using "apktool_2.2.1.jar" 
 
With Tickle My Android 14.2.0.0. 
(tinyurl.com\ticklemyandroid) 

 ----------------

I: Using Apktool 2.2.1
I: Smaling smali folder into classes.dex...
..\_WorkArea1\_working\services.jar\smali\com\android\server\pm\PackageManagerService.smali[7670,4] missing EOF at '.locals'
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/server/pm/PackageManagerService.smali
	at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:77)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:38)
	at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:405)
	at brut.androlib.Androlib.buildSources(Androlib.java:336)
	at brut.androlib.Androlib.build(Androlib.java:292)
	at brut.androlib.Androlib.build(Androlib.java:264)
	at brut.apktool.Main.cmdBuild(Main.java:227)
	at brut.apktool.Main.main(Main.java:84)

 ----------------

Recompile Not Successful!
how can i solve that?
4th November 2016, 03:44 PM |#5  
venkat kamesh's Avatar
OP Recognized Contributor
Flag Tirupati
Thanks Meter: 10,545
 
Donate to Me
More
Quote:
Originally Posted by Hamidreza2010

@venkat kamesh bro thanks for your tut
i do this but get error in service.jar

after edit , i want to recompile it but get this error:

Code:
Recompiling "services.jar" With Original Signature,
in work area "_WorkArea1", using "apktool_2.2.1.jar" 
 
With Tickle My Android 14.2.0.0. 
(tinyurl.com\ticklemyandroid) 

 ----------------

I: Using Apktool 2.2.1
I: Smaling smali folder into classes.dex...
..\_WorkArea1\_working\services.jar\smali\com\android\server\pm\PackageManagerService.smali[7670,4] missing EOF at '.locals'
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/server/pm/PackageManagerService.smali
	at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:77)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:38)
	at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:405)
	at brut.androlib.Androlib.buildSources(Androlib.java:336)
	at brut.androlib.Androlib.build(Androlib.java:292)
	at brut.androlib.Androlib.build(Androlib.java:264)
	at brut.apktool.Main.cmdBuild(Main.java:227)
	at brut.apktool.Main.main(Main.java:84)

 ----------------

Recompile Not Successful!
how can i solve that?

bro seems you deleted '.locals'

please recheck it
nothing more

Goodluck bro
4th November 2016, 09:45 PM |#6  
Senior Member
Flag vitoria-gasteiz (basque Country)
Thanks Meter: 995
 
Donate to Me
More
what´s the diferencce with the davidMKD´s tutorial disable signature verification http://forum.xda-developers.com/show....php?t=2458144
I ve been using this method since kit kat and its working fine, and you only modified slightly services.jar nothing else. cheers
5th November 2016, 04:51 AM |#7  
venkat kamesh's Avatar
OP Recognized Contributor
Flag Tirupati
Thanks Meter: 10,545
 
Donate to Me
More
Quote:
Originally Posted by juanpirulo

what´s the diferencce with the davidMKD´s tutorial disable signature verification http://forum.xda-developers.com/show....php?t=2458144
I ve been using this method since kit kat and its working fine, and you only modified slightly services.jar nothing else. cheers

haha well said bro

but structure of signature verification is not same since 4.4 to till date
there are lot of modification in structure and security level of api developed in their best

seems you just seen the services.jar changes hmm
had you looked to core-libart.jar ?

and you just see lines bro ?
why don't you look the code back to java ( i meant from smali to java ) so you can know the changes what i did

read the java imports
https://github.com/frohoff/jdk8u-dev.../java/security

read it get it
i had those changes too

the old guide is just allowing to install temporary ( if you already had old install and data is present)
but not a complete SuperUserMod

just for you to prove ( try only with marshmallow and this guide is from marshmallow )
for example add new settings.apk with new signatures replace it
clear data from recovery and check if your settings are there or not

Before commenting of comparison please go through the google, and try to read what changes are done ( analyze them in java )
then come to thread and give a comment

we are not ready to post something which is already persist/Working
Do tests and get back to here bro

Good luck bro
The Following 2 Users Say Thank You to venkat kamesh For This Useful Post: [ View ] Gift venkat kamesh Ad-Free
5th November 2016, 06:32 AM |#8  
russel5's Avatar
Senior Member
Flag Yekaterinburg
Thanks Meter: 785
 
Donate to Me
More
First, this is not superuser mod, this is three android patches from LuckyPatcher.apk
First two makes your phone very vulnerable, because you makes signature verification always true and disable .apk signature verification. (core-libart.jar)
Superusermod is just
Code:
comparesignatures
const/4 v7, 0x0
bla bla
All other just give you access for downgrade your installed apk (services.jar)
I think you must add this info (about core-libart.jar) to first post. Thanks.
The Following 3 Users Say Thank You to russel5 For This Useful Post: [ View ] Gift russel5 Ad-Free
5th November 2016, 07:40 AM |#9  
Senior Member
Flag Curepipe
Thanks Meter: 16
 
More
Did it.all good!

Thanks bro!
5th November 2016, 01:10 PM |#10  
Hamidreza2010's Avatar
Senior Member
Thanks Meter: 467
 
More
@venkat kamesh bro is this need to do after these steps?

http://forum.xda-developers.com/show...postcount=1264

i mean we should to do it or steps of this page is enough ? ( i have unlocked bootloader )
5th November 2016, 05:58 PM |#11  
Senior Member
Flag vitoria-gasteiz (basque Country)
Thanks Meter: 995
 
Donate to Me
More
Quote:
Originally Posted by venkat kamesh

haha well said bro

but structure of signature verification is not same since 4.4 to till date
there are lot of modification in structure and security level of api developed in their best

seems you just seen the services.jar changes hmm
had you looked to core-libart.jar ?

and you just see lines bro ?
why don't you look the code back to java ( i meant from smali to java ) so you can know the changes what i did

read the java imports
https://github.com/frohoff/jdk8u-dev.../java/security

read it get it
i had those changes too

the old guide is just allowing to install temporary ( if you already had old install and data is present)
but not a complete SuperUserMod

just for you to prove ( try only with marshmallow and this guide is from marshmallow )
for example add new settings.apk with new signatures replace it
clear data from recovery and check if your settings are there or not

Before commenting of comparison please go through the google, and try to read what changes are done ( analyze them in java )
then come to thread and give a comment

we are not ready to post something which is already persist/Working
Do tests and get back to here bro

Good luck bro

sorry bro when i said "you just modified slightly the services.jar" I didnt meant yourself i meant in the david tutorial no your tutorial. i just wanted your explanation about yours because i didnt know the difference. Now its ok
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes