[Decompiled] Asus - UnLock_Device_App_V6 - Asus Eee Pad Transformer Prime
Decompiled the APK using Brut.alll APK tool and just thought I would share for anyone wants to shift through the codes and commands.
They basically flag the system and kick into recovery to start the unlock process but have a look yourself.
Brut.alll APK Tool: http://code.google.com/p/android-apktool/
Not sure if this will be useful for the original Transformer as Asus stated that this works with ICS only, being the original transformer does not have ICS the bootloader may not be able to handle the steps should someone figure it out.
For anyone who would prefer to look at the code as java, here is a .jar created from the .dex with .class files. This would be in place of the .smali files.
Is it worth waiting for something to come of this? Like could this be reverse engineered to exclude the communication to asus about your serials?
What is different with this app and the asus app ???
Nothing is different, it's just the apk reverse engineered so it is "viewable" (read modifiable) by our devs. Hopefully the devs can come up with something to unlock the bootloader and prevent your warranty from being voided (or come up with a way to relock the bootloader should warranty issues come up).
thanks, but no need to post this... people who needed this allready done that...
also this should not be under development.
also you misunderstood what it does... but keep reading im sure you will find out what it does exactly some day
there is a big process before it even does anything to your phone except of reading and transferring info/data
sparkym3 said:
For anyone who would prefer to look at the code as java, here is a .jar created from the .dex with .class files. This would be in place of the .smali files.
Click to expand...
Click to collapse
Perfect thanks saved me an extra step, I was going to do this anyhow.
Hawkysoft said:
also this should not be under development.
also you misunderstood what it does... but keep reading im sure you will find out what it does exactly some day
there is a big process before it even does anything to your phone except of reading and transferring info/data
Click to expand...
Click to collapse
Sorry about the wrong section and if anyone needs this moved please do so. I understand the process is more then just the flag but I haven't been able to read through all of the code yet (damn work) but it is good practice.
But if you have any great information to share from your end please do so, it always great to spread knowledge (even is some of the info is repeatable info more advanced users) because it help inspire other great minds.
But i understand where your coming from as well. Cheers!
**Update**
It think I see the area you are talking about now, looks like your tablet goes through a registration process with Asus before the flag is kicked on. Still looking if they hand off a code but they probably flag your device in their system as unlocked for warranty reasons as well.
The magic happens in: UnLockFlagAndReboot.smali
Code:
.class public Lcom/asus/unlock/UnLockFlagAndReboot;
.super Ljava/lang/Object;
.source "UnLockFlagAndReboot.java"
# static fields
.field private static final MISC_PATH:Ljava/lang/String; = "/dev/block/mmcblk0p3"
.field private static final TAG:Ljava/lang/String; = "UnLockFlagAndReboot"
.field private static final USB_PATH:Ljava/lang/String; = "/dev/block/mmcblk0p4"
# instance fields
.field private mBufferReaderSize:I
.field private mContentStr:Ljava/lang/String;
.field private mContext:Landroid/content/Context;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
.parameter "context"
.prologue
.line 25
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 20
const/16 v0, 0x1f4
iput v0, p0, Lcom/asus/unlock/UnLockFlagAndReboot;->mBufferReaderSize:I
.line 21
const-string v0, ""
iput-object v0, p0, Lcom/asus/unlock/UnLockFlagAndReboot;->mContentStr:Ljava/lang/String;
.line 26
iput-object p1, p0, Lcom/asus/unlock/UnLockFlagAndReboot;->mContext:Landroid/content/Context;
.line 27
return-void
.end method
.method public static fromHexString(Ljava/lang/String;)[B
.locals 2
.parameter "in"
.prologue
.line 81
new-instance v0, Ljava/math/BigInteger;
const/16 v1, 0x10
invoke-direct {v0, p0, v1}, Ljava/math/BigInteger;-><init>(Ljava/lang/String;I)V
.line 82
.local v0, temp:Ljava/math/BigInteger;
invoke-virtual {v0}, Ljava/math/BigInteger;->toByteArray()[B
move-result-object v1
return-object v1
.end method
.method private writeRecoveryCmd(Ljava/lang/String;)V
.locals 10
.parameter "encodeCpuId"
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
.line 43
const/16 v8, 0x440
new-array v0, v8, [B
.line 44
.local v0, bary:[B
invoke-static {p1}, Lcom/asus/unlock/UnLockFlagAndReboot;->fromHexString(Ljava/lang/String;)[B
move-result-object v1
.line 46
.local v1, bary2:[B
const/16 v8, 0xb
new-array v2, v8, [B
fill-array-data v2, :array_0
.line 47
.local v2, cmd1:[B
const/16 v8, 0x9
new-array v3, v8, [B
fill-array-data v3, :array_1
.line 49
.local v3, cmd2:[B
const/4 v7, 0x0
.local v7, idx:I
:goto_0
array-length v8, v2
if-ge v7, v8, :cond_0
.line 50
const/4 v8, 0x0
aput-byte v8, v0, v7
.line 49
add-int/lit8 v7, v7, 0x1
goto :goto_0
.line 52
:cond_0
const/4 v7, 0x0
:goto_1
array-length v8, v2
if-ge v7, v8, :cond_1
.line 53
add-int/lit8 v8, v7, 0x0
aget-byte v9, v2, v7
aput-byte v9, v0, v8
.line 52
add-int/lit8 v7, v7, 0x1
goto :goto_1
.line 55
:cond_1
const/4 v7, 0x0
:goto_2
array-length v8, v3
if-ge v7, v8, :cond_2
.line 56
add-int/lit8 v8, v7, 0x40
aget-byte v9, v3, v7
aput-byte v9, v0, v8
.line 55
add-int/lit8 v7, v7, 0x1
goto :goto_2
.line 59
:cond_2
const/4 v5, 0x0
.line 61
.local v5, fos:Ljava/io/FileOutputStream;
:try_start_0
new-instance v6, Ljava/io/FileOutputStream;
const-string v8, "/dev/block/mmcblk0p3"
invoke-direct {v6, v8}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
.line 62
.end local v5 #fos:Ljava/io/FileOutputStream;
.local v6, fos:Ljava/io/FileOutputStream;
:try_start_1
invoke-virtual {v6, v0}, Ljava/io/FileOutputStream;->write([B)V
.line 66
new-instance v5, Ljava/io/FileOutputStream;
const-string v8, "/dev/block/mmcblk0p4"
invoke-direct {v5, v8}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
.catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_3
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2
.line 67
.end local v6 #fos:Ljava/io/FileOutputStream;
.restart local v5 #fos:Ljava/io/FileOutputStream;
:try_start_2
invoke-virtual {v5, v1}, Ljava/io/FileOutputStream;->write([B)V
.line 68
const-string v8, "UnLockFlagAndReboot"
const-string v9, "============= writeRecoveryCmd success ======================="
invoke-static {v8, v9}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.catch Ljava/io/FileNotFoundException; {:try_start_2 .. :try_end_2} :catch_0
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1
.line 74
if-eqz v5, :cond_3
.line 75
invoke-virtual {v5}, Ljava/io/FileOutputStream;->close()V
.line 78
:cond_3
:goto_3
return-void
.line 69
:catch_0
move-exception v4
.line 70
.local v4, e:Ljava/io/FileNotFoundException;
:goto_4
:try_start_3
invoke-virtual {v4}, Ljava/io/FileNotFoundException;->printStackTrace()V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
.line 74
if-eqz v5, :cond_3
.line 75
invoke-virtual {v5}, Ljava/io/FileOutputStream;->close()V
goto :goto_3
.line 71
.end local v4 #e:Ljava/io/FileNotFoundException;
:catch_1
move-exception v4
.line 72
.local v4, e:Ljava/io/IOException;
:goto_5
:try_start_4
invoke-virtual {v4}, Ljava/io/IOException;->printStackTrace()V
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_0
.line 74
if-eqz v5, :cond_3
.line 75
invoke-virtual {v5}, Ljava/io/FileOutputStream;->close()V
goto :goto_3
.line 74
.end local v4 #e:Ljava/io/IOException;
:catchall_0
move-exception v8
:goto_6
if-eqz v5, :cond_4
.line 75
invoke-virtual {v5}, Ljava/io/FileOutputStream;->close()V
:cond_4
throw v8
.line 74
.end local v5 #fos:Ljava/io/FileOutputStream;
.restart local v6 #fos:Ljava/io/FileOutputStream;
:catchall_1
move-exception v8
move-object v5, v6
.end local v6 #fos:Ljava/io/FileOutputStream;
.restart local v5 #fos:Ljava/io/FileOutputStream;
goto :goto_6
.line 71
.end local v5 #fos:Ljava/io/FileOutputStream;
.restart local v6 #fos:Ljava/io/FileOutputStream;
:catch_2
move-exception v4
move-object v5, v6
.end local v6 #fos:Ljava/io/FileOutputStream;
.restart local v5 #fos:Ljava/io/FileOutputStream;
goto :goto_5
.line 69
.end local v5 #fos:Ljava/io/FileOutputStream;
.restart local v6 #fos:Ljava/io/FileOutputStream;
:catch_3
move-exception v4
move-object v5, v6
.end local v6 #fos:Ljava/io/FileOutputStream;
.restart local v5 #fos:Ljava/io/FileOutputStream;
goto :goto_4
.line 46
:array_0
.array-data 0x1
0x62t
0x6ft
0x6ft
0x74t
0x2dt
0x75t
0x6et
0x6ct
0x6ft
0x63t
0x6bt
.end array-data
.line 47
:array_1
.array-data 0x1
0x72t
0x65t
0x63t
0x6ft
0x76t
0x65t
0x72t
0x79t
0xat
.end array-data
.end method
# virtual methods
.method public readFileContent()V
.locals 8
.prologue
.line 86
const/4 v1, 0x0
.line 88
.local v1, fr:Ljava/io/FileReader;
:try_start_0
new-instance v2, Ljava/io/FileReader;
const-string v5, "/dev/block/mmcblk0p3"
invoke-direct {v2, v5}, Ljava/io/FileReader;-><init>(Ljava/lang/String;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_7
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_3
.line 89
.end local v1 #fr:Ljava/io/FileReader;
.local v2, fr:Ljava/io/FileReader;
:try_start_1
new-instance v3, Ljava/io/BufferedReader;
iget v5, p0, Lcom/asus/unlock/UnLockFlagAndReboot;->mBufferReaderSize:I
invoke-direct {v3, v2, v5}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;I)V
.line 90
.local v3, in:Ljava/io/BufferedReader;
const-string v4, ""
.line 91
.local v4, line:Ljava/lang/String;
:goto_0
invoke-virtual {v3}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
move-result-object v4
if-eqz v4, :cond_1
.line 92
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
iget-object v6, p0, Lcom/asus/unlock/UnLockFlagAndReboot;->mContentStr:Ljava/lang/String;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
iput-object v5, p0, Lcom/asus/unlock/UnLockFlagAndReboot;->mContentStr:Ljava/lang/String;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
.catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_0
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_6
goto :goto_0
.line 95
.end local v3 #in:Ljava/io/BufferedReader;
.end local v4 #line:Ljava/lang/String;
:catch_0
move-exception v0
move-object v1, v2
.line 96
.end local v2 #fr:Ljava/io/FileReader;
.local v0, e:Ljava/io/FileNotFoundException;
.restart local v1 #fr:Ljava/io/FileReader;
:goto_1
:try_start_2
invoke-virtual {v0}, Ljava/io/FileNotFoundException;->printStackTrace()V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 101
if-eqz v1, :cond_0
.line 103
:try_start_3
invoke-virtual {v1}, Ljava/io/FileReader;->close()V
:try_end_3
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_2
.line 110
.end local v0 #e:Ljava/io/FileNotFoundException;
:cond_0
:goto_2
return-void
.line 94
.end local v1 #fr:Ljava/io/FileReader;
.restart local v2 #fr:Ljava/io/FileReader;
.restart local v3 #in:Ljava/io/BufferedReader;
.restart local v4 #line:Ljava/lang/String;
:cond_1
:try_start_4
const-string v5, "UnLockFlagAndReboot"
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "content of Unlock Flag: "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
iget-object v7, p0, Lcom/asus/unlock/UnLockFlagAndReboot;->mContentStr:Ljava/lang/String;
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_1
.catch Ljava/io/FileNotFoundException; {:try_start_4 .. :try_end_4} :catch_0
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_6
.line 101
if-eqz v2, :cond_3
.line 103
:try_start_5
invoke-virtual {v2}, Ljava/io/FileReader;->close()V
:try_end_5
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_1
move-object v1, v2
.line 107
.end local v2 #fr:Ljava/io/FileReader;
.restart local v1 #fr:Ljava/io/FileReader;
goto :goto_2
.line 104
.end local v1 #fr:Ljava/io/FileReader;
.restart local v2 #fr:Ljava/io/FileReader;
:catch_1
move-exception v0
.line 106
.local v0, e:Ljava/io/IOException;
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
move-object v1, v2
.line 107
.end local v2 #fr:Ljava/io/FileReader;
.restart local v1 #fr:Ljava/io/FileReader;
goto :goto_2
.line 104
.end local v3 #in:Ljava/io/BufferedReader;
.end local v4 #line:Ljava/lang/String;
.local v0, e:Ljava/io/FileNotFoundException;
:catch_2
move-exception v0
.line 106
.local v0, e:Ljava/io/IOException;
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
goto :goto_2
.line 97
.end local v0 #e:Ljava/io/IOException;
:catch_3
move-exception v0
.line 99
.restart local v0 #e:Ljava/io/IOException;
:goto_3
:try_start_6
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_0
.line 101
if-eqz v1, :cond_0
.line 103
:try_start_7
invoke-virtual {v1}, Ljava/io/FileReader;->close()V
:try_end_7
.catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_4
goto :goto_2
.line 104
:catch_4
move-exception v0
.line 106
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
goto :goto_2
.line 101
.end local v0 #e:Ljava/io/IOException;
:catchall_0
move-exception v5
:goto_4
if-eqz v1, :cond_2
.line 103
:try_start_8
invoke-virtual {v1}, Ljava/io/FileReader;->close()V
:try_end_8
.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_5
.line 107
:cond_2
:goto_5
throw v5
.line 104
:catch_5
move-exception v0
.line 106
.restart local v0 #e:Ljava/io/IOException;
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
goto :goto_5
.line 101
.end local v0 #e:Ljava/io/IOException;
.end local v1 #fr:Ljava/io/FileReader;
.restart local v2 #fr:Ljava/io/FileReader;
:catchall_1
move-exception v5
move-object v1, v2
.end local v2 #fr:Ljava/io/FileReader;
.restart local v1 #fr:Ljava/io/FileReader;
goto :goto_4
.line 97
.end local v1 #fr:Ljava/io/FileReader;
.restart local v2 #fr:Ljava/io/FileReader;
:catch_6
move-exception v0
move-object v1, v2
.end local v2 #fr:Ljava/io/FileReader;
.restart local v1 #fr:Ljava/io/FileReader;
goto :goto_3
.line 95
:catch_7
move-exception v0
goto :goto_1
.end local v1 #fr:Ljava/io/FileReader;
.restart local v2 #fr:Ljava/io/FileReader;
.restart local v3 #in:Ljava/io/BufferedReader;
.restart local v4 #line:Ljava/lang/String;
:cond_3
move-object v1, v2
.end local v2 #fr:Ljava/io/FileReader;
.restart local v1 #fr:Ljava/io/FileReader;
goto :goto_2
.end method
.method public reboot()V
.locals 3
.prologue
.line 38
iget-object v1, p0, Lcom/asus/unlock/UnLockFlagAndReboot;->mContext:Landroid/content/Context;
const-string v2, "power"
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
.line 39
.local v0, pm:Landroid/os/PowerManager;
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/os/PowerManager;->reboot(Ljava/lang/String;)V
.line 40
return-void
.end method
.method public writeUnlockFlag(Ljava/lang/String;)V
.locals 1
.parameter "encodeCpuId"
.prologue
.line 31
:try_start_0
invoke-direct {p0, p1}, Lcom/asus/unlock/UnLockFlagAndReboot;->writeRecoveryCmd(Ljava/lang/String;)V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.line 35
:goto_0
return-void
.line 32
:catch_0
move-exception v0
.line 33
.local v0, e:Ljava/io/IOException;
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
goto :goto_0
.end method
I think the real magic comes in where the argument to writeUnlockFlag is obtained. That class looks pretty simple.
your both wrong.. the real magic will come when someone can make a method or version that does not talk to Asus and giveaway who you are and that you unlocked
^^^ Yes, but let me expand a bit on unlock or lock.
NotifyDMServer seems to be the important part. I think it's getting an unlock key (secretCpuId) back from Asus, so it may not be possible to hack out the phoning home. I haven't looked too closely at that class, though. We need to see if this is actually from Asus, derived from data sent back from Asus, same for all users, etc.
Does the app support relocking? I haven't actually tried it.
Lock-N-Load said:
your both wrong.. the real magic will come when someone can make a method or version that does not talk to Asus and giveaway who you are and that you unlocked
Click to expand...
Click to collapse
Yea after I got a few minutes from work, I thought about what Hawkysoft said earlier and its clear as day this phones home to get the unlock code and I am sure your blacklisted from warranty support at the same time.
Predseda3D said:
^^^ Yes, but let me expand a bit on unlock or lock.
Click to expand...
Click to collapse
Are you saying this phones home details where locked or unlocked? If so do you know what it shares?
Noxious Ninja said:
NotifyDMServer seems to be the important part. I think it's getting an unlock key (secretCpuId) back from Asus, so it may not be possible to hack out the phoning home. I haven't looked too closely at that class, though. We need to see if this is actually from Asus, derived from data sent back from Asus, same for all users, etc.
Does the app support relocking? I haven't actually tried it.
Click to expand...
Click to collapse
Have not seen anything yet about the re-locking but agreed on the the lock key
Noxious Ninja said:
NotifyDMServer seems to be the important part. I think it's getting an unlock key (secretCpuId) back from Asus, so it may not be possible to hack out the phoning home. I haven't looked too closely at that class, though. We need to see if this is actually from Asus, derived from data sent back from Asus, same for all users, etc.
Does the app support relocking? I haven't actually tried it.
Click to expand...
Click to collapse
I must be missing something here, so someone correct me where I went wrong...
First off, I do see it phoning home, however, I don't see us ever using anything that is returned from that call to write the recovery partition.
1) The recovery image is written in writeRecoveryCmd (in UnLockFlagAndReboot). This procedure takes in one argument.
2) The writeRecoveryCmd is called from writeUnlockFlag (same class) which just passes in what it receives.
3) This writeUnlockFlag procedure is called from the writeUnlockFlag in the UnLockActivity which passes in this.mNotifyDMServer.getSecretCpuID()
4) the getSecretCpuID() method inside NotifyDMServer returns the local class variable mSecretCpuId.
5) I only ever see mSecretCpuId being initialized to 0.
Now someone find where this is being set to something other than 0. If it doesn't, and my logic is correct, we would all be able to simply use a program that passes in 0 to the writeRecoveryCmd procedure inside UnLockFlagAndReboot.
skaforey said:
I must be missing something here, so someone correct me where I went wrong...
First off, I do see it phoning home, however, I don't see us ever using anything that is returned from that call to write the recovery partition.
1) The recovery image is written in writeRecoveryCmd (in UnLockFlagAndReboot). This procedure takes in one argument.
2) The writeRecoveryCmd is called from writeUnlockFlag (same class) which just passes in what it receives.
3) This writeUnlockFlag procedure is called from the writeUnlockFlag in the UnLockActivity which passes in this.mNotifyDMServer.getSecretCpuID()
4) the getSecretCpuID() method inside NotifyDMServer returns the local class variable mSecretCpuId.
5) I only ever see mSecretCpuId being initialized to 0.
Now someone find where this is being set to something other than 0. If it doesn't, and my logic is correct, we would all be able to simply use a program that passes in 0 to the writeRecoveryCmd procedure inside UnLockFlagAndReboot.
Click to expand...
Click to collapse
Ok for the layman does that man their is hope of POSSIBLY making a tool that would not phone home and void us?
Sent from my Transformer Prime TF201 using xda premium
skaforey said:
I must be missing something here, so someone correct me where I went wrong...
First off, I do see it phoning home, however, I don't see us ever using anything that is returned from that call to write the recovery partition.
1) The recovery image is written in writeRecoveryCmd (in UnLockFlagAndReboot). This procedure takes in one argument.
2) The writeRecoveryCmd is called from writeUnlockFlag (same class) which just passes in what it receives.
3) This writeUnlockFlag procedure is called from the writeUnlockFlag in the UnLockActivity which passes in this.mNotifyDMServer.getSecretCpuID()
4) the getSecretCpuID() method inside NotifyDMServer returns the local class variable mSecretCpuId.
5) I only ever see mSecretCpuId being initialized to 0.
Now someone find where this is being set to something other than 0. If it doesn't, and my logic is correct, we would all be able to simply use a program that passes in 0 to the writeRecoveryCmd procedure inside UnLockFlagAndReboot.
Click to expand...
Click to collapse
Look at NotifyDMServer$CredCpuIdReceiver.smali. onReceive seems to be a callback invoked via a C2DM message. I.e., the app phones home, then waits for a push notification with the unlock key.
Of course I would prefer to be proven wrong.
Noxious Ninja said:
Look at NotifyDMServer$CredCpuIdReceiver.smali. onReceive seems to be a callback invoked via a C2DM message. I.e., the app phones home, then waits for a push notification with the unlock key.
Of course I would prefer to be proven wrong.
Click to expand...
Click to collapse
Dam.
Sent from my Transformer Prime TF201 using xda premium
Noxious Ninja said:
Look at NotifyDMServer$CredCpuIdReceiver.smali. onReceive seems to be a callback invoked via a C2DM message. I.e., the app phones home, then waits for a push notification with the unlock key.
Of course I would prefer to be proven wrong.
Click to expand...
Click to collapse
Right, I see that...but...starting from the write recovery process and working backwards, it doesn't appear that the variable gets set anywhere. It wouldn't be that difficult to at least modify the app to log additional info add it is ruining to verify if it is using a call back key or not
Sent from my Galaxy Nexus
Noxious Ninja said:
Look at NotifyDMServer$CredCpuIdReceiver.smali. onReceive seems to be a callback invoked via a C2DM message. I.e., the app phones home, then waits for a push notification with the unlock key.
Of course I would prefer to be proven wrong.
Click to expand...
Click to collapse
This is the same conclusion I came to when I took a look. I followed the same trace mentioned by the previous poster but also ended up with the C2DM message. It looks like ASUS is computing the secret cpu ID on their end.
Related
hiding root and recompiling
I have an app which will not run since my phone is rooted, however it is simply an app to show me the balance in my HSA acount so i have absolutely no concerns if it is compromised due to my being rooted. no account numbers are displayed the only information is why my current balance is. so i downloaded the apktool and copied the apk off my phone and unpacked it. here is what i found: # direct methods .method public constructor <init>()V .locals 0 .prologue .line 5 invoke-direct {p0}, Ljava/lang/Object;-><init>()V return-void .end method .method public static isRooted()Z .locals 6 .prologue const/4 v5, 0x1 .line 15 sget-object v0, Landroid/os/Build;->TAGS:Ljava/lang/String; .line 16 .local v0, buildTags:Ljava/lang/String; if-eqz v0, :cond_0 const-string v3, "test-keys" invoke-virtual {v0, v3}, Ljava/lang/String;->contains(Ljava/lang/CharSequenceZ move-result v3 if-eqz v3, :cond_0 move v3, v5 .line 39 :goto_0 return v3 .line 22 :cond_0 :try_start_0 new-instance v1, Ljava/io/File; const-string v3, "/system/app/Superuser.apk" invoke-direct {v1, v3}, Ljava/io/File;-><init>(Ljava/lang/StringV .line 23 .local v1, file:Ljava/io/File; invoke-virtual {v1}, Ljava/io/File;->exists()Z :try_end_0 .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 move-result v3 if-eqz v3, :cond_1 move v3, v5 .line 24 goto :goto_0 .line 26 .end local v1 #file:Ljava/io/File; :catch_0 move-exception v3 .line 31 :cond_1 :try_start_1 invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime; move-result-object v3 const-string v4, "su" invoke-virtual {v3, v4}, Ljava/lang/Runtime;->exec(Ljava/lang/StringLjava/lang/Process; :try_end_1 .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_1 move-result-object v2 .line 32 .local v2, proc:Ljava/lang/Process; if-eqz v2, :cond_2 move v3, v5 .line 33 goto :goto_0 .line 35 .end local v2 #proc:Ljava/lang/Process; :catch_1 move-exception v3 .line 39 :cond_2 const/4 v3, 0x0 goto :goto_0 .end method from this I took the step of renaming superuser.apk after i had disabled it, and the app would finally open. for the line that lists /system/app/superuser.apk i can change the name, but can someone point out the invoker and tell me what to change on the line that is invoking sudo so i can recompile the app and try it out? or can i simply null a variable so that it returns a "no root here" value?
cnlson said: I have an app which will not run since my phone is rooted, however it is simply an app to show me the balance in my HSA acount so i have absolutely no concerns if it is compromised due to my being rooted. no account numbers are displayed the only information is why my current balance is. so i downloaded the apktool and copied the apk off my phone and unpacked it. here is what i found: # direct methods .method public constructor <init>()V .locals 0 .prologue .line 5 invoke-direct {p0}, Ljava/lang/Object;-><init>()V return-void .end method .method public static isRooted()Z .locals 6 .prologue const/4 v5, 0x1 .line 15 sget-object v0, Landroid/os/Build;->TAGS:Ljava/lang/String; .line 16 .local v0, buildTags:Ljava/lang/String; if-eqz v0, :cond_0 const-string v3, "test-keys" invoke-virtual {v0, v3}, Ljava/lang/String;->contains(Ljava/lang/CharSequenceZ move-result v3 if-eqz v3, :cond_0 move v3, v5 .line 39 :goto_0 return v3 .line 22 :cond_0 :try_start_0 new-instance v1, Ljava/io/File; const-string v3, "/system/app/Superuser.apk" invoke-direct {v1, v3}, Ljava/io/File;-><init>(Ljava/lang/StringV .line 23 .local v1, file:Ljava/io/File; invoke-virtual {v1}, Ljava/io/File;->exists()Z :try_end_0 .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 move-result v3 if-eqz v3, :cond_1 move v3, v5 .line 24 goto :goto_0 .line 26 .end local v1 #file:Ljava/io/File; :catch_0 move-exception v3 .line 31 :cond_1 :try_start_1 invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime; move-result-object v3 const-string v4, "su" invoke-virtual {v3, v4}, Ljava/lang/Runtime;->exec(Ljava/lang/StringLjava/lang/Process; :try_end_1 .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_1 move-result-object v2 .line 32 .local v2, proc:Ljava/lang/Process; if-eqz v2, :cond_2 move v3, v5 .line 33 goto :goto_0 .line 35 .end local v2 #proc:Ljava/lang/Process; :catch_1 move-exception v3 .line 39 :cond_2 const/4 v3, 0x0 goto :goto_0 .end method from this I took the step of renaming superuser.apk after i had disabled it, and the app would finally open. for the line that lists /system/app/superuser.apk i can change the name, but can someone point out the invoker and tell me what to change on the line that is invoking sudo so i can recompile the app and try it out? or can i simply null a variable so that it returns a "no root here" value? Click to expand... Click to collapse just rename the superuser.apk word and the test-keys to something else so it fails the check. that works for the apps i've used to do this.
[HOW-TO] Disable the E911 Icon
This comes up frequently, and the icon is annoying. If you don't know what icon I'm talking about, it looks like one of the two that are attached to the post and lives next to the signal indicator. First, I'm going to assume you know how to decompile/recompile an APK. If you don't, well, go find out how to do that first, then come back because it isn't terribly difficult, and knowledge is power Now, what you need is SystemUI and you need to decompile it into resources (images and xml) and smali (java bytecode). Once that is done, we're looking for one specific file. In the decompiled apk, find smali/com/android/systemui/statusbar/policy/LocationController.smali and open it in your favorite text editor. Replace the entire contents of the file with the following (NOTE: This is for VRALL4, it may be slightly different if you are on a different build): Code: .class public Lcom/android/systemui/statusbar/policy/LocationController; .super Landroid/content/BroadcastReceiver; .source "LocationController.java" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lcom/android/systemui/statusbar/policy/LocationController$1;, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler; } .end annotation # static fields .field private static final EVENT_STOP_GPS_TONE:I = 0x40 .field private static final GPS_NOTIFICATION_ID:I = 0x3d8d7 .field private static final GPS_NOTI_STATUS:Ljava/lang/String; = "gps_notification_sounds" .field private static final TAG:Ljava/lang/String; = "StatusBar.LocationController" .field private static final sLBSImages:[I # instance fields .field private LBS_ENABLED:Ljava/lang/String; .field private LBS_ENABLED_CHANGE_ACTION:Ljava/lang/String; .field private VZW_PROVIDER:Ljava/lang/String; .field private mContext:Landroid/content/Context; .field private mFocusToneGenerator:Landroid/media/ToneGenerator; .field private final mHandler:Landroid/os/Handler; .field private mMyContext:Landroid/content/Context; .field private mNotificationService:Landroid/app/INotificationManager; .field private mService:Landroid/app/StatusBarManager; # direct methods .method static constructor <clinit>()V .locals 1 .prologue .line 79 const/4 v0, 0x2 new-array v0, v0, [I fill-array-data v0, :array_0 sput-object v0, Lcom/android/systemui/statusbar/policy/LocationController;->sLBSImages:[I return-void nop :array_0 .array-data 0x4 0xc6t 0x0t 0x2t 0x7ft 0xc7t 0x0t 0x2t 0x7ft .end array-data .end method .method public constructor <init>(Landroid/content/Context;)V .locals 4 .parameter "context" .prologue const/4 v3, 0x0 .line 87 invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V .line 69 new-instance v2, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler; invoke-direct {v2, p0, v3}, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler;-><init>(Lcom/android/systemui/statusbar/policy/LocationController;Lcom/android/systemui/statusbar/policy/LocationController$1;)V iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler; .line 78 iput-object v3, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mService:Landroid/app/StatusBarManager; .line 83 const-string v2, "com.android.internal.location.intent.action.LBS_ENABLED_CHANGE" iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->LBS_ENABLED_CHANGE_ACTION:Ljava/lang/String; .line 84 const-string v2, "lbsEnabled" iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->LBS_ENABLED:Ljava/lang/String; .line 85 const-string v2, "vzw_lbs" iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->VZW_PROVIDER:Ljava/lang/String; .line 88 iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; .line 89 iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mMyContext:Landroid/content/Context; .line 91 new-instance v0, Landroid/content/IntentFilter; invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V .line 92 .local v0, filter:Landroid/content/IntentFilter; const-string v2, "android.location.GPS_ENABLED_CHANGE" invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V .line 93 const-string v2, "android.location.GPS_FIX_CHANGE" invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V .line 97 invoke-virtual {p1, p0, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent; .line 99 const-string v2, "notification" invoke-virtual {p1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v1 check-cast v1, Landroid/app/NotificationManager; .line 101 .local v1, nm:Landroid/app/NotificationManager; invoke-static {}, Landroid/app/NotificationManager;->getService()Landroid/app/INotificationManager; move-result-object v2 iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager; .line 109 return-void .end method .method private GenerateBeep()V .locals 13 .prologue const/4 v12, 0x0 const/4 v11, 0x1 .line 114 iput-object v12, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; .line 115 const/4 v3, 0x0 .line 116 .local v3, MIN_VOLUME_LEV:I const/4 v1, 0x7 .line 117 .local v1, MAX_VOLUME_LEV:I const/16 v4, 0xe .line 118 .local v4, VOLUME_STEP:I const/4 v2, 0x0 .line 119 .local v2, MIN_VOLUME:I const/16 v0, 0x64 .line 120 .local v0, MAX_VOLUME:I move v8, v0 .line 122 .local v8, mCurVol:I iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; const-string v10, "audio" invoke-virtual {v9, v10}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v5 check-cast v5, Landroid/media/AudioManager; .line 124 .local v5, audioManager:Landroid/media/AudioManager; invoke-virtual {v5, v11}, Landroid/media/AudioManager;->getStreamVolume(I)I move-result v8 .line 126 const-string v9, "StatusBar.LocationController" new-instance v10, Ljava/lang/StringBuilder; invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V const-string v11, "GenerateBeep: Volumei Level:" invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v10 invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I .line 128 if-lt v8, v3, :cond_2 if-gt v8, v1, :cond_2 .line 130 if-eq v8, v1, :cond_1 .line 131 mul-int/2addr v8, v4 .line 135 :goto_0 const-string v9, "StatusBar.LocationController" new-instance v10, Ljava/lang/StringBuilder; invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V const-string v11, "GenerateBeep: valid Volume:" invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v10 invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I .line 144 :goto_1 :try_start_0 new-instance v9, Landroid/media/ToneGenerator; const/4 v10, 0x1 invoke-direct {v9, v10, v8}, Landroid/media/ToneGenerator;-><init>(II)V iput-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 .line 151 :goto_2 iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; if-eqz v9, :cond_0 .line 152 iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler; const/16 v10, 0x40 invoke-virtual {v9, v10}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message; move-result-object v7 .line 153 .local v7, m:Landroid/os/Message; iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; const/16 v10, 0x1c invoke-virtual {v9, v10}, Landroid/media/ToneGenerator;->startTone(I)Z .line 154 iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler; const-wide/16 v10, 0x1f4 invoke-virtual {v9, v7, v10, v11}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z .line 157 .end local v7 #m:Landroid/os/Message; :cond_0 return-void .line 133 :cond_1 move v8, v0 goto :goto_0 .line 138 :cond_2 const-string v9, "StatusBar.LocationController" const-string v10, "Error getting current volume: Setting volume as max volume" invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I .line 139 move v8, v0 goto :goto_1 .line 145 :catch_0 move-exception v6 .line 147 .local v6, e:Ljava/lang/Exception; iput-object v12, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; .line 148 sget-object v9, Ljava/lang/System;->err:Ljava/io/PrintStream; invoke-virtual {v9, v6}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V goto :goto_2 .end method .method static synthetic access$100(Lcom/android/systemui/statusbar/policy/LocationController;)Landroid/media/ToneGenerator; .locals 1 .parameter "x0" .prologue .line 60 iget-object v0, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; return-object v0 .end method .method static synthetic access$102(Lcom/android/systemui/statusbar/policy/LocationController;Landroid/media/ToneGenerator;)Landroid/media/ToneGenerator; .locals 0 .parameter "x0" .parameter "x1" .prologue .line 60 iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; return-object p1 .end method .method private checkLBSStatus()Z .locals 1 .prologue .line 300 const/4 v0, 0x0 return v0 .end method .method private final updateLBS(Landroid/content/Intent;)V .locals 0 .parameter "intent" .prologue .line 290 return-void .end method # virtual methods .method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V .locals 15 .parameter "context" .parameter "intent" .prologue .line 162 invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getAction()Ljava/lang/String; move-result-object v7 .line 163 .local v7, action:Ljava/lang/String; const-string v1, "enabled" const/4 v2, 0x0 move-object/from16 v0, p2 invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z move-result v8 .line 171 .local v8, enabled:Z const/4 v13, 0x0 .line 172 .local v13, valueFromPrefs:Z const-string v1, "StatusBar.LocationController" const-string v2, "onReceive: [GPS ICON]" invoke-static {v1, v2}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 182 const-string v1, "android.location.GPS_FIX_CHANGE" invoke-virtual {v7, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_0 if-eqz v8, :cond_0 .line 184 const v10, 0x10806c7 .line 185 .local v10, iconId:I const v12, 0x7f0a0083 .line 186 .local v12, textResId:I const/4 v14, 0x1 .line 228 .local v14, visible:Z :goto_0 if-eqz v14, :cond_2 .line 229 :try_start_0 new-instance v9, Landroid/content/Intent; const-string v1, "android.settings.LOCATION_SOURCE_SETTINGS" invoke-direct {v9, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V .line 230 .local v9, gpsIntent:Landroid/content/Intent; const/high16 v1, 0x1000 invoke-virtual {v9, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent; .line 231 const/4 v1, 0x0 const/4 v2, 0x0 move-object/from16 v0, p1 invoke-static {v0, v1, v9, v2}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent; move-result-object v11 .line 233 .local v11, pendingIntent:Landroid/app/PendingIntent; new-instance v1, Landroid/app/Notification$Builder; iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; invoke-direct {v1, v2}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;)V invoke-virtual {v1, v10}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder; move-result-object v1 iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; invoke-virtual {v2, v12}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence; move-result-object v2 invoke-virtual {v1, v2}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder; move-result-object v1 const/4 v2, 0x1 invoke-virtual {v1, v2}, Landroid/app/Notification$Builder;->setOngoing(Z)Landroid/app/Notification$Builder; move-result-object v1 invoke-virtual {v1, v11}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder; move-result-object v1 invoke-virtual {v1}, Landroid/app/Notification$Builder;->getNotification()Landroid/app/Notification; move-result-object v5 .line 241 .local v5, n:Landroid/app/Notification; const/4 v1, 0x0 iput-object v1, v5, Landroid/app/Notification;->tickerView:Landroid/widget/RemoteViews; .line 242 const/4 v1, 0x0 iput-object v1, v5, Landroid/app/Notification;->tickerText:Ljava/lang/CharSequence; .line 244 const/4 v1, 0x1 iput v1, v5, Landroid/app/Notification;->priority:I .line 246 const/4 v1, 0x1 new-array v6, v1, [I .line 247 .local v6, idOut:[I iget-object v1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager; iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String; move-result-object v2 const/4 v3, 0x0 const v4, 0x3d8d7 invoke-interface/range {v1 .. v6}, Landroid/app/INotificationManager;->enqueueNotificationWithTag(Ljava/lang/String;Ljava/lang/String;ILandroid/app/Notification;[I)V :try_end_0 .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0 .line 261 .end local v5 #n:Landroid/app/Notification; .end local v6 #idOut:[I .end local v9 #gpsIntent:Landroid/content/Intent; .end local v11 #pendingIntent:Landroid/app/PendingIntent; :goto_1 return-void .line 189 .end local v10 #iconId:I .end local v12 #textResId:I .end local v14 #visible:Z :cond_0 const-string v1, "android.location.GPS_ENABLED_CHANGE" invoke-virtual {v7, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_1 if-nez v8, :cond_1 .line 191 const/4 v14, 0x0 .line 192 .restart local v14 #visible:Z const/4 v12, 0x0 .restart local v12 #textResId:I move v10, v12 .restart local v10 #iconId:I goto :goto_0 .line 199 .end local v10 #iconId:I .end local v12 #textResId:I .end local v14 #visible:Z :cond_1 const-string v1, "StatusBar.LocationController" const-string v2, "onReceive: [GPS ICON] GPS is on, but not receiving fixes" invoke-static {v1, v2}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 200 const v10, 0x7f0200c5 .line 201 .restart local v10 #iconId:I const v12, 0x7f0a0082 .line 202 .restart local v12 #textResId:I const/4 v14, 0x1 .restart local v14 #visible:Z goto :goto_0 .line 254 :cond_2 :try_start_1 iget-object v1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager; iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String; move-result-object v2 const v3, 0x3d8d7 invoke-interface {v1, v2, v3}, Landroid/app/INotificationManager;->cancelNotification(Ljava/lang/String;I)V :try_end_1 .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0 goto :goto_1 .line 258 :catch_0 move-exception v1 goto :goto_1 .end method Save the file, rebuild SystemUI.apk and enjoy
Well this possibly be implemented in your ROM? Thanks! Sent from my SCH-I605 using xda premium
Jetdr said: Well this possibly be implemented in your ROM? Thanks! Sent from my SCH-I605 using xda premium Click to expand... Click to collapse Already is
Why do this over just renaming the image files? Seems like a lot of work for the same thing.
Its TwiX said: Why do this over just renaming the image files? Seems like a lot of work for the same thing. Click to expand... Click to collapse This gets rid of the icon in what would be a "proper" manner. If you replaced the icon with a transparent image (what many people do), it still takes up a location on the status bar, and you may see an empty space between icons, or partially hidden notifications, if you use that method. Deleting the icon entirely would make an APK that can't be recompiled since the resources are missing. This will allow you to make the icon fully disappear without taking up any space on the status bar, and allowing for the APK to be decompiled/recompiled in the future for more modifications.
imnuts said: Already is Click to expand... Click to collapse Here comes another Rom! Love it!
well icon is still appearing after opening up maps or after opening an app that uses the gps. upon reboot its gone but it re appears after using the gps. any other ideas?
inline6power said: well icon is still appearing after opening up maps or after opening an app that uses the gps. upon reboot its gone but it re appears after using the gps. any other ideas? Click to expand... Click to collapse Are you sure that's not the regular GPS symbol you're seeing? Screenshot? Sent from my unlocked & underclocked Galaxy Note 2
sleevasteve said: Are you sure that's not the regular GPS symbol you're seeing? Screenshot? Sent from my unlocked & underclocked Galaxy Note 2 Click to expand... Click to collapse Sent from my SCH-I605 using Tapatalk 2 ---------- Post added at 05:56 PM ---------- Previous post was at 05:54 PM ---------- I habe verified I have the right code in the right location. As soon as I reboot the icon is gone but if I use any app that uses gps it pops back up Sent from my SCH-I605 using Tapatalk 2
can anyone else comfirm if the icon reappears after using maps or navigation?
I'll look through and make sure I didn't also change something else when I made this change. I didn't think I did, but I was looking for other items when I found this too.
inline6power said: Sent from my SCH-I605 using Tapatalk 2 ---------- Post added at 05:56 PM ---------- Previous post was at 05:54 PM ---------- I habe verified I have the right code in the right location. As soon as I reboot the icon is gone but if I use any app that uses gps it pops back up Sent from my SCH-I605 using Tapatalk 2 Click to expand... Click to collapse In the meantime, just changing the extension of the .PNG files to .bak will do the trick. And it didn't seem to leave a blank space for me in the status bar, the only one that did that for me was the alarm clock icon. Sent from my unlocked & underclocked Galaxy Note 2
I fixed the issue with the icon reappearing and put the updated info in the OP. It was updated for VRALL4, but I don't think it will be much different for VRALJB.
imnuts said: I fixed the issue with the icon reappearing and put the updated info in the OP. It was updated for VRALL4, but I don't think it will be much different for VRALJB. Click to expand... Click to collapse for I605VRAMC3 you will need to change a a few ids other wise the wrong icons and strings will display for "searching for gps" and "location set by gps" here is the updated just like the OP just replace everything thing in there with this content LocationController.smali Code: .class public Lcom/android/systemui/statusbar/policy/LocationController; .super Landroid/content/BroadcastReceiver; .source "LocationController.java" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lcom/android/systemui/statusbar/policy/LocationController$1;, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler; } .end annotation # static fields .field private static final EVENT_STOP_GPS_TONE:I = 0x40 .field private static final GPS_NOTIFICATION_ID:I = 0x3d8d7 .field private static final GPS_NOTI_STATUS:Ljava/lang/String; = "gps_notification_sounds" .field private static final TAG:Ljava/lang/String; = "StatusBar.LocationController" .field private static final sLBSImages:[I # instance fields .field private LBS_ENABLED:Ljava/lang/String; .field private LBS_ENABLED_CHANGE_ACTION:Ljava/lang/String; .field private VZW_PROVIDER:Ljava/lang/String; .field private mContext:Landroid/content/Context; .field private mFocusToneGenerator:Landroid/media/ToneGenerator; .field private final mHandler:Landroid/os/Handler; .field private mMyContext:Landroid/content/Context; .field private mNotificationService:Landroid/app/INotificationManager; .field private mService:Landroid/app/StatusBarManager; # direct methods .method static constructor <clinit>()V .locals 1 .prologue .line 79 const/4 v0, 0x2 new-array v0, v0, [I fill-array-data v0, :array_0 sput-object v0, Lcom/android/systemui/statusbar/policy/LocationController;->sLBSImages:[I return-void nop :array_0 .array-data 0x4 0xc6t 0x0t 0x2t 0x7ft 0xc7t 0x0t 0x2t 0x7ft .end array-data .end method .method public constructor <init>(Landroid/content/Context;)V .locals 4 .parameter "context" .prologue const/4 v3, 0x0 .line 87 invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V .line 69 new-instance v2, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler; invoke-direct {v2, p0, v3}, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler;-><init>(Lcom/android/systemui/statusbar/policy/LocationController;Lcom/android/systemui/statusbar/policy/LocationController$1;)V iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler; .line 78 iput-object v3, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mService:Landroid/app/StatusBarManager; .line 83 const-string v2, "com.android.internal.location.intent.action.LBS_ENABLED_CHANGE" iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->LBS_ENABLED_CHANGE_ACTION:Ljava/lang/String; .line 84 const-string v2, "lbsEnabled" iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->LBS_ENABLED:Ljava/lang/String; .line 85 const-string v2, "vzw_lbs" iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->VZW_PROVIDER:Ljava/lang/String; .line 88 iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; .line 89 iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mMyContext:Landroid/content/Context; .line 91 new-instance v0, Landroid/content/IntentFilter; invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V .line 92 .local v0, filter:Landroid/content/IntentFilter; const-string v2, "android.location.GPS_ENABLED_CHANGE" invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V .line 93 const-string v2, "android.location.GPS_FIX_CHANGE" invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V .line 97 invoke-virtual {p1, p0, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent; .line 99 const-string v2, "notification" invoke-virtual {p1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v1 check-cast v1, Landroid/app/NotificationManager; .line 101 .local v1, nm:Landroid/app/NotificationManager; invoke-static {}, Landroid/app/NotificationManager;->getService()Landroid/app/INotificationManager; move-result-object v2 iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager; .line 109 return-void .end method .method private GenerateBeep()V .locals 13 .prologue const/4 v12, 0x0 const/4 v11, 0x1 .line 114 iput-object v12, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; .line 115 const/4 v3, 0x0 .line 116 .local v3, MIN_VOLUME_LEV:I const/4 v1, 0x7 .line 117 .local v1, MAX_VOLUME_LEV:I const/16 v4, 0xe .line 118 .local v4, VOLUME_STEP:I const/4 v2, 0x0 .line 119 .local v2, MIN_VOLUME:I const/16 v0, 0x64 .line 120 .local v0, MAX_VOLUME:I move v8, v0 .line 122 .local v8, mCurVol:I iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; const-string v10, "audio" invoke-virtual {v9, v10}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v5 check-cast v5, Landroid/media/AudioManager; .line 124 .local v5, audioManager:Landroid/media/AudioManager; invoke-virtual {v5, v11}, Landroid/media/AudioManager;->getStreamVolume(I)I move-result v8 .line 126 const-string v9, "StatusBar.LocationController" new-instance v10, Ljava/lang/StringBuilder; invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V const-string v11, "GenerateBeep: Volumei Level:" invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v10 invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I .line 128 if-lt v8, v3, :cond_2 if-gt v8, v1, :cond_2 .line 130 if-eq v8, v1, :cond_1 .line 131 mul-int/2addr v8, v4 .line 135 :goto_0 const-string v9, "StatusBar.LocationController" new-instance v10, Ljava/lang/StringBuilder; invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V const-string v11, "GenerateBeep: valid Volume:" invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v10 invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I .line 144 :goto_1 :try_start_0 new-instance v9, Landroid/media/ToneGenerator; const/4 v10, 0x1 invoke-direct {v9, v10, v8}, Landroid/media/ToneGenerator;-><init>(II)V iput-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 .line 151 :goto_2 iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; if-eqz v9, :cond_0 .line 152 iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler; const/16 v10, 0x40 invoke-virtual {v9, v10}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message; move-result-object v7 .line 153 .local v7, m:Landroid/os/Message; iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; const/16 v10, 0x1c invoke-virtual {v9, v10}, Landroid/media/ToneGenerator;->startTone(I)Z .line 154 iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler; const-wide/16 v10, 0x1f4 invoke-virtual {v9, v7, v10, v11}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z .line 157 .end local v7 #m:Landroid/os/Message; :cond_0 return-void .line 133 :cond_1 move v8, v0 goto :goto_0 .line 138 :cond_2 const-string v9, "StatusBar.LocationController" const-string v10, "Error getting current volume: Setting volume as max volume" invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I .line 139 move v8, v0 goto :goto_1 .line 145 :catch_0 move-exception v6 .line 147 .local v6, e:Ljava/lang/Exception; iput-object v12, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; .line 148 sget-object v9, Ljava/lang/System;->err:Ljava/io/PrintStream; invoke-virtual {v9, v6}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V goto :goto_2 .end method .method static synthetic access$100(Lcom/android/systemui/statusbar/policy/LocationController;)Landroid/media/ToneGenerator; .locals 1 .parameter "x0" .prologue .line 60 iget-object v0, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; return-object v0 .end method .method static synthetic access$102(Lcom/android/systemui/statusbar/policy/LocationController;Landroid/media/ToneGenerator;)Landroid/media/ToneGenerator; .locals 0 .parameter "x0" .parameter "x1" .prologue .line 60 iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator; return-object p1 .end method .method private checkLBSStatus()Z .locals 1 .prologue .line 300 const/4 v0, 0x0 return v0 .end method .method private final updateLBS(Landroid/content/Intent;)V .locals 0 .parameter "intent" .prologue .line 290 return-void .end method # virtual methods .method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V .locals 15 .parameter "context" .parameter "intent" .prologue .line 162 invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getAction()Ljava/lang/String; move-result-object v7 .line 163 .local v7, action:Ljava/lang/String; const-string v1, "enabled" const/4 v2, 0x0 move-object/from16 v0, p2 invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z move-result v8 .line 171 .local v8, enabled:Z const/4 v13, 0x0 .line 172 .local v13, valueFromPrefs:Z const-string v1, "StatusBar.LocationController" const-string v2, "onReceive: [GPS ICON]" invoke-static {v1, v2}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 182 const-string v1, "android.location.GPS_FIX_CHANGE" invoke-virtual {v7, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_0 if-eqz v8, :cond_0 .line 184 const v10, 0x10806c8 .line 185 .local v10, iconId:I const v12, 0x7f0a0089 .line 186 .local v12, textResId:I const/4 v14, 0x1 .line 228 .local v14, visible:Z :goto_0 if-eqz v14, :cond_2 .line 229 :try_start_0 new-instance v9, Landroid/content/Intent; const-string v1, "android.settings.LOCATION_SOURCE_SETTINGS" invoke-direct {v9, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V .line 230 .local v9, gpsIntent:Landroid/content/Intent; const/high16 v1, 0x1000 invoke-virtual {v9, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent; .line 231 const/4 v1, 0x0 const/4 v2, 0x0 move-object/from16 v0, p1 invoke-static {v0, v1, v9, v2}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent; move-result-object v11 .line 233 .local v11, pendingIntent:Landroid/app/PendingIntent; new-instance v1, Landroid/app/Notification$Builder; iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; invoke-direct {v1, v2}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;)V invoke-virtual {v1, v10}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder; move-result-object v1 iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; invoke-virtual {v2, v12}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence; move-result-object v2 invoke-virtual {v1, v2}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder; move-result-object v1 const/4 v2, 0x1 invoke-virtual {v1, v2}, Landroid/app/Notification$Builder;->setOngoing(Z)Landroid/app/Notification$Builder; move-result-object v1 invoke-virtual {v1, v11}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder; move-result-object v1 invoke-virtual {v1}, Landroid/app/Notification$Builder;->getNotification()Landroid/app/Notification; move-result-object v5 .line 241 .local v5, n:Landroid/app/Notification; const/4 v1, 0x0 iput-object v1, v5, Landroid/app/Notification;->tickerView:Landroid/widget/RemoteViews; .line 242 const/4 v1, 0x0 iput-object v1, v5, Landroid/app/Notification;->tickerText:Ljava/lang/CharSequence; .line 244 const/4 v1, 0x1 iput v1, v5, Landroid/app/Notification;->priority:I .line 246 const/4 v1, 0x1 new-array v6, v1, [I .line 247 .local v6, idOut:[I iget-object v1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager; iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String; move-result-object v2 const/4 v3, 0x0 const v4, 0x3d8d7 invoke-interface/range {v1 .. v6}, Landroid/app/INotificationManager;->enqueueNotificationWithTag(Ljava/lang/String;Ljava/lang/String;ILandroid/app/Notification;[I)V :try_end_0 .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0 .line 261 .end local v5 #n:Landroid/app/Notification; .end local v6 #idOut:[I .end local v9 #gpsIntent:Landroid/content/Intent; .end local v11 #pendingIntent:Landroid/app/PendingIntent; :goto_1 return-void .line 189 .end local v10 #iconId:I .end local v12 #textResId:I .end local v14 #visible:Z :cond_0 const-string v1, "android.location.GPS_ENABLED_CHANGE" invoke-virtual {v7, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_1 if-nez v8, :cond_1 .line 191 const/4 v14, 0x0 .line 192 .restart local v14 #visible:Z const/4 v12, 0x0 .restart local v12 #textResId:I move v10, v12 .restart local v10 #iconId:I goto :goto_0 .line 199 .end local v10 #iconId:I .end local v12 #textResId:I .end local v14 #visible:Z :cond_1 const-string v1, "StatusBar.LocationController" const-string v2, "onReceive: [GPS ICON] GPS is on, but not receiving fixes" invoke-static {v1, v2}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 200 const v10, 0x7f0200c7 .line 201 .restart local v10 #iconId:I const v12, 0x7f0a0088 .line 202 .restart local v12 #textResId:I const/4 v14, 0x1 .restart local v14 #visible:Z goto :goto_0 .line 254 :cond_2 :try_start_1 iget-object v1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager; iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context; invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String; move-result-object v2 const v3, 0x3d8d7 invoke-interface {v1, v2, v3}, Landroid/app/INotificationManager;->cancelNotification(Ljava/lang/String;I)V :try_end_1 .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0 goto :goto_1 .line 258 :catch_0 move-exception v1 goto :goto_1 .end method
[How-To] Potential Media Scanner Fix for XXLSJ-MS1/XWLS8-LSD-LSE-LSJ
As you all know a lot of people have a media scanner wakelock. It's a well known issue across all Google JB Phones. Google has implemented a fix for 4.2 which seems to fix it but there are still things that should be done by users. Googles FIX: https://android.googlesource.com/platform/frameworks/base/+/8ab2dc2f9680307febe997631c2148729f714e3d Seems the issue stems from corrupt thumbnail or other files. Also the issue is expanded by SQL Wildcard such as underscore [ _ ] in the file name. Also note that .nomedia in the folders don't seem to work anymore as posted by Koushik Dutta (Koush) CWM: https://plus.google.com/u/0/103583939320326217147/posts/Ntgmq2oniA5 So while looking at the fix it seems that the CM team has implemented Google's fix in there source here: http://review.cyanogenmod.org/#/c/27862/ So we decide to try this in our ROM and it seems from my test users with the issue that it has fixed it so we want to share what needs to be changed so you can mod your ROM yourself or Devs to add this to their ROM. First up is to Decompile Framework.jar Go to: \framework\smali\android\media\MediaScanner.smali Click to expand... Click to collapse and find: Code: .method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry; Replace the whole method with this: Code: .method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry; .locals 14 .parameter "path" .prologue .line 1470 const/4 v12, 0x0 .line 1472 .local v12, c:Landroid/database/Cursor; :try_start_0 const-string v0, "_" invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z move-result v0 if-nez v0, :cond_0 const-string v0, "%" invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z move-result v0 if-eqz v0, :cond_4 :cond_0 const/4 v13, 0x1 .line 1474 .local v13, hasWildCards:Z :goto_0 if-nez v13, :cond_1 iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z if-nez v0, :cond_5 .line 1479 :cond_1 const-string v3, "_data=?" .line 1480 .local v3, where:Ljava/lang/String; const/4 v0, 0x1 new-array v4, v0, [Ljava/lang/String; const/4 v0, 0x0 aput-object p1, v4, v0 .line 1487 .local v4, selectionArgs:[Ljava/lang/String; :goto_1 iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider; iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri; sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String; const/4 v5, 0x0 const/4 v6, 0x0 invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor; move-result-object v12 .line 1489 invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z move-result v0 if-nez v0, :cond_2 if-eqz v13, :cond_2 iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z if-eqz v0, :cond_2 .line 1494 const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)" .line 1495 const/4 v0, 0x1 new-array v4, v0, [Ljava/lang/String; .end local v4 #selectionArgs:[Ljava/lang/String; const/4 v0, 0x0 aput-object p1, v4, v0 .line 1496 .restart local v4 #selectionArgs:[Ljava/lang/String; invoke-interface {v12}, Landroid/database/Cursor;->close()V .line 1497 iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider; iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri; sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String; const/4 v5, 0x0 const/4 v6, 0x0 invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor; move-result-object v12 .line 1502 :cond_2 invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z move-result v0 if-eqz v0, :cond_8 .line 1503 const/4 v0, 0x0 invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J move-result-wide v6 .line 1504 .local v6, rowId:J const/4 v0, 0x2 invoke-interface {v12, v0}, Landroid/database/Cursor;->getInt(I)I move-result v11 .line 1505 .local v11, format:I const/4 v0, 0x3 invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J move-result-wide v9 .line 1506 .local v9, lastModified:J new-instance v5, Landroid/media/MediaScanner$FileEntry; move-object v8, p1 invoke-direct/range {v5 .. v11}, Landroid/media/MediaScanner$FileEntry;-><init>(JLjava/lang/String;JI)V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0 .line 1510 if-eqz v12, :cond_3 .line 1511 invoke-interface {v12}, Landroid/database/Cursor;->close()V .line 1514 .end local v3 #where:Ljava/lang/String; .end local v4 #selectionArgs:[Ljava/lang/String; .end local v6 #rowId:J .end local v9 #lastModified:J .end local v11 #format:I .end local v13 #hasWildCards:Z :cond_3 :goto_2 return-object v5 .line 1472 :cond_4 const/4 v13, 0x0 goto :goto_0 .line 1484 .restart local v13 #hasWildCards:Z :cond_5 :try_start_1 const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)" .line 1485 .restart local v3 #where:Ljava/lang/String; const/4 v0, 0x1 new-array v4, v0, [Ljava/lang/String; const/4 v0, 0x0 aput-object p1, v4, v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0 .restart local v4 #selectionArgs:[Ljava/lang/String; goto :goto_1 .line 1510 .end local v3 #where:Ljava/lang/String; .end local v4 #selectionArgs:[Ljava/lang/String; .end local v13 #hasWildCards:Z :catchall_0 move-exception v0 if-eqz v12, :cond_6 .line 1511 invoke-interface {v12}, Landroid/database/Cursor;->close()V .line 1510 :cond_6 throw v0 .line 1508 :catch_0 move-exception v0 .line 1510 if-eqz v12, :cond_7 .line 1511 :goto_3 invoke-interface {v12}, Landroid/database/Cursor;->close()V .line 1514 :cond_7 const/4 v5, 0x0 goto :goto_2 .line 1510 .restart local v3 #where:Ljava/lang/String; .restart local v4 #selectionArgs:[Ljava/lang/String; .restart local v13 #hasWildCards:Z :cond_8 if-eqz v12, :cond_7 goto :goto_3 .end method Recompile and you're good to go. Hope this helps. Thanks to: jeboo Google cyanogenmod Click to expand... Click to collapse
Thanks Sir for sharing with us This wakelock is really anoying.
Mr.Greg said: Thanks Sir for sharing with us This wakelock is really anoying. Click to expand... Click to collapse Thanks I hope it works for you!
shoman94 said: First up is to Decompile Framework.jar Go to: and find: Code: .method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry; Replace the whole method with this: Code: .method makeEntryFor(Ljava/lang/String;)Landroid/media/MediaScanner$FileEntry; .locals 14 .parameter "path" .prologue .line 1470 const/4 v12, 0x0 .line 1472 .local v12, c:Landroid/database/Cursor; :try_start_0 const-string v0, "_" invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z move-result v0 if-nez v0, :cond_0 const-string v0, "%" invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z move-result v0 if-eqz v0, :cond_4 :cond_0 const/4 v13, 0x1 .line 1474 .local v13, hasWildCards:Z :goto_0 if-nez v13, :cond_1 iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z if-nez v0, :cond_5 .line 1479 :cond_1 const-string v3, "_data=?" .line 1480 .local v3, where:Ljava/lang/String; const/4 v0, 0x1 new-array v4, v0, [Ljava/lang/String; const/4 v0, 0x0 aput-object p1, v4, v0 .line 1487 .local v4, selectionArgs:[Ljava/lang/String; :goto_1 iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider; iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri; sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String; const/4 v5, 0x0 const/4 v6, 0x0 invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor; move-result-object v12 .line 1489 invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z move-result v0 if-nez v0, :cond_2 if-eqz v13, :cond_2 iget-boolean v0, p0, Landroid/media/MediaScanner;->mCaseInsensitivePaths:Z if-eqz v0, :cond_2 .line 1494 const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)" .line 1495 const/4 v0, 0x1 new-array v4, v0, [Ljava/lang/String; .end local v4 #selectionArgs:[Ljava/lang/String; const/4 v0, 0x0 aput-object p1, v4, v0 .line 1496 .restart local v4 #selectionArgs:[Ljava/lang/String; invoke-interface {v12}, Landroid/database/Cursor;->close()V .line 1497 iget-object v0, p0, Landroid/media/MediaScanner;->mMediaProvider:Landroid/content/IContentProvider; iget-object v1, p0, Landroid/media/MediaScanner;->mFilesUri:Landroid/net/Uri; sget-object v2, Landroid/media/MediaScanner;->FILES_PRESCAN_PROJECTION:[Ljava/lang/String; const/4 v5, 0x0 const/4 v6, 0x0 invoke-interface/range {v0 .. v6}, Landroid/content/IContentProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/ICancellationSignal;)Landroid/database/Cursor; move-result-object v12 .line 1502 :cond_2 invoke-interface {v12}, Landroid/database/Cursor;->moveToFirst()Z move-result v0 if-eqz v0, :cond_8 .line 1503 const/4 v0, 0x0 invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J move-result-wide v6 .line 1504 .local v6, rowId:J const/4 v0, 0x2 invoke-interface {v12, v0}, Landroid/database/Cursor;->getInt(I)I move-result v11 .line 1505 .local v11, format:I const/4 v0, 0x3 invoke-interface {v12, v0}, Landroid/database/Cursor;->getLong(I)J move-result-wide v9 .line 1506 .local v9, lastModified:J new-instance v5, Landroid/media/MediaScanner$FileEntry; move-object v8, p1 invoke-direct/range {v5 .. v11}, Landroid/media/MediaScanner$FileEntry;-><init>(JLjava/lang/String;JI)V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0 .line 1510 if-eqz v12, :cond_3 .line 1511 invoke-interface {v12}, Landroid/database/Cursor;->close()V .line 1514 .end local v3 #where:Ljava/lang/String; .end local v4 #selectionArgs:[Ljava/lang/String; .end local v6 #rowId:J .end local v9 #lastModified:J .end local v11 #format:I .end local v13 #hasWildCards:Z :cond_3 :goto_2 return-object v5 .line 1472 :cond_4 const/4 v13, 0x0 goto :goto_0 .line 1484 .restart local v13 #hasWildCards:Z :cond_5 :try_start_1 const-string v3, "_data LIKE ?1 AND lower(_data)=lower(?1)" .line 1485 .restart local v3 #where:Ljava/lang/String; const/4 v0, 0x1 new-array v4, v0, [Ljava/lang/String; const/4 v0, 0x0 aput-object p1, v4, v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0 .restart local v4 #selectionArgs:[Ljava/lang/String; goto :goto_1 .line 1510 .end local v3 #where:Ljava/lang/String; .end local v4 #selectionArgs:[Ljava/lang/String; .end local v13 #hasWildCards:Z :catchall_0 move-exception v0 if-eqz v12, :cond_6 .line 1511 invoke-interface {v12}, Landroid/database/Cursor;->close()V .line 1510 :cond_6 throw v0 .line 1508 :catch_0 move-exception v0 .line 1510 if-eqz v12, :cond_7 .line 1511 :goto_3 invoke-interface {v12}, Landroid/database/Cursor;->close()V .line 1514 :cond_7 const/4 v5, 0x0 goto :goto_2 .line 1510 .restart local v3 #where:Ljava/lang/String; .restart local v4 #selectionArgs:[Ljava/lang/String; .restart local v13 #hasWildCards:Z :cond_8 if-eqz v12, :cond_7 goto :goto_3 .end method Recompile and Your good to go. Hope this helps. Click to expand... Click to collapse will try to implement this on my project. thanks Sir..
Thanks. Include in AIO-X-TremEXD Mod
Hopefully they fix the .nomedia bug soon..Hard to imagine such an enormous oversight.
Nice guys Sent from my GT-N7000
Folks, I tried this method, but when recompile I have a Warning:could not find resources but building was successful. Anyone know?
Mr.Greg said: Folks, I tried this method, but when recompile I have a Warning:could not find resources but building was successful. Anyone know? Click to expand... Click to collapse even a slight character mis place here and there might lead to that issue, try recompiling once again with atmost care and see
Sun90 said: even a slight character mis place here and there might lead to that issue, try recompiling once again with atmost care and see Click to expand... Click to collapse I tried already and same thing.
Mr.Greg said: Folks, I tried this method, but when recompile I have a Warning:could not find resources but building was successful. Anyone know? Click to expand... Click to collapse what tool are u using mate?
Mirko ddd said: what tool are u using mate? Click to expand... Click to collapse I'm using Sasha's apktool, but I solved, seem like nothing to worry about that warning, coz was build successful and with no error. I just replaced and see how is. Thanks Mirko.
Mr.Greg said: I'm using Sasha's apktool, but I solved, seem like nothing to worry about that warning, coz was build successful and with no error. I just replaced and see how is. Thanks Mirko. Click to expand... Click to collapse ok mate
Ok, seem like after modify code in framework.jar, after reboot photos and picture in gallery loading slowly then before, but this it's not a problem. I'll test today and see how is. Thanks guys for tip.
Mr.Greg said: Folks, I tried this method, but when recompile I have a Warning:could not find resources but building was successful. Anyone know? Click to expand... Click to collapse Edit; I guess I was a page behind...Lol
shoman94 said: As you all know a lot of people have a media scanner wakelock. It's a well known issue across all Google JB Phones. Google has implemented a fix for 4.2 which seems to fix it but there are still things that should be done by users. Googles FIX: https://android.googlesource.com/platform/frameworks/base/+/8ab2dc2f9680307febe997631c2148729f714e3d Seems the issue stems from corrupt thumbnail or other files. Also the issue is expanded by SQL Wildcard such as underscore [ _ ] in the file name. Also note that .nomedia in the folders don't seem to work anymore as posted by Koushik Dutta (Koush) CWM: https://plus.google.com/u/0/103583939320326217147/posts/Ntgmq2oniA5 So while looking at the fix it seems that the CM team has implemented Google's fix in there source here: http://review.cyanogenmod.org/#/c/27862/ So we decide to try this in our ROM and it seems from my test users with the issue that it has fixed it so we want to share what needs to be changed so you can mod your ROM yourself or Devs to add this to their ROM. First up is to Decompile Framework.jar CODE .......... CODE Recompile and you're good to go. Hope this helps. Click to expand... Click to collapse Recompiled on XXLSJ but not working. Got SOOO many FCs...
BSDgeek_Jake said: Recompiled on XXLSJ but not working. Got SOOO many FCs... Click to expand... Click to collapse You obviously didn't do it right. Sent from my SGH-I777 using Tapatalk 2
Ok guys. After compiled framework.jar with this code, no media scanning issue. Did a test;rebooted phone and checked battery in settings, seems like media scanning running 7-10 min then stops. After a few hours checked again and no media scanning. Great:fingers-crossed:
KNTXTremE said: Thanks. Include in AIO-X-TremEXD Mod Click to expand... Click to collapse you included in newest version (actual)? working?
My idea Another way, to prevent this battery drain I use Rescan Media ROOT (need ROOT) (you can download at market or link at Here) to "Disable and Kill the media scanner at boot.Scan Media Files on demand" Press thanks if it works for you
[Q] Where is the URL ?
Hi there I'd like to code a simple app for IOS devices which displays a feed available on a website, but I don't have URL to do that... There is an existing app for Android which do it well, so I've uncompiled this APK with APK Studio, with the hope of having the URL in clear in the code.... After hours of researches, I'm stuck with a constant "/data/", and an other ".xml", but don't have the middle ! I tried to show the URL in a Toast(), but the app still crashing (probably I do something wrong)... If someone has an idea... I'm waiting for it :/ Thanks ! Code: .method public static getFeeds(Ljava/lang/String;)Ljava/util/ArrayList; .locals 11 .param p0, "s" # Ljava/lang/String; .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/String;", ")", "Ljava/util/ArrayList", "<", "Lfr/.../.../.../...;", #Hidden by myself ">;" } .end annotation .prologue .line 31 invoke-static {}, Ljavax/xml/parsers/SAXParserFactory;->newInstance()Ljavax/xml/parsers/SAXParserFactory; move-result-object v3 .line 32 .local v3, "fabrique":Ljavax/xml/parsers/SAXParserFactory; const/4 v6, 0x0 .line 33 .local v6, "parseur":Ljavax/xml/parsers/SAXParser; const/4 v2, 0x0 .line 36 .local v2, "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lfr/.../.../.../...;>;" :try_start_0 invoke-virtual {v3}, Ljavax/xml/parsers/SAXParserFactory;->newSAXParser()Ljavax/xml/parsers/SAXParser; :try_end_0 .catch Ljavax/xml/parsers/ParserConfigurationException; {:try_start_0 .. :try_end_0} :catch_0 .catch Lorg/xml/sax/SAXException; {:try_start_0 .. :try_end_0} :catch_1 move-result-object v6 .line 44 :goto_0 const/4 v7, 0x0 .line 46 .local v7, "url":Ljava/net/URL; :try_start_1 new-instance v8, Ljava/net/URL; new-instance v9, Ljava/lang/StringBuilder; const-string v10, "/data/" invoke-direct {v9, v10}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V invoke-virtual {v9, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v9 const-string v10, ".xml" invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v9 invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v9 invoke-direct {v8, v9}, Ljava/net/URL;-><init>(Ljava/lang/String;)V :try_end_1 .catch Ljava/net/MalformedURLException; {:try_start_1 .. :try_end_1} :catch_4 .line 51 .end local v7 # "url":Ljava/net/URL; .local v8, "url":Ljava/net/URL; :try_start_2 new-instance v4, Lfr/.../.../.../.../ParserXMLHandler; invoke-direct {v4}, Lfr/.../.../.../.../ParserXMLHandler;-><init>()V :try_end_2 .catch Ljava/net/MalformedURLException; {:try_start_2 .. :try_end_2} :catch_5 .line 54 .local v4, "handler":Lorg/xml/sax/helpers/DefaultHandler; :try_start_3 invoke-virtual {v8}, Ljava/net/URL;->openStream()Ljava/io/InputStream; move-result-object v5 .line 55 .local v5, "input":Ljava/io/InputStream; if-nez v5, :cond_0 .line 56 const-string v9, "error android" const-string v10, "null" invoke-static {v9, v10}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I :try_end_3 .catch Lorg/xml/sax/SAXException; {:try_start_3 .. :try_end_3} :catch_2 .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_3 .catch Ljava/net/MalformedURLException; {:try_start_3 .. :try_end_3} :catch_5 move-object v7, v8 .line 71 .end local v4 # "handler":Lorg/xml/sax/helpers/DefaultHandler; .end local v5 # "input":Ljava/io/InputStream; .end local v8 # "url":Ljava/net/URL; .restart local v7 # "url":Ljava/net/URL; :goto_1 return-object v2 .line 37 .end local v7 # "url":Ljava/net/URL; :catch_0 move-exception v0 .line 38 .local v0, "e":Ljavax/xml/parsers/ParserConfigurationException; invoke-virtual {v0}, Ljavax/xml/parsers/ParserConfigurationException;->printStackTrace()V goto :goto_0 .line 39 .end local v0 # "e":Ljavax/xml/parsers/ParserConfigurationException; :catch_1 move-exception v0 .line 40 .local v0, "e":Lorg/xml/sax/SAXException; invoke-virtual {v0}, Lorg/xml/sax/SAXException;->printStackTrace()V goto :goto_0 .line 58 .end local v0 # "e":Lorg/xml/sax/SAXException; .restart local v4 # "handler":Lorg/xml/sax/helpers/DefaultHandler; .restart local v5 # "input":Ljava/io/InputStream; .restart local v8 # "url":Ljava/net/URL; :cond_0 :try_start_4 invoke-virtual {v6, v5, v4}, Ljavax/xml/parsers/SAXParser;->parse(Ljava/io/InputStream;Lorg/xml/sax/helpers/DefaultHandler;)V .line 60 check-cast v4, Lfr/.../.../.../.../ParserXMLHandler; .end local v4 # "handler":Lorg/xml/sax/helpers/DefaultHandler; invoke-virtual {v4}, Lfr/Lfr/.../.../.../.../ParserXMLHandler;->getData()Ljava/util/ArrayList; :try_end_4 .catch Lorg/xml/sax/SAXException; {:try_start_4 .. :try_end_4} :catch_2 .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_3 .catch Ljava/net/MalformedURLException; {:try_start_4 .. :try_end_4} :catch_5 move-result-object v2 move-object v7, v8 .line 62 .end local v8 # "url":Ljava/net/URL; .restart local v7 # "url":Ljava/net/URL; goto :goto_1 .end local v5 # "input":Ljava/io/InputStream; .end local v7 # "url":Ljava/net/URL; .restart local v8 # "url":Ljava/net/URL; :catch_2
[Q] Executing Shell Script on Preference Change/Click
I could really use a hand here, maybe with the right help, this can turn into a nice How To thread... Here's the situation... NOTE: I am on a Note 3 with Touchwiz Rom I'd like to add a customization to my Settings.apk (this part's not the problem), and have it fire off a bash script on selection (whether it's a simple tap-the-setting, checkbox, list item, etc...) Here is what I have thus far for my smali Code: .class public Lcom/android/settings/ExecSH; .super Lcom/android/settings/SettingsPreferenceFragment; .source "ExecSH.java" .implements Landroid/preference/Preference$OnPreferenceChangeListener; .implements Landroid/preference/Preference$OnPreferenceClickListener; # direct methods .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z :try_start_0 const-string v2, Landroid/preference/Preference;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference; # String of command to fire off invoke-static {v2}, Lcom/android/settings/ExecSH;->execRootCmdSilent(Ljava/lang/String;)I :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 .end method .method public static execRootCmdSilent(Ljava/lang/String;)I .locals 6 .parameter "paramString" .prologue .line 40 :try_start_0 const-string v4, "RootCmd" invoke-static {v4, p0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I .line 41 invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime; move-result-object v4 const-string v5, "su" invoke-virtual {v4, v5}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process; move-result-object v2 .line 42 .local v2, localProcess:Ljava/lang/Process; new-instance v0, Ljava/io/DataOutputStream; invoke-virtual {v2}, Ljava/lang/Process;->getOutputStream()Ljava/io/OutputStream; move-result-object v4 invoke-direct {v0, v4}, Ljava/io/DataOutputStream;-><init>(Ljava/io/OutputStream;)V .line 44 .local v0, localDataOutputStream:Ljava/io/DataOutputStream; new-instance v4, Ljava/lang/StringBuilder; invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v4, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v4 const-string v5, "\n" invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v4 invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 .line 45 .local v3, str:Ljava/lang/String; invoke-virtual {v0, v3}, Ljava/io/DataOutputStream;->writeBytes(Ljava/lang/String;)V .line 46 invoke-virtual {v0}, Ljava/io/DataOutputStream;->flush()V .line 47 const-string v4, "exit\n" invoke-virtual {v0, v4}, Ljava/io/DataOutputStream;->writeBytes(Ljava/lang/String;)V .line 48 invoke-virtual {v0}, Ljava/io/DataOutputStream;->flush()V .line 49 invoke-virtual {v2}, Ljava/lang/Process;->waitFor()I .line 50 invoke-virtual {v2}, Ljava/lang/Process;->exitValue()I :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 move-result v4 .line 55 .end local v0 #localDataOutputStream:Ljava/io/DataOutputStream; .end local v2 #localProcess:Ljava/lang/Process; .end local v3 #str:Ljava/lang/String; :goto_0 return v4 .line 52 :catch_0 move-exception v1 .line 53 .local v1, localException:Ljava/lang/Exception; invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V .line 55 const/4 v4, 0x1 goto :goto_0 .end method Will this do what I think it'll do? (I think it's grab the preference key and fire it off as a root command...