[Q] Where is the URL ? - Android Q&A, Help & Troubleshooting

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

Related

[Decompiled] Asus - UnLock_Device_App_V6

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.

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] 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

[help] How to remove XPERIA Home launcher animation

I do not speak English.
I want to remove XPERIA Home launcher animation.
Click to open the APP animation.
How do I modify this code?
com.sonyericsson.home 6.2.1.A.0.7
\smali\com\sonymobile\home\presenter\view\ActivityItemView.smali
# virtual methods
.method protected doHandleClick(Landroid/content/ContextZ
.locals 9
.parameter "context"
.prologue
const/4 v5, 0x0
.line 52
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getItem()Lcom/sonymobile/home/data/Item;
move-result-object v6
invoke-virtual {v6}, Lcom/sonymobile/home/data/Item;->getIntent()Landroid/content/Intent;
move-result-object v2
.line 53
.local v2, intent:Landroid/content/Intent;
if-eqz v2, :cond_0
.line 59
:try_start_0
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getWorldX()F
move-result v6
const/4 v7, 0x0
invoke-virtual {p0, v7}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getPointX(F)F
move-result v7
add-float/2addr v6, v7
float-to-int v3, v6
.line 60
.local v3, x:I
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getWorldY()F
move-result v6
const/4 v7, 0x0
invoke-virtual {p0, v7}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getPointY(F)F
move-result v7
add-float/2addr v6, v7
float-to-int v4, v6
.line 61
.local v4, y:I
iget-object v6, p0, Lcom/sonymobile/flix/components/Component;->mScene:Lcom/sonymobile/flix/components/Scene;
invoke-virtual {v6}, Lcom/sonymobile/flix/components/Scene;->getView()Landroid/view/View;
move-result-object v6
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getWidth()F
move-result v7
float-to-int v7, v7
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getHeight()F
move-result v8
float-to-int v8, v8
invoke-static {v6, v3, v4, v7, v8}, Landroid/app/ActivityOptions;->makeScaleUpAnimation(Landroid/view/View;IIII)Landroid/app/ActivityOptions;
move-result-object v6
invoke-virtual {v6}, Landroid/app/ActivityOptions;->toBundle()Landroid/os/Bundle;
move-result-object v0
.line 65
.local v0, bundle:Landroid/os/Bundle;
const/high16 v6, 0x1000
invoke-virtual {v2, v6}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
.line 66
const/high16 v6, 0x20
invoke-virtual {v2, v6}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
.line 68
invoke-virtual {p1, v2, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;Landroid/os/BundleV
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 75
const/4 v5, 0x1
.line 78
.end local v0 #bundle:Landroid/os/Bundle;
.end local v3 #x:I
.end local v4 #y:I
:cond_0
:goto_0
return v5
.line 69
:catch_0
move-exception v1
.line 70
.local v1, e:Ljava/lang/Exception;
const v6, 0x7f06001b
invoke-static {p1, v6, v5}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;
move-result-object v6
invoke-virtual {v6}, Landroid/widget/Toast;->show()V
goto :goto_0
.end method
Click to expand...
Click to collapse

[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...

Categories

Resources