佳GO v3.0.0版本的 MD5 值为:febdbe251c5346d8ea051b2f02d4ce89
以下内容为反编译后的 gs2.java 源代码,内容仅作参考
package p.a.y.e.a.s.e.net;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.os.Build;
import android.text.TextUtils;
import com.ehking.sdk.wepay.ui.activity.AuthenticationPhoneActivity;
import com.meizu.cloud.pushsdk.handler.impl.model.PlatformMessage;
import java.util.TreeMap;
import org.json.JSONObject;
public class gs2 {
private static fs2 lite_do;
private static a lite_if;
public interface a {
void a();
}
public static void lite_byte(a aVar) {
lite_if = aVar;
}
private static boolean lite_case(Context context) {
return context.getPackageName().equals("com.xiaomi.xmsf");
}
public static synchronized fs2 lite_do(Context context) {
synchronized (gs2.class) {
fs2 fs2Var = lite_do;
if (fs2Var != null) {
return fs2Var;
}
SharedPreferences sharedPreferences = context.getSharedPreferences("mipush_account", 0);
String string = sharedPreferences.getString("uuid", null);
String string2 = sharedPreferences.getString("token", null);
String string3 = sharedPreferences.getString("security", null);
String string4 = sharedPreferences.getString("app_id", null);
String string5 = sharedPreferences.getString("app_token", null);
String string6 = sharedPreferences.getString(ye2.lite_boolean, null);
String string7 = sharedPreferences.getString(PlatformMessage.PLATFORM_DEVICE_ID, null);
int i = sharedPreferences.getInt("env_type", 1);
if (!TextUtils.isEmpty(string7) && vo2.lite_long(string7)) {
string7 = vo2.lite_boolean(context);
sharedPreferences.edit().putString(PlatformMessage.PLATFORM_DEVICE_ID, string7).commit();
}
if (TextUtils.isEmpty(string) || TextUtils.isEmpty(string2) || TextUtils.isEmpty(string3)) {
return null;
}
String lite_boolean = vo2.lite_boolean(context);
if (!"com.xiaomi.xmsf".equals(context.getPackageName()) && !TextUtils.isEmpty(lite_boolean) && !TextUtils.isEmpty(string7) && !string7.equals(lite_boolean)) {
yd2.lite_char("read_phone_state permission changes.");
}
fs2 fs2Var2 = new fs2(string, string2, string3, string4, string5, string6, i);
lite_do = fs2Var2;
return fs2Var2;
}
}
public static String lite_for(Context context) {
StringBuilder b;
String str;
String lite_if2 = yp2.lite_do(context).lite_if();
if (nh2.lite_int()) {
b = r5.b("http://");
b.append(dn2.lite_private);
str = ":9085";
} else if (com.xiaomi.push.o.China.name().equals(lite_if2)) {
b = new StringBuilder();
str = "https://cn.register.xmpush.xiaomi.com";
} else if (com.xiaomi.push.o.Global.name().equals(lite_if2)) {
b = new StringBuilder();
str = "https://register.xmpush.global.xiaomi.com";
} else if (com.xiaomi.push.o.Europe.name().equals(lite_if2)) {
b = new StringBuilder();
str = "https://fr.register.xmpush.global.xiaomi.com";
} else if (com.xiaomi.push.o.Russia.name().equals(lite_if2)) {
b = new StringBuilder();
str = "https://ru.register.xmpush.global.xiaomi.com";
} else if (com.xiaomi.push.o.India.name().equals(lite_if2)) {
b = new StringBuilder();
str = "https://idmb.register.xmpush.global.xiaomi.com";
} else {
b = r5.b("https://");
str = nh2.lite_for() ? "sandbox.xmpush.xiaomi.com" : "register.xmpush.xiaomi.com";
}
return r5.lite_volatile(b, str, "/pass/v2/register");
}
public static synchronized fs2 lite_if(Context context, String str, String str2, String str3) {
String str4;
String lite_short;
String lite_break;
int lite_for;
String lite_finally;
String lite_do2;
synchronized (gs2.class) {
TreeMap treeMap = new TreeMap();
String lite_char = vo2.lite_char(context, false);
yd2.lite_char("account register:" + lite_char);
treeMap.put("devid", lite_char);
treeMap.put("devid1", vo2.lite_case(context));
fs2 fs2Var = lite_do;
if (fs2Var != null && !TextUtils.isEmpty(fs2Var.lite_do)) {
treeMap.put("uuid", lite_do.lite_do);
int lastIndexOf = lite_do.lite_do.lastIndexOf(AuthenticationPhoneActivity.WHITE_SPACE);
if (lastIndexOf != -1) {
str4 = lite_do.lite_do.substring(lastIndexOf + 1);
gi2.lite_do(context).lite_for(treeMap);
lite_short = vo2.lite_short(context);
if (lite_short != null) {
treeMap.put("vdevid", lite_short);
}
lite_break = vo2.lite_break(context);
if (!TextUtils.isEmpty(lite_break)) {
treeMap.put("gaid", lite_break);
}
if (lite_case(context)) {
str2 = "1000271";
}
String str5 = str2;
if (lite_case(context)) {
str3 = "420100086271";
}
String str6 = str3;
if (lite_case(context)) {
str = "com.xiaomi.xmsf";
}
String str7 = str;
treeMap.put("appid", str5);
treeMap.put("apptoken", str6);
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(str7, 16384);
treeMap.put("appversion", packageInfo == null ? String.valueOf(packageInfo.versionCode) : "0");
treeMap.put("sdkversion", Integer.toString(30705));
treeMap.put("packagename", str7);
treeMap.put("model", Build.MODEL);
treeMap.put("board", Build.BOARD);
if (!pp2.lite_goto()) {
String str8 = "";
String lite_public = vo2.lite_public(context);
if (!TextUtils.isEmpty(lite_public)) {
str8 = "" + si2.lite_if(lite_public);
}
String lite_static = vo2.lite_static(context);
if (!TextUtils.isEmpty(str8) && !TextUtils.isEmpty(lite_static)) {
str8 = str8 + ye2.lite_const + lite_static;
}
if (!TextUtils.isEmpty(str8)) {
treeMap.put(ye2.lite_int, str8);
}
}
treeMap.put("os", Build.VERSION.RELEASE + ye2.lite_final + Build.VERSION.INCREMENTAL);
lite_for = vo2.lite_for();
if (lite_for >= 0) {
treeMap.put("space_id", Integer.toString(lite_for));
}
lite_finally = vo2.lite_finally(context);
if (!TextUtils.isEmpty(lite_finally)) {
treeMap.put("mac_address", si2.lite_if(lite_finally));
}
treeMap.put("android_id", vo2.lite_native(context));
treeMap.put(ye2.lite_throws, Build.BRAND + "");
treeMap.put("ram", vo2.lite_void());
treeMap.put("rom", vo2.lite_float());
ji2 lite_int = li2.lite_int(context, lite_for(context), treeMap);
lite_do2 = lite_int != null ? lite_int.lite_do() : "";
if (!TextUtils.isEmpty(lite_do2)) {
JSONObject jSONObject = new JSONObject(lite_do2);
if (jSONObject.getInt("code") == 0) {
JSONObject jSONObject2 = jSONObject.getJSONObject("data");
String string = jSONObject2.getString("ssecurity");
String string2 = jSONObject2.getString("token");
String string3 = jSONObject2.getString("userId");
if (TextUtils.isEmpty(str4)) {
str4 = u3.lite_const + si2.lite_do(6);
}
fs2 fs2Var2 = new fs2(string3 + "@xiaomi.com/" + str4, string2, string, str5, str6, str7, nh2.lite_do());
lite_try(context, fs2Var2);
vo2.lite_else(context, jSONObject2.optString("vdevid"));
lite_do = fs2Var2;
return fs2Var2;
}
js2.lite_do(context, jSONObject.getInt("code"), jSONObject.optString("description"));
yd2.lite_char(lite_do2);
}
return null;
}
}
str4 = null;
gi2.lite_do(context).lite_for(treeMap);
lite_short = vo2.lite_short(context);
if (lite_short != null) {
}
lite_break = vo2.lite_break(context);
if (!TextUtils.isEmpty(lite_break)) {
}
if (lite_case(context)) {
}
String str52 = str2;
if (lite_case(context)) {
}
String str62 = str3;
if (lite_case(context)) {
}
String str72 = str;
treeMap.put("appid", str52);
treeMap.put("apptoken", str62);
PackageInfo packageInfo2 = context.getPackageManager().getPackageInfo(str72, 16384);
treeMap.put("appversion", packageInfo2 == null ? String.valueOf(packageInfo2.versionCode) : "0");
treeMap.put("sdkversion", Integer.toString(30705));
treeMap.put("packagename", str72);
treeMap.put("model", Build.MODEL);
treeMap.put("board", Build.BOARD);
if (!pp2.lite_goto()) {
}
treeMap.put("os", Build.VERSION.RELEASE + ye2.lite_final + Build.VERSION.INCREMENTAL);
lite_for = vo2.lite_for();
if (lite_for >= 0) {
}
lite_finally = vo2.lite_finally(context);
if (!TextUtils.isEmpty(lite_finally)) {
}
treeMap.put("android_id", vo2.lite_native(context));
treeMap.put(ye2.lite_throws, Build.BRAND + "");
treeMap.put("ram", vo2.lite_void());
treeMap.put("rom", vo2.lite_float());
ji2 lite_int2 = li2.lite_int(context, lite_for(context), treeMap);
if (lite_int2 != null) {
}
if (!TextUtils.isEmpty(lite_do2)) {
}
return null;
}
}
public static void lite_int() {
a aVar = lite_if;
if (aVar != null) {
aVar.a();
}
}
public static void lite_new(Context context) {
context.getSharedPreferences("mipush_account", 0).edit().clear().commit();
lite_do = null;
lite_int();
}
public static void lite_try(Context context, fs2 fs2Var) {
SharedPreferences.Editor edit = context.getSharedPreferences("mipush_account", 0).edit();
edit.putString("uuid", fs2Var.lite_do);
edit.putString("security", fs2Var.lite_for);
edit.putString("token", fs2Var.lite_if);
edit.putString("app_id", fs2Var.lite_int);
edit.putString(ye2.lite_boolean, fs2Var.lite_try);
edit.putString("app_token", fs2Var.lite_new);
edit.putString(PlatformMessage.PLATFORM_DEVICE_ID, vo2.lite_boolean(context));
edit.putInt("env_type", fs2Var.lite_byte);
edit.commit();
lite_int();
}
}