Power Battery v2.0.2版本的 MD5 值为:ca694e0112a4d0aa17ae668e765b51de
以下内容为反编译后的 BaseChargingActivity.java 源代码,内容仅作参考
package com.lionmobi.battery.activity;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.SystemClock;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import com.flurry.android.FlurryAgent;
import com.huawei.hms.ads.co;
import com.huawei.hms.ads.gk;
import com.lionmobi.battery.R;
import defpackage.tu;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Locale;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;
public class BaseChargingActivity extends Activity {
private String a;
private boolean b = false;
static void a(BaseChargingActivity baseChargingActivity) {
JSONObject jSONObject = new JSONObject();
String string = Settings.Secure.getString(baseChargingActivity.getContentResolver(), "android_id");
baseChargingActivity.getApplication();
try {
jSONObject.put("aid", string);
SharedPreferences localStatShared = vf.getLocalStatShared(baseChargingActivity);
String channel = ua.getChannel(baseChargingActivity);
String string2 = localStatShared.getString("from", "");
jSONObject.put("sub_ch", localStatShared.getString("sub_ch", ""));
String string3 = localStatShared.getString("referrer", "");
jSONObject.put("ch", channel);
if (TextUtils.isEmpty(string2)) {
if (TextUtils.isEmpty(channel)) {
channel = "empty";
}
string2 = channel;
localStatShared.edit().putString("from", string2).commit();
}
jSONObject.put("from", string2);
if (!"".equals(string3)) {
jSONObject.put("referrer", string3);
}
try {
tu.a advertisingIdInfo = tu.getAdvertisingIdInfo(baseChargingActivity);
boolean isLimitAdTrackingEnabled = advertisingIdInfo.isLimitAdTrackingEnabled();
jSONObject.put("gaid", isLimitAdTrackingEnabled ? "" : advertisingIdInfo.getId());
jSONObject.put("ad_tracking", !isLimitAdTrackingEnabled);
} catch (Exception unused) {
jSONObject.put("gaid", "");
jSONObject.put("ad_tracking", false);
}
jSONObject.put(gk.Z, "aid_sig_base");
jSONObject.put("client", 4);
try {
jSONObject.put("ver", baseChargingActivity.getPackageManager().getPackageInfo(baseChargingActivity.getApplication().getPackageName(), 0).versionCode);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
jSONObject.put("model", ug.getDeviceModel());
jSONObject.put("osver", ug.getOSVersion());
HttpPost httpPost = new HttpPost("https://analysis.lionmobi.com/api.php");
ArrayList arrayList = new ArrayList();
arrayList.add(new BasicNameValuePair("data", jSONObject.toString()));
arrayList.add(new BasicNameValuePair("sig", vk.MD5Encode("lionmobi" + jSONObject.toString() + "powerclean")));
try {
httpPost.setEntity(new UrlEncodedFormEntity(arrayList, co.Code));
HttpResponse execute = new DefaultHttpClient().execute(httpPost);
if (execute.getStatusLine().getStatusCode() == 200 && EntityUtils.toString(execute.getEntity()).equals("0")) {
localStatShared.edit().putInt("used_day_base", vk.getTodayDayInYear()).commit();
baseChargingActivity.sendBroadcast(new Intent("com.lionmobi.battery.base_stat"));
}
} catch (ClientProtocolException e2) {
e2.printStackTrace();
} catch (IOException e3) {
e3.printStackTrace();
}
} catch (Exception e4) {
e4.printStackTrace();
}
baseChargingActivity.b = false;
}
private void a(Locale locale) {
Configuration configuration = getResources().getConfiguration();
Resources resources = getResources();
DisplayMetrics displayMetrics = resources.getDisplayMetrics();
configuration.locale = locale;
resources.updateConfiguration(configuration, displayMetrics);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
getApplication();
try {
SharedPreferences localSettingShared = vf.getLocalSettingShared(this);
if (localSettingShared.contains("lion_language")) {
String string = localSettingShared.getString("lion_language", "DEFAULT");
if (string.equals("zh")) {
a(Locale.SIMPLIFIED_CHINESE);
return;
} else if (string.equals("zh-TW")) {
a(Locale.TAIWAN);
return;
} else if (string.equals("TW")) {
a(Locale.TAIWAN);
return;
} else if (string.equals("CN")) {
a(Locale.SIMPLIFIED_CHINESE);
return;
} else if (string.contains("de")) {
a(Locale.GERMAN);
return;
} else if (string.contains("pt")) {
a(new Locale("pt"));
return;
} else if (string.contains("ja")) {
a(Locale.JAPANESE);
return;
} else if (string.contains("ru")) {
a(new Locale("ru"));
return;
} else if (string.contains("th")) {
a(new Locale("th"));
return;
} else if (string.contains("es")) {
a(new Locale("es"));
return;
} else if (string.contains("fr")) {
a(new Locale("fr"));
return;
} else if (string.contains("it")) {
a(new Locale("it"));
return;
} else if (string.contains("in")) {
a(new Locale("in"));
return;
} else if (string.contains("tr")) {
a(new Locale("tr"));
return;
} else if (string.contains("ko")) {
a(new Locale("ko"));
return;
} else if (string.contains("vi")) {
a(new Locale("vi"));
return;
} else if (string.contains("hi")) {
a(new Locale("hi"));
return;
} else if (string.contains("ar")) {
a(new Locale("ar"));
return;
} else {
a(Locale.ENGLISH);
return;
}
}
Locale locale = new Locale(Locale.getDefault().getLanguage(), Locale.getDefault().getCountry());
if (!locale.getCountry().equals("TW") && !locale.getCountry().equals("HK")) {
if (locale.getCountry().equals("CN")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "CN").commit();
a(Locale.SIMPLIFIED_CHINESE);
return;
} else if (locale.getLanguage().contains("de")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "de").commit();
a(Locale.GERMAN);
return;
} else if (locale.getLanguage().contains("pt")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "pt").commit();
a(new Locale("pt"));
return;
} else if (locale.getLanguage().contains("ru")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "ru").commit();
a(new Locale("ru"));
return;
} else if (locale.getLanguage().contains("ja")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "ja").commit();
a(Locale.JAPANESE);
return;
} else if (locale.getLanguage().contains("th")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "th").commit();
a(new Locale("th"));
return;
} else if (locale.getLanguage().contains("es")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "es").commit();
a(new Locale("es"));
return;
} else if (locale.getLanguage().contains("fr")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "fr").commit();
a(new Locale("fr"));
return;
} else if (locale.getLanguage().contains("it")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "it").commit();
a(new Locale("it"));
return;
} else if (locale.getLanguage().contains("in")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "in").commit();
a(new Locale("in"));
return;
} else if (locale.getLanguage().contains("tr")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "tr").commit();
a(new Locale("tr"));
return;
} else if (locale.getLanguage().contains("ko")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "ko").commit();
a(new Locale("ko"));
return;
} else if (locale.getLanguage().contains("vi")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "vi").commit();
a(new Locale("vi"));
return;
} else if (locale.getLanguage().contains("hi")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "hi").commit();
a(new Locale("hi"));
return;
} else if (locale.getLanguage().contains("ar")) {
vf.getLocalSettingShared(this).edit().putString("lion_language", "ar").commit();
a(new Locale("ar"));
return;
} else {
vf.getLocalSettingShared(this).edit().putString("lion_language", "en").commit();
a(Locale.ENGLISH);
return;
}
}
vf.getLocalSettingShared(this).edit().putString("lion_language", "TW").commit();
a(Locale.TAIWAN);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onDestroy() {
super.onDestroy();
}
public void onFragmentChange(String str) {
}
@Override
public void onPause() {
super.onPause();
}
@Override
public void onResume() {
super.onResume();
try {
PackageManager packageManager = getPackageManager();
ActivityInfo activityInfo = packageManager.getActivityInfo(getComponentName(), 0);
String charSequence = activityInfo.loadLabel(packageManager).toString();
String string = getResources().getString(R.string.app_name);
if (charSequence == null || "".equals(charSequence) || string.equals(charSequence)) {
String str = activityInfo.name;
charSequence = str.substring(str.lastIndexOf(".") + 1);
}
FlurryAgent.logEvent(charSequence);
this.a = charSequence;
} catch (Exception unused) {
}
FlurryAgent.onPageView();
sendBaseData();
}
@Override
protected void onStart() {
FlurryAgent.onStartSession(this);
super.onStart();
}
@Override
protected void onStop() {
FlurryAgent.onEndSession(this);
super.onStop();
}
public void sendBaseData() {
if (vf.getLocalStatShared(this).getInt("used_day_base", 0) == vk.getTodayDayInYear() || this.b) {
return;
}
this.b = true;
new Thread(new Runnable() {
@Override
public final void run() {
if (vf.getLocalStatShared(BaseChargingActivity.this).getInt("used_day_base", 0) == 0) {
SystemClock.sleep(8000L);
}
BaseChargingActivity.a(BaseChargingActivity.this);
}
}).start();
}
public void setAdClick() {
}
}