- Imported from https://github.com/supermegamestre/Project-Real-Resurrection-3 - APKTool decompilation (Smali bytecode) for modding and rebuilding APK - Supports both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) architectures - Includes full Smali source, resources, and native libraries - Ready to rebuild APK after modifications with apktool b command - Added comprehensive README-apktool.md with modding guide This branch complements the JADX branches: - Use JADX (main/discord-community) to UNDERSTAND code (readable Java) - Use APKTool (this branch) to MODIFY and REBUILD APK (editable Smali) Total: 44,417 files, 538.51 MB Smali source code
497 lines
9.3 KiB
Smali
497 lines
9.3 KiB
Smali
.class public abstract Lcom/helpshift/util/Utils;
|
|
.super Ljava/lang/Object;
|
|
.source "SourceFile"
|
|
|
|
|
|
# direct methods
|
|
.method public static closeQuietly(Ljava/io/Closeable;)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 166
|
|
:try_start_0
|
|
invoke-interface {p0}, Ljava/io/Closeable;->close()V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:catch_0
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static isEmpty(Ljava/lang/String;)Z
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 118
|
|
invoke-virtual {p0}, Ljava/lang/String;->trim()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result p0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p0, 0x1
|
|
|
|
:goto_1
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isEmpty(Ljava/util/Map;)Z
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 126
|
|
invoke-interface {p0}, Ljava/util/Map;->isEmpty()Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p0, 0x1
|
|
|
|
:goto_1
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isEmpty(Lorg/json/JSONArray;)Z
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 130
|
|
invoke-virtual {p0}, Lorg/json/JSONArray;->length()I
|
|
|
|
move-result p0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p0, 0x1
|
|
|
|
:goto_1
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isNotEmpty(Ljava/lang/String;)Z
|
|
.locals 0
|
|
|
|
.line 114
|
|
invoke-static {p0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
|
|
|
|
move-result p0
|
|
|
|
xor-int/lit8 p0, p0, 0x1
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isNotEmpty(Ljava/util/Map;)Z
|
|
.locals 0
|
|
|
|
.line 122
|
|
invoke-static {p0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/util/Map;)Z
|
|
|
|
move-result p0
|
|
|
|
xor-int/lit8 p0, p0, 0x1
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isToday(J)Z
|
|
.locals 4
|
|
|
|
.line 207
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/32 v2, 0x5265c00
|
|
|
|
.line 208
|
|
div-long/2addr p0, v2
|
|
|
|
.line 209
|
|
div-long/2addr v0, v2
|
|
|
|
cmp-long p0, p0, v0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isValidJsonString(Ljava/lang/String;)Z
|
|
.locals 1
|
|
|
|
.line 145
|
|
:try_start_0
|
|
new-instance v0, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v0, p0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 149
|
|
:catch_0
|
|
:try_start_1
|
|
new-instance v0, Lorg/json/JSONArray;
|
|
|
|
invoke-direct {v0, p0}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
:goto_0
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:catch_1
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static join(Ljava/lang/CharSequence;Ljava/lang/Iterable;)Ljava/lang/String;
|
|
.locals 3
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
|
|
.line 187
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
.line 189
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
.line 194
|
|
:cond_1
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/StringBuilder;
|
|
|
|
.line 196
|
|
:goto_1
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_0
|
|
|
|
.line 198
|
|
:cond_2
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static jsonStringToMap(Ljava/lang/String;)Ljava/util/Map;
|
|
.locals 4
|
|
|
|
.line 51
|
|
invoke-static {p0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
invoke-static {p0}, Lcom/helpshift/util/Utils;->isValidJsonString(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 56
|
|
:cond_0
|
|
:try_start_0
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
.line 57
|
|
new-instance v1, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v1, p0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 58
|
|
invoke-virtual {v1}, Lorg/json/JSONObject;->keys()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
.line 59
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 60
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
.line 61
|
|
invoke-virtual {v1, v2}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v0, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
:try_end_0
|
|
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
return-object v0
|
|
|
|
:goto_1
|
|
const-string v0, "Utils"
|
|
|
|
const-string v1, "Error in creating map from string json"
|
|
|
|
.line 66
|
|
invoke-static {v0, v1, p0}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
.line 69
|
|
new-instance p0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
return-object p0
|
|
|
|
.line 52
|
|
:cond_2
|
|
:goto_2
|
|
new-instance p0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static jsonStringToStringMap(Ljava/lang/String;)Ljava/util/Map;
|
|
.locals 4
|
|
|
|
.line 78
|
|
invoke-static {p0}, Lcom/helpshift/util/Utils;->isEmpty(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
invoke-static {p0}, Lcom/helpshift/util/Utils;->isValidJsonString(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 83
|
|
:cond_0
|
|
:try_start_0
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
.line 84
|
|
new-instance v1, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v1, p0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 85
|
|
invoke-virtual {v1}, Lorg/json/JSONObject;->keys()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
.line 86
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 87
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
.line 88
|
|
invoke-virtual {v1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v0, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
return-object v0
|
|
|
|
:goto_1
|
|
const-string v0, "Utils"
|
|
|
|
const-string v1, "Error in creating map from string json"
|
|
|
|
.line 93
|
|
invoke-static {v0, v1, p0}, Lcom/helpshift/log/HSLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
.line 96
|
|
new-instance p0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
return-object p0
|
|
|
|
.line 79
|
|
:cond_2
|
|
:goto_2
|
|
new-instance p0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static listToJSONArray(Ljava/util/List;)Lorg/json/JSONArray;
|
|
.locals 1
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 100
|
|
invoke-interface {p0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 104
|
|
:cond_0
|
|
new-instance v0, Lorg/json/JSONArray;
|
|
|
|
invoke-direct {v0, p0}, Lorg/json/JSONArray;-><init>(Ljava/util/Collection;)V
|
|
|
|
return-object v0
|
|
|
|
.line 101
|
|
:cond_1
|
|
:goto_0
|
|
new-instance p0, Lorg/json/JSONArray;
|
|
|
|
invoke-direct {p0}, Lorg/json/JSONArray;-><init>()V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static mapToJsonString(Ljava/util/Map;)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 37
|
|
new-instance v0, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v0, p0}, Lorg/json/JSONObject;-><init>(Ljava/util/Map;)V
|
|
|
|
invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string p0, ""
|
|
|
|
return-object p0
|
|
.end method
|