[Sony Xperia T, TL, TX, V] eybee1970:
How To modify files for SUPER USER MOD

as I get lots of PMs how to modify the 2 jars to enable SUPER USER MOD for other devices, here is little How TO:

What you need:

you need to be on deodexed ROM

2 files from your ROM / device (Sony based!) --> framework.jar + services.jar

smali/baksmali for decompile/recompile the jars (DO NOT ASK ME HOW TO USE!!!!! I assume you know that!!!)

Notepad++ for editing smalis

a brain ;)

Decompile framework.jar (this is for changing Audio Values...)

go to \android\media\AudioService.smali and open with Notepad++

search for '.line 231'

you will see this

.line 231
.line 231
:array_2e2
.array-data 0x4
[COLOR=Red]0x5t 0x0t 0x0t 0x0t[/COLOR]
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
[COLOR=Red]0xft 0x0t 0x0t 0x0t[/COLOR]
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
[COLOR=Red]0xft 0x0t 0x0t 0x0t[/COLOR]
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
.end array-data

Change red parts and result will look like this:

.line 231
:array_2e2
.array-data 0x4
[COLOR=Blue]0x7t 0x0t 0x0t 0x0t[/COLOR]
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
[COLOR=Blue] 0x1et 0x0t 0x0t 0x0t[/COLOR]
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
[COLOR=Blue]0x1et 0x0t 0x0t 0x0t[/COLOR]
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
.end array-data

save and close

recompile framework.jar

now decompile services.jar (this is for disabling nasty signature check...)

go to \com\android\server\pm\PackageManagerService.smali and open with Notepad++

search for '.method static compareSignatures'

you will see this:

.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 9
.parameter "s1"
.parameter "s2"

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

.line 2285
if-nez p1, :cond_6

const/4 v6, 0x1

.line 2304
:goto_5
return v6

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

goto :goto_5

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

.line 2290
const/4 v6, -0x2

goto :goto_5

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

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

.line 2293
.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 2294
.local v5, sig:Landroid/content/pm/Signature;
invoke-virtual {v3, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

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

goto :goto_14

.line 2296
.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 2297
.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 2298
.restart local v5 #sig:Landroid/content/pm/Signature;
invoke-virtual {v4, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

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

goto :goto_26

.line 2301
.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 2302
const/4 v6, 0x0

goto :goto_5

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

goto :goto_5
.end method

substitute the whole method so result will look like this:

.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 9

const/4 v0, 0x0

return v0
.end method

save and close

recompile services.jar

push both files to /system/framework, set permissions and reboot

you are done and ready to use ;)

Disclaimer: I am not responsible if you brick your device - YOU ARE RESPONSIBLE! :D