360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0
以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考
package com.qihoo.appstore.activities;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.NotificationManager;
import android.content.ComponentCallbacks2;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
import android.os.Process;
import android.os.StrictMode;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewStub;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.qihoo.appstore.AppStoreApplication;
import com.qihoo.appstore.PermForwardService;
import com.qihoo.appstore.book.BookActivity;
import com.qihoo.appstore.clear.AppStartTimeHelper;
import com.qihoo.appstore.clear.MobileClearLauncher;
import com.qihoo.appstore.express.DownloadCoreService;
import com.qihoo.appstore.express.PushMessageHandle;
import com.qihoo.appstore.newAppInfo.NewCommentActivity;
import com.qihoo.appstore.newHomePage.HomeActivity;
import com.qihoo.appstore.newadmin.AppUninstallActivity;
import com.qihoo.appstore.newadmin.AppUpdateActivityWrapper;
import com.qihoo.appstore.newadmin.NewAdminFragment;
import com.qihoo.appstore.newapplist.AppEssentialActivity;
import com.qihoo.appstore.newdlfragment.DownloadPcActivityImpl;
import com.qihoo.appstore.newframe.HomeTitleAvatarIcon;
import com.qihoo.appstore.personnalcenter.friends.FriendAppPageActivity;
import com.qihoo.appstore.personnalcenter.friends.FriendRelationshipActivity;
import com.qihoo.appstore.personnalcenter.lbs.LbsActivity;
import com.qihoo.appstore.resource.app.App;
import com.qihoo.appstore.ui.UserGuideLayout;
import com.qihoo.appstore.utils.UpdateManager;
import com.qihoo.appstore.video.SavingTrafficDownloadActivity;
import com.qihoo.appstore.video.VideoMainActivity;
import com.qihoo.appstore.yjzj.YJZJActivity;
import com.qihoo.explorer.model.FileItem;
import com.qihoo.express.mini.service.DaemonCoreService;
import com.qihoo.freewifi.push.R;
import com.qihoo.rtservice.TempRoot;
import com.qihoo.speedometer.Config;
import com.qihoo.speedometer.HttpConst;
import com.qihoo.speedometer.NetworkDetectActivity;
import com.qihoo.speedometer.NetworkIsNotOkActivity;
import com.qihoo.speedometer.NetworkMonitor;
import com.slidingmenu.lib.SlidingMenu;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
@SuppressLint({"NewApi"})
@TargetApi(9)
public class MainActivity extends MainActivityBase implements View.OnClickListener, com.qihoo.appstore.utils.da, NetworkMonitor.NetworkMonitorObserver, com.slidingmenu.lib.j {
private static MainActivity C;
private static UserGuideLayout aa;
private Button A;
private UpdateManager D;
private com.qihoo.appstore.personnalcenter.sdk.e E;
private com.qihoo.appstore.personnalcenter.h F;
private boolean I;
private ViewGroup J;
private int K;
private AlertDialog N;
private ScrollView ad;
private View ae;
public boolean k;
public SlidingMenu m;
FrameLayout o;
ImageView p;
RelativeLayout q;
View s;
TextView t;
View u;
private HomeTitleAvatarIcon y;
private Button z;
public static final int e = new Random().nextInt(1000) + 1000;
private static boolean G = false;
private static Intent H = null;
private static Set L = new HashSet();
private static int M = 0;
public static boolean g = false;
public static boolean i = false;
private static com.qihoo.alliance.d S = new ey();
private static String ab = "pref_key_user_guide_300030190";
private static String ac = Config.INVALID_IP;
public FrameLayout f670a = null;
public FrameLayout f671b = null;
private View B = null;
public final String c = "onCreate";
public final String d = "onNewIntent";
public int f = 600;
private final LinkedList O = new LinkedList();
public boolean h = false;
private final Handler P = new cs(this);
private boolean Q = false;
int j = 1;
private int R = 0;
private boolean T = false;
private boolean U = false;
public boolean l = false;
private boolean V = false;
private com.qihoo.appstore.personnalcenter.p W = new cv(this);
private final com.qihoo.appstore.newadmin.o X = new cy(this);
private final AtomicBoolean Y = new AtomicBoolean();
private boolean Z = false;
int n = -1;
public Handler r = new Handler();
public boolean v = false;
View.OnClickListener w = new er(this);
private final String af = "http://huodong.mobilem.360.cn/quanmin/detail?webpg=qmshf";
private boolean M() {
if (this.O == null || this.O.size() <= 0) {
return false;
}
String str = (String) this.O.getFirst();
if (str == null) {
return true;
}
ComponentCallbacks2 activity = K().getActivity(str);
String statTag = activity instanceof com.qihoo.appstore.g ? ((com.qihoo.appstore.g) activity).getStatTag() : Config.INVALID_IP;
return (statTag == null || statTag.length() == 0) ? false : true;
}
private StringBuilder N() {
StringBuilder sb = new StringBuilder();
boolean z = true;
Iterator it = this.O.iterator();
while (true) {
boolean z2 = z;
if (!it.hasNext()) {
return sb;
}
String str = (String) it.next();
if (str == null) {
if (!z2) {
sb.append("_");
}
if (c() instanceof HomeActivity) {
sb.append(((HomeActivity) c()).mStatTag);
z = false;
} else {
sb.append("homejx");
z = false;
}
} else {
ComponentCallbacks2 activity = K().getActivity(str);
if (activity instanceof com.qihoo.appstore.g) {
if (!z2) {
sb.append("_");
}
sb.append(((com.qihoo.appstore.g) activity).getStatTag());
z = false;
} else {
z = z2;
}
}
}
}
private boolean O() {
boolean z = this.Q && this.O.size() == this.j;
if (z) {
this.Q = false;
this.j = 1;
finish();
com.qihoo.appstore.f.g.o();
}
return z;
}
private String P() {
int i2 = this.R;
this.R = i2 + 1;
return String.format("child_%d", Integer.valueOf(i2));
}
private void Q() {
String action = getIntent().getAction();
this.r.post(new ej(this, action));
this.r.postDelayed(new ew(this), com.qihoo.appstore.r.g.a() == 1 ? 2000 : TempRoot.ROOT_SUCCESS);
com.qihoo.appstore.utils.aj.b().schedule(new fa(this, action), 6000L, TimeUnit.MILLISECONDS);
AppStoreApplication.a(new ex(this, action));
try {
com.qihoo.alliance.e.a(getApplicationContext(), 180000 + new Random().nextInt(120001), S);
} catch (Exception e2) {
}
com.qihoo.appstore.provider.a.a.a().e();
}
public void R() {
if (this.V) {
return;
}
if (!this.l && !com.qihoo.appstore.utils.de.p(this)) {
this.U = true;
runOnUiThread(new cu(this));
} else {
if (com.qihoo.appstore.personnalcenter.g.a(C)) {
l();
return;
}
this.T = true;
if (com.qihoo.appstore.personnalcenter.g.b(getBaseContext(), "qt", Config.INVALID_IP).length() > 0) {
a((String) null);
} else {
j();
}
}
}
private static void S() {
try {
String str = com.qihoo.appstore.utils.dc.g(AppStoreApplication.d()) + "&page=1";
com.qihoo.appstore.http.z.a().a(str, new cw(str));
} catch (Exception e2) {
}
}
private void T() {
this.r.postDelayed(new cx(this), 50L);
}
public void U() {
BufferedInputStream bufferedInputStream;
HttpURLConnection httpURLConnection;
HttpURLConnection httpURLConnection2 = null;
r2 = null;
BufferedInputStream bufferedInputStream2 = null;
if (Build.VERSION.SDK_INT < 8) {
System.setProperty("http.keepAlive", "false");
}
File m = m();
if (m == null) {
return;
}
try {
try {
FileOutputStream fileOutputStream = new FileOutputStream(m);
try {
HttpURLConnection httpURLConnection3 = (HttpURLConnection) new URL("http://openbox.mobilem.360.cn/html/api/special.html").openConnection();
try {
bufferedInputStream = new BufferedInputStream(httpURLConnection3.getInputStream(), 8192);
while (true) {
try {
int read = bufferedInputStream.read();
if (read == -1) {
break;
} else {
fileOutputStream.write(read);
}
} catch (IOException e2) {
bufferedInputStream2 = bufferedInputStream;
e = e2;
httpURLConnection = httpURLConnection3;
try {
e.printStackTrace();
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
if (fileOutputStream != null) {
fileOutputStream.close();
}
if (bufferedInputStream2 != null) {
bufferedInputStream2.close();
return;
}
return;
} catch (Throwable th) {
th = th;
bufferedInputStream = bufferedInputStream2;
httpURLConnection2 = httpURLConnection;
if (httpURLConnection2 != null) {
httpURLConnection2.disconnect();
}
if (fileOutputStream != null) {
try {
fileOutputStream.close();
} catch (IOException e3) {
throw th;
}
}
if (bufferedInputStream != null) {
bufferedInputStream.close();
}
throw th;
}
} catch (Throwable th2) {
httpURLConnection2 = httpURLConnection3;
th = th2;
if (httpURLConnection2 != null) {
}
if (fileOutputStream != null) {
}
if (bufferedInputStream != null) {
}
throw th;
}
}
if (httpURLConnection3 != null) {
httpURLConnection3.disconnect();
}
if (fileOutputStream != null) {
fileOutputStream.close();
}
if (bufferedInputStream != null) {
bufferedInputStream.close();
}
} catch (IOException e4) {
httpURLConnection = httpURLConnection3;
e = e4;
} catch (Throwable th3) {
bufferedInputStream = null;
httpURLConnection2 = httpURLConnection3;
th = th3;
}
} catch (IOException e5) {
e = e5;
httpURLConnection = null;
} catch (Throwable th4) {
th = th4;
bufferedInputStream = null;
}
} catch (IOException e6) {
}
} catch (FileNotFoundException e7) {
e7.printStackTrace();
}
}
private void V() {
com.qihoo.appstore.o.a.c.a(this, com.qihoo.appstore.o.a.c.c(this), com.qihoo.appstore.o.a.c.a(this));
}
private String W() {
return "pref_key_new_feature_guide_300030175" + this.K;
}
private void X() {
g = true;
com.qihoo.appstore.utils.dc.j(this);
com.qihoo.appstore.f.g.m();
}
private boolean Y() {
Intent intent = getIntent();
if (intent == null) {
return false;
}
String stringExtra = intent.getStringExtra("from");
String stringExtra2 = intent.getStringExtra("from_out_side");
if (TextUtils.isEmpty(stringExtra) || !(stringExtra.startsWith("360MobileSafe.MainScreen") || stringExtra.startsWith("360MobileSafe.MobileNess") || stringExtra.startsWith("360MobileSafe.MobileAppMGr") || stringExtra.startsWith("360MobileSafe.MobileAppMGr") || stringExtra.startsWith("360MobileSafe.MobileAppBarcode") || stringExtra.startsWith("360MobileSafe.MobileAppFloatView") || stringExtra.startsWith("360MobileSafe.MobileAppSoftUpgrade"))) {
return stringExtra2 != null && stringExtra2.equals("360MobileSafe.MobileAppMGr");
}
return true;
}
public void Z() {
TextView textView;
if (com.qihoo.appstore.utils.ac.a("show_mobile_clear_icon", this) || (textView = (TextView) findViewById(R.id.mobile_clear)) == null) {
return;
}
textView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.sillding_menu_mobile_clear, 0, 0, 0);
}
public static int a() {
return M;
}
private int a(Bundle bundle) {
int i2 = 0;
if (bundle != null) {
String string = bundle.getString("activityKey");
String string2 = bundle.getString("from");
if (string == null) {
string = bundle.getString("activity_key");
}
if (!string.equalsIgnoreCase("home")) {
if (string.equalsIgnoreCase("admin")) {
i2 = (string2.equals("360MobileSafe.MobileAppFloatView") || string2.equals("360MobileSafe.MobileAppSoftUpgrade") || string2.equals("360Launcher")) ? 17 : 4;
} else if (string.equalsIgnoreCase("category")) {
i2 = 11;
} else if (string.equalsIgnoreCase("update")) {
com.qihoo.appstore.l.d.a(getApplicationContext(), false, false);
i2 = 17;
} else if (string.equalsIgnoreCase("download")) {
i2 = 5000;
c(bundle);
} else if (string.equalsIgnoreCase("recommend")) {
i2 = 10;
} else if (string.equalsIgnoreCase("appInfo")) {
String string3 = bundle.getString("search_content");
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "----pkgName=" + string3);
}
if (com.qihoo.appstore.utils.de.l(string3)) {
App app = new App();
app.m(string3);
bundle.putParcelable("com.qihoo.appstore.App", app);
i2 = 7;
} else {
bundle.putString("search_content", string3);
i2 = 9;
}
} else if (string.equalsIgnoreCase("childCategory")) {
i2 = 6;
String string4 = bundle.getString("urlString");
String string5 = bundle.getString("catName");
bundle.putString("urlString", string4);
bundle.putString("catName", string5);
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "----urlString=" + string4 + ",catName=" + string5);
}
} else if (string.equalsIgnoreCase("search")) {
i2 = 8;
}
}
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "---coming from sdk----activityKey=" + string + ",from=" + string2);
}
if (TextUtils.isEmpty(string2)) {
com.qihoo.appstore.r.f.f3207a = 10002;
} else if (string2.startsWith("360Launcher")) {
com.qihoo.appstore.r.f.f3207a = 7;
} else if (string2.startsWith("360MobileSafe.MainScreen")) {
com.qihoo.appstore.r.f.f3207a = 8;
} else if (string2.startsWith("360MobileSafe.MobileNess")) {
com.qihoo.appstore.r.f.f3207a = 801;
} else if (string2.startsWith("360MobileSafe.MobileAppMGr")) {
com.qihoo.appstore.r.f.f3207a = 802;
b(bundle);
} else if (string2.startsWith("360MobileSafe.MobileAppSafeMarket")) {
com.qihoo.appstore.r.f.f3207a = 805;
} else if (string2.startsWith("360MobileSafe.MobileAppBarcode")) {
com.qihoo.appstore.r.f.f3207a = 806;
} else if (string2.startsWith("360MobileSafe.MobileAppFloatView")) {
com.qihoo.appstore.r.f.f3207a = 807;
} else if (string2.startsWith("360MobileSafe.MobileAppSoftUpgrade")) {
com.qihoo.appstore.r.f.f3207a = 808;
if (bundle.getBoolean("from_mobilesafe_homepage")) {
if (i2 == 10) {
com.qihoo.appstore.r.f.f3207a = 801;
} else if (i2 == 0) {
com.qihoo.appstore.r.f.f3207a = 8;
} else if (i2 == 4) {
com.qihoo.appstore.r.f.f3207a = 808;
}
}
if (bundle.getBoolean("from_mobilesafe_notification")) {
com.qihoo.appstore.r.f.f3207a = 810;
}
} else if (string2.startsWith("360AndroidBrowser")) {
com.qihoo.appstore.r.f.f3207a = 9;
} else if (string2.startsWith("360GameCenter")) {
com.qihoo.appstore.r.f.f3207a = 4;
} else {
com.qihoo.appstore.r.f.f3207a = 10001;
}
}
return i2;
}
private void a(int i2, Intent intent) {
String P;
if (intent != null) {
while (!this.O.isEmpty()) {
String str = (String) this.O.removeLast();
if (!this.O.isEmpty()) {
c(str);
}
}
if (i2 < 5) {
P = String.format("MainTab_%d", Integer.valueOf(i2));
} else {
this.O.add(null);
P = P();
}
a(P, intent);
}
}
public void a(View view) {
if (com.qihoo.appstore.utils.dd.a(this.K)) {
d(view);
}
if (com.qihoo360.mobilesafe.a.a.f5313a) {
Log.e("DataLoad", "guidLogic");
}
this.r.postDelayed(new dy(this, view), this.f);
}
public static void a(ff ffVar) {
L.add(ffVar);
}
private void a(com.qihoo.appstore.personnalcenter.e eVar, Button button) {
if (eVar == null) {
button.setText(R.string.user_info_sign_in);
return;
}
if (eVar.c()) {
button.setText(R.string.user_info_sign_in);
} else if (eVar.d() == 1) {
button.setText(R.string.user_info_sign_in_done);
} else {
button.setText(getString(R.string.user_info_sign_in_done_with_date, new Object[]{Integer.valueOf(eVar.d())}));
}
}
private void a(String str, Intent intent) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "startChild, id = " + str + " intent = " + intent);
}
this.O.add(str);
b(str, intent);
}
public void a(String str, Intent intent, boolean z) {
int a2;
int i2;
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "processWithIntent.from = " + str + ", fromOnNewIntent = " + z + ", intent = " + com.qihoo.appstore.utils.c.a(intent) + ", data = " + intent.getData());
}
com.qihoo.appstore.r.f.f3207a = -1;
try {
if (intent == null) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "---intent is null--");
}
if (com.qihoo.appstore.r.f.f3207a == -1) {
com.qihoo.appstore.r.f.f3207a = 10006;
}
a(0, (Bundle) null);
} else {
if ((intent.getFlags() & 1048576) != 0) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY!=0");
}
com.qihoo.appstore.r.f.f3207a = 1;
if ("onNewIntent".equalsIgnoreCase(str)) {
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
}
a(0, (Bundle) null);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
}
if ("android.intent.action.SEND".equalsIgnoreCase(intent.getAction())) {
c(intent);
} else if ("android.intent.action.SEND_MULTIPLE".equalsIgnoreCase(intent.getAction())) {
d(intent);
} else if ("com.qihoo.appstore.startShareNearby".equals(intent.getAction())) {
Intent intent2 = new Intent();
intent2.setClassName(e(), "com.qihoo.appstore.sharenearby.NBReceiverActivity");
intent2.putExtra("scanResult", intent.getExtras().getString("scan_result"));
intent2.putExtra("fm", "kuaichuan");
com.qihoo.appstore.plugin.b.h.a(e(), "com.qihoo.appstore.plugin", intent2, R.string.load_sharenearby_tips);
} else if (("android.intent.action.VIEW".equals(intent.getAction()) && intent.getData() != null && "zhushou360".equals(intent.getData().getScheme()) && "startZhushouParseQRCode360".equals(intent.getData().getHost())) || "ACTION_PC_LINK_FOR_QR".equals(intent.getAction())) {
com.qihoo.express.mini.activity.a.a();
com.qihoo.express.mini.activity.aa.a().a(new Intent().setData(intent.getData()), this);
a(0, (Bundle) null);
} else {
if (!com.qihoo.appstore.utils.f.c("PROCESSED_360WIFI_RECOMMEND_GAME", false)) {
String h = com.qihoo.appstore.utils.de.h(getApplicationContext());
if (!TextUtils.isEmpty(h) && "100158".equals(com.qihoo.appstore.utils.de.i(AppStoreApplication.d())) && "android.intent.action.MAIN".equals(intent.getAction()) && intent.hasCategory("android.intent.category.LAUNCHER")) {
com.qihoo.appstore.utils.f.b("PROCESSED_360WIFI_RECOMMEND_GAME", true);
a(0, (Bundle) null);
new db(this, this).execute(new String[]{h});
}
}
if ("com.qihoo.appstore.data.WEBAPP_CENTER".equals(intent.getDataString())) {
String stringExtra = intent.getStringExtra("page");
if (TextUtils.isEmpty(stringExtra)) {
a(0, (Bundle) null);
} else if ("app_search".equals(stringExtra)) {
a(9, (Bundle) null);
} else if ("app_admin".equals(stringExtra)) {
a(0, (Bundle) null);
} else if ("app_home".equals(stringExtra)) {
a(0, (Bundle) null);
}
com.qihoo.appstore.r.f.f3207a = 901;
} else if ("com.qihoo.appstore.free.wifi".equals(intent.getAction()) || "com.qihoo.freewifi.mainactivity".equals(intent.getAction()) || "android.settings.WIFI_SETTINGS".equals(intent.getAction()) || "android.net.wifi.PICK_WIFI_NETWORK".equals(intent.getAction())) {
a(0, (Bundle) null);
com.qihoo.appstore.h.a.a().a(C, ("android.settings.WIFI_SETTINGS".equals(intent.getAction()) || "android.net.wifi.PICK_WIFI_NETWORK".equals(intent.getAction())) ? "sys_freefiwi" : "push_freewifi");
} else if ("com.qihoo.appstore.lightapp.luanchapp".equals(intent.getAction())) {
Intent intent3 = new Intent(intent);
intent3.setAction("android.intent.action.MAIN");
intent3.setClassName(this, "com.qihoo.lightapp.WebAppFakeBrowserLightActivity");
com.qihoo.appstore.plugin.b.h.a(e(), "com.qihoo.appstore.lightapp", intent3, R.string.load_lightapp_tips);
a(0, (Bundle) null);
} else {
String action = intent.getAction();
Bundle extras = intent.getExtras();
if ("com.qihoo360.daemon.pcdaemon.ACTION_START_UI2".equalsIgnoreCase(action)) {
com.qihoo.appstore.r.f.f3207a = 3;
if (!z) {
b(new Intent(this, (Class<?>) StartFromPcGuideActivity.class));
}
startService(new Intent(this, (Class<?>) DaemonCoreService.class));
} else if ("com.qihoo360.daemon.pcdaemon.ACTION_START_DOWNLOAF_PAGE".equalsIgnoreCase(action)) {
Bundle bundle = new Bundle();
int i3 = extras != null ? extras.getInt("home_item_index", 1) : 1;
bundle.putInt("home_item_index", i3);
if (i3 == 1) {
a(20, (Bundle) null);
} else {
a(5000, (Bundle) null);
}
startService(new Intent(this, (Class<?>) DaemonCoreService.class));
} else if (extras != null) {
com.qihoo.appstore.r.f.f3207a = extras.getInt("startype", com.qihoo.appstore.r.f.f3207a);
if (extras.getBoolean("Notify")) {
com.qihoo.appstore.notification.b.c = true;
com.qihoo.appstore.notification.b.d = true;
int i4 = extras.getInt("clear_notification_id");
if (i4 != 0) {
((NotificationManager) getSystemService("notification")).cancel(i4);
}
int i5 = extras.getInt("push_id", 0);
if (!extras.getBoolean("fromPush")) {
int i6 = extras.getInt("Index");
int i7 = extras.getInt("NotifyType", -1);
HashSet hashSet = new HashSet();
long j = com.qihoo.appstore.notification.k.r != null ? com.qihoo.appstore.notification.k.r.f2876a : 0L;
if (j != 0) {
hashSet.add("sid(" + j + ")");
com.qihoo.appstore.r.a.a("sid(" + j + ")", 1);
}
if (i7 == 1) {
if (Build.VERSION.SDK_INT >= 16) {
com.qihoo.appstore.r.f.f3207a = 202;
com.qihoo.appstore.r.a.a("gxtg", 1);
hashSet.add("notikqb");
com.qihoo.appstore.r.a.a("notikqb", 1);
} else {
com.qihoo.appstore.r.f.f3207a = 203;
com.qihoo.appstore.r.a.a("gxth", 1);
hashSet.add("notikqc");
com.qihoo.appstore.r.a.a("notikqc", 1);
}
com.qihoo.appstore.r.a.b("getUpdate0", this, hashSet);
} else if (i7 == 2) {
com.qihoo.appstore.r.f.f3207a = 203;
com.qihoo.appstore.r.a.a("gxth", 1);
hashSet.add("notikqc");
com.qihoo.appstore.r.a.a("notikqc", 1);
com.qihoo.appstore.r.a.b("getUpdate0", this, hashSet);
} else if (i7 == 3) {
com.qihoo.appstore.r.f.f3207a = 204;
com.qihoo.appstore.r.a.a("gxti", 1);
hashSet.add("notikqd");
com.qihoo.appstore.r.a.a("notikqd", 1);
com.qihoo.appstore.r.a.b("getUpdate0", this, hashSet);
} else if (i7 == 4) {
com.qihoo.appstore.r.f.f3207a = 205;
com.qihoo.appstore.r.a.a("gxtj", 1);
hashSet.add("notikqe");
com.qihoo.appstore.r.a.a("notikqe", 1);
com.qihoo.appstore.r.a.b("getUpdate0", this, hashSet);
} else if (i7 == 6) {
int i8 = extras.getInt("showStyle", 0);
com.qihoo.appstore.r.f.f3207a = 207;
String str2 = "notitqja";
if (i8 == 1) {
str2 = "notitqjb";
} else if (i8 == 2) {
str2 = "notitqjc";
}
hashSet.add(str2);
com.qihoo.appstore.r.a.a(str2, 1);
com.qihoo.appstore.r.a.b("getUpdate0", this, hashSet);
com.qihoo.appstore.utils.f.a("update_style6_click_count", com.qihoo.appstore.utils.f.b("update_style6_click_count", 0) + 1);
} else if (i7 == 7) {
if (extras.getBoolean("auto_download") && extras.getParcelable("update_app") != null) {
this.r.postDelayed(new du(this, extras), 1L);
}
if (extras.getInt("to_where") == 3) {
this.r.postDelayed(new dv(this, extras), 1L);
}
int i9 = extras.getInt("showStyle", 0);
com.qihoo.appstore.r.f.f3207a = 208;
String str3 = i9 == 0 ? "notitqjh" : "notitqji";
hashSet.add(str3);
com.qihoo.appstore.r.a.a(str3, 1);
com.qihoo.appstore.r.a.b("getUpdate0", this, hashSet);
} else if (i7 == 8) {
if (extras.getInt("to_where") == 3) {
this.r.postDelayed(new dw(this, extras), 1L);
}
com.qihoo.appstore.r.f.f3207a = 209;
hashSet.add("notitqjk");
com.qihoo.appstore.r.a.a("notitqjk", 1);
com.qihoo.appstore.r.a.b("getUpdate0", this, hashSet);
com.qihoo.appstore.utils.f.a("update_style8_click_count", com.qihoo.appstore.utils.f.b("update_style8_click_count", 0) + 1);
} else if (i7 == 0) {
com.qihoo.appstore.r.f.f3207a = 201;
com.qihoo.appstore.r.a.a("gxtfnew", 1);
hashSet.add("notikqa");
com.qihoo.appstore.r.a.a("notikqa", 1);
com.qihoo.appstore.r.a.b("getUpdate0", this, hashSet);
} else if (i7 > 4) {
com.qihoo.appstore.r.f.f3207a = 2;
}
e(intent);
c(str, intent);
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "---coming from Notify---- " + i6);
}
if (i6 == 17) {
com.qihoo.appstore.utils.f.a("pref_last_notify_click_count", com.qihoo.appstore.utils.f.b("pref_last_notify_click_count", 0) + 1);
}
a(i6, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
}
int i10 = extras.getInt("to_where");
com.qihoo.appstore.notification.b.f2869b = i5;
if (com.qihoo.appstore.notification.b.f2869b == 0) {
this.r.postDelayed(new dc(this, extras), 1L);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
}
com.qihoo.appstore.r.f.f3207a = 606;
switch (i10) {
case 1:
com.qihoo.appstore.r.f.f3207a = 605;
this.r.postDelayed(new dd(this), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
com.qihoo.appstore.r.f.f3207a = (com.qihoo.appstore.r.f.f3207a * 10) + 1;
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
case 2:
com.qihoo.appstore.r.f.f3207a = 605;
this.r.postDelayed(new de(this), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 3:
com.qihoo.appstore.r.f.f3207a = 603;
this.r.postDelayed(new df(this, extras), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 4:
this.r.postDelayed(new dg(this), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 5:
this.r.postDelayed(new dh(this), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 6:
this.r.postDelayed(new di(this), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 7:
this.r.postDelayed(new dj(this), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 8:
com.qihoo.appstore.r.f.f3207a = 604;
this.r.postDelayed(new dk(this, extras), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 9:
com.qihoo.appstore.r.f.f3207a = 607;
i2 = 5000;
this.r.postDelayed(new dl(this, extras), 1L);
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 10:
com.qihoo.appstore.r.f.f3207a = 608;
String stringExtra2 = intent.getStringExtra("package_name");
if (!TextUtils.isEmpty(stringExtra2)) {
com.qihoo.appstore.ui.b.b(this, stringExtra2);
}
((NotificationManager) getSystemService("notification")).cancel(700000);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 30:
i2 = 17;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 31:
this.r.postDelayed(new dm(this, extras), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 32:
this.r.postDelayed(new Cdo(this), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 33:
this.r.postDelayed(new dp(this, extras), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 35:
this.r.postDelayed(new dq(this, extras), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 38:
this.r.postDelayed(new dr(this, extras), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 42:
this.r.postDelayed(new ds(this, extras), 1L);
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 43:
com.qihoo.appstore.newHomePage.b.i();
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
case 50:
com.qihoo.appstore.r.f.f3207a = 609;
String string = extras.getString("switch_tab");
if (string == null) {
string = Config.INVALID_IP;
}
extras.putInt("video_item_index", string.equals("choiceness") ? 0 : string.equals("channel") ? 1 : string.equals("subject") ? 2 : string.equals("ranking") ? 3 : 0);
i2 = 3;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
case 51:
com.qihoo.appstore.r.f.f3207a = 609;
this.r.postDelayed(new dt(this, extras), 1L);
default:
i2 = 0;
if (extras.getBoolean("from_push_destktop", false)) {
}
a(i2, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
}
a(false, false, false);
}
} else {
if (extras.getBoolean("BaoheUpdate")) {
int i11 = extras.getInt("Index");
com.qihoo.appstore.r.f.f3207a = 2;
a((UpdateManager.BaoheUpdateInfo) extras.getParcelable("UpdateInfo"), true);
com.qihoo.appstore.r.a.a("mll", 1);
a(i11, extras);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
}
if (TextUtils.isEmpty(extras.getString("activityKey")) && TextUtils.isEmpty(extras.getString("activity_key"))) {
a2 = extras.getInt("Index");
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "------index:" + a2);
}
String string2 = extras.getString("from");
if (TextUtils.isEmpty(string2)) {
if (com.qihoo.appstore.r.f.f3207a == -1) {
com.qihoo.appstore.r.f.f3207a = 10005;
}
} else if (string2.startsWith("360AndroidBrowser")) {
com.qihoo.appstore.r.f.f3207a = 9;
} else if (string2.startsWith("360GameCenter")) {
com.qihoo.appstore.r.f.f3207a = 4;
} else if (string2.startsWith("360MobileSafe.MobileAppSoftUpgrade")) {
com.qihoo.appstore.r.f.f3207a = 111;
} else if (com.qihoo.appstore.r.f.f3207a == -1) {
com.qihoo.appstore.r.f.f3207a = 10004;
}
if (a2 == 6) {
int i12 = extras.getInt("startType", -1);
if (i12 > 0) {
com.qihoo.appstore.r.f.f3207a = i12;
}
Intent intent4 = new Intent(e(), (Class<?>) BookActivity.class);
intent4.putExtra("index", 3);
this.r.postDelayed(new dx(this, intent4), this.O.size() == 0 ? 1000L : 1L);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
}
if (e == a2) {
this.r.postDelayed(new dz(this, new Intent(e(), (Class<?>) SavingTrafficDownloadActivity.class)), this.O.size() == 0 ? 1000L : 1L);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
}
if ((20 == a2 || 5000 == a2) && extras.getBoolean("isContainFromPCTask")) {
com.qihoo.appstore.r.f.f3207a = 511;
}
if ("onNewIntent".equalsIgnoreCase(str)) {
com.qihoo.appstore.f.g.a(intent);
}
} else {
a2 = a(extras);
this.Q = true;
}
String string3 = extras.getString("clear_from");
if (!TextUtils.isEmpty(string3)) {
if ("bgScan".equals(string3)) {
com.qihoo.appstore.r.f.f3207a = 3103;
com.qihoo.appstore.r.a.a("bgnc", 1);
} else if ("space".equals(string3)) {
com.qihoo.appstore.r.f.f3207a = 3102;
} else if ("uninstall".equals(string3)) {
com.qihoo.appstore.r.f.f3207a = 3101;
}
}
a(a2, extras);
}
} else {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "---extras is null--");
}
com.qihoo.appstore.r.f.f3207a = 1;
if ("onNewIntent".equalsIgnoreCase(str)) {
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
}
a(0, extras);
}
}
}
if (!TextUtils.isEmpty(intent.getStringExtra("from_out_side"))) {
this.Q = true;
new com.qihoo.appstore.utils.cr().a(intent);
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
}
String stringExtra3 = intent.getStringExtra("from");
if (stringExtra3 != null && stringExtra3.startsWith("360GameCenter")) {
a(1, (Bundle) null);
}
}
if (E()) {
ag();
}
if (!com.qihoo.appstore.utils.f.c("is_first_open", false)) {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
return;
}
a(false, false, false);
} catch (Throwable th) {
if (com.qihoo.appstore.utils.f.c("is_first_open", false)) {
a(false, false, false);
} else {
com.qihoo.appstore.utils.f.b("is_first_open", true);
a(false, false, true);
}
throw th;
}
}
public void aa() {
Activity c = c();
if (c instanceof HomeActivity) {
((HomeActivity) c).c();
} else {
HomeActivity.f2042a = true;
}
}
public void ab() {
boolean z;
boolean z2 = true;
if (!com.qihoo.express.mini.c.i.b()) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "network disconnected, startPluginSilentDownloadIfNeed not run");
return;
}
return;
}
if (com.qihoo.appstore.plugin.f.e(AppStoreApplication.d(), "com.qihoo.appstore.lightapp") || com.qihoo.appstore.f.g.k("com.qihoo.appstore.lightapp") != null || com.qihoo.appstore.plugin.f.a().a("com.qihoo.appstore.lightapp")) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "isLightAppSilentDownloadReady false");
}
z = false;
} else {
z = true;
}
if (com.qihoo.appstore.h.a.b() && (com.qihoo.appstore.plugin.f.e(AppStoreApplication.d(), "com.qihoo.freewifi") || com.qihoo.appstore.f.g.k("com.qihoo.freewifi") != null || com.qihoo.appstore.plugin.f.a().a("com.qihoo.freewifi") || com.qihoo.appstore.h.a.a().b(C))) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "isFreeWifiSilentDownloadReady false");
}
z2 = false;
}
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "startPluginSilentDownloadIfNeed. isLightAppSilentDownloadReady = " + z);
}
if (z) {
e("com.qihoo.appstore.lightapp");
}
if (com.qihoo.appstore.h.a.b() && z2) {
e("com.qihoo.freewifi");
}
}
private void ac() {
if (ab == null) {
return;
}
String i2 = com.qihoo.appstore.utils.de.i(AppStoreApplication.d());
if ("410101".equals(i2) || "100158".equals(i2)) {
com.qihoo.appstore.ui.di.a(this, ab, true);
}
}
public void ad() {
this.r.post(new eg(this));
com.qihoo.appstore.newHomePage.b.a().a(com.qihoo.appstore.utils.f.k());
if (t() && YJZJActivity.b()) {
YJZJActivity.a(new eh(this));
}
}
private boolean ae() {
if (ab == null) {
return false;
}
Intent intent = getIntent();
if ("com.qihoo360.daemon.pcdaemon.ACTION_START_UI2".equalsIgnoreCase(intent.getAction()) || E()) {
return false;
}
String stringExtra = intent.getStringExtra("from");
return (stringExtra == null || !stringExtra.startsWith("360GameCenter")) && !com.qihoo.appstore.ui.di.b(this, ab, false);
}
private void af() {
this.o = (FrameLayout) findViewById(R.id.splash_view_root);
this.p = (ImageView) findViewById(R.id.splash_view_festival);
this.q = (RelativeLayout) findViewById(R.id.splash_view_layout);
Intent intent = getIntent();
if (intent != null) {
if ("com.qihoo360.daemon.pcdaemon.ACTION_START_UI2".equalsIgnoreCase(intent.getAction()) || Y()) {
this.f = 0;
}
if (intent.getIntExtra("show_splash_view", 1) == 0) {
this.f = 0;
}
}
if (com.qihoo.appstore.utils.dd.a(this.K)) {
this.f = 0;
}
long A = com.qihoo.appstore.utils.f.A();
long currentTimeMillis = System.currentTimeMillis();
if (A < currentTimeMillis && currentTimeMillis - A < Config.TASK_EXPIRATION_MSEC) {
this.f = 0;
}
com.qihoo.appstore.utils.aq aqVar = new com.qihoo.appstore.utils.aq();
Bitmap b2 = aqVar.b(this);
com.qihoo.appstore.utils.aj.b().schedule(new en(this, aqVar), 6000L, TimeUnit.MILLISECONDS);
if (b2 != null) {
this.p.setVisibility(0);
this.q.setVisibility(8);
this.p.setImageBitmap(b2);
} else if (this.f > 0) {
this.p.setVisibility(8);
this.q.setVisibility(0);
}
if (this.f > 0) {
com.qihoo.appstore.utils.f.a(currentTimeMillis);
}
this.h = true;
}
private void ag() {
if (com.qihoo.appstore.utils.f.c("is_app_store_first_start", true)) {
Intent intent = new Intent(this, (Class<?>) PopluarizeActivity.class);
intent.putExtra("detail_url", "http://huodong.mobilem.360.cn/quanmin/detail?webpg=qmshf");
intent.putExtra("needCookie", true);
b(intent);
com.qihoo.appstore.utils.f.b("is_app_store_first_start", false);
}
}
public void ah() {
if (com.qihoo.appstore.utils.f.c("pref_is_set_default_app_start_time", false)) {
return;
}
long currentTimeMillis = System.currentTimeMillis();
com.qihoo.appstore.utils.f.b("pref_is_set_default_app_start_time", true);
com.qihoo.appstore.utils.f.b("pref_appstore_install_time", currentTimeMillis);
for (com.qihoo.appstore.l.a.c cVar : com.qihoo.appstore.l.d.e()) {
cVar.d(currentTimeMillis);
AppStartTimeHelper.setAppStartTime(C, cVar.i(), currentTimeMillis);
}
AppStartTimeHelper.commit();
}
private void b(Bundle bundle) {
}
public void b(View view) {
if (this.o != null) {
this.o.setVisibility(8);
ViewParent parent = this.o.getParent();
if (parent != null && (parent instanceof ViewGroup)) {
((ViewGroup) parent).removeView(this.o);
}
c(view);
this.o = null;
this.p = null;
this.q = null;
}
if (com.qihoo360.mobilesafe.a.a.f5313a) {
Log.e("DataLoad", "dismissSplashView");
}
this.m.setContent(view);
this.h = false;
}
private void b(String str, Intent intent) {
ViewGroup viewGroup = (ViewGroup) K().startActivity(str, intent).getDecorView();
if (this.f670a != null) {
this.f670a.removeAllViews();
this.f670a.addView(viewGroup, -1, -1);
this.f670a.addView(this.B, -1, -1);
viewGroup.requestFocus();
}
viewGroup.setDescendantFocusability(262144);
viewGroup.invalidate();
if (!d(g()) && this.m != null && this.m.d()) {
u();
}
if (str.endsWith("MainTab_0") || str.endsWith("MainTab_1") || str.endsWith("MainTab_2") || str.endsWith("MainTab_3") || str.endsWith("MainTab_4")) {
ImageView imageView = (ImageView) viewGroup.findViewById(R.id.titleIcon);
ImageView imageView2 = imageView == null ? (ImageView) viewGroup.findViewById(R.id.back) : imageView;
if (imageView2 != null) {
com.qihoo.appstore.utils.u.a(imageView2, com.qihoo.appstore.utils.u.f3844b);
}
}
Bundle extras = intent.getExtras();
if ((extras == null || (TextUtils.isEmpty(extras.getString("activityKey")) && TextUtils.isEmpty(extras.getString("activity_key")))) && intent.getIntExtra("from_out_side_start_type", 0) <= 0) {
this.j = 1;
} else {
this.j = this.O.size();
}
}
private void c(Intent intent) {
FileItem fileItem;
Parcelable parcelableExtra = intent.getParcelableExtra("android.intent.extra.STREAM");
if (!(parcelableExtra instanceof Uri)) {
if (Build.VERSION.SDK_INT <= 7) {
Toast.makeText(getApplicationContext(), R.string.system_version_no_this_feature, 0).show();
return;
}
Intent intent2 = new Intent();
intent2.setClassName(e(), "com.qihoo.appstore.sharenearby.ShareGuideActivity");
intent2.putExtra("fm", "kuaichuan");
com.qihoo.appstore.plugin.b.h.a(e(), "com.qihoo.appstore.plugin", intent2, R.string.load_sharenearby_tips);
return;
}
Uri uri = (Uri) parcelableExtra;
com.qihoo.explorer.a.a.f4381b.clear();
if (uri != null) {
if (Build.VERSION.SDK_INT <= 7) {
e().a(0, (Bundle) null);
Toast.makeText(this, R.string.system_version_no_this_feature, 1).show();
return;
}
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("shareimage", "url:" + uri.toString());
}
String scheme = uri.getScheme();
if ("content".equals(scheme) && "media".equals(uri.getAuthority())) {
Cursor query = getContentResolver().query(uri, null, null, null, null);
if (query != null) {
try {
if (query.moveToFirst()) {
int columnIndex = query.getColumnIndex("_data");
if (!query.isNull(columnIndex)) {
fileItem = new FileItem(query.getString(columnIndex));
}
}
} finally {
if (query != null) {
query.close();
}
}
}
fileItem = null;
} else {
fileItem = "file".equals(scheme) ? new FileItem(uri.getPath()) : null;
}
if (fileItem != null) {
if (!fileItem.a().exists()) {
Toast.makeText(this, getString(R.string.share_file_not_exist), 1).show();
return;
} else {
com.qihoo.explorer.a.a.f4381b.add(fileItem);
com.qihoo.appstore.sharenearby.v.a((Context) this, true);
}
}
}
a(0, (Bundle) null);
}
private void c(Bundle bundle) {
App app = new App();
String string = bundle.getString("name");
if (TextUtils.isEmpty(string)) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "downloadFromIntent name is null");
return;
}
return;
}
app.o(string);
String string2 = bundle.getString("packagename");
if (TextUtils.isEmpty(string2)) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "downloadFromIntent packagename is null");
return;
}
return;
}
app.m(string2);
String string3 = bundle.getString("url");
if (TextUtils.isEmpty(string3)) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "downloadFromIntent url is null");
return;
}
return;
}
app.q(string3);
String string4 = bundle.getString("icon_url");
if (!TextUtils.isEmpty(string4)) {
app.s(string4);
} else if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "downloadFromIntent icon_url is null");
}
long j = bundle.getLong("size");
if (j <= 0 && com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "downloadFromIntent size is null");
}
app.b(j);
String string5 = bundle.getString("id");
if (!TextUtils.isEmpty(string5)) {
app.n(string5);
} else if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "downloadFromIntent id is null");
}
app.p(bundle.getInt("version_code"));
String string6 = bundle.getString("version_name");
if (!TextUtils.isEmpty(string6)) {
app.R(string6);
} else if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "downloadFromIntent versionName is null");
}
int i2 = bundle.getInt("bPackage", -1);
if (i2 != -1) {
app.d(i2);
}
com.qihoo.appstore.f.g.a((com.qihoo.appstore.e.a.b) app, true, false);
}
private void c(View view) {
if (this.f <= 0) {
android.support.v4.a.c.a(C).a(new Intent("com.qihoo.appstore.spash_done"));
return;
}
IntentFilter intentFilter = new IntentFilter("com.qihoo.appstore.infoLoadFinish");
ez ezVar = new ez(this, view);
android.support.v4.a.c.a(this).a(ezVar, intentFilter);
this.o.setVisibility(0);
((ViewGroup) view).addView(this.o);
this.r.postDelayed(new ct(this, view, ezVar), this.f);
}
private void c(String str) {
K().destroyActivity(str, true);
try {
Field declaredField = K().getClass().getDeclaredField("mActivities");
declaredField.setAccessible(true);
((Map) declaredField.get(K())).remove(str);
} catch (Exception e2) {
}
}
private void c(String str, Intent intent) {
int i2;
if (intent.getBooleanExtra("push_add", false)) {
Bundle extras = intent.getExtras();
if (extras != null && (i2 = extras.getInt("push_id", 0)) != 0) {
com.qihoo.appstore.notification.b.f2869b = i2;
com.qihoo.appstore.r.f.f3207a = 600;
}
Intent intent2 = new Intent(e(), (Class<?>) AppInfoActivity.class);
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("pushtest", intent.toString());
}
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("pushtest", intent.getExtras().toString());
}
intent2.putExtra("push_app_info", intent.getParcelableExtra("push_app_info"));
boolean booleanExtra = intent.getBooleanExtra("fromyxhz", false);
intent2.putExtra("fromyxhz", booleanExtra);
if (booleanExtra) {
String stringExtra = intent.getStringExtra("notifyType");
if ("gift".equals(stringExtra)) {
com.qihoo.appstore.r.a.a("splb", 1);
com.qihoo.appstore.r.f.f3207a = 102;
} else if ("chat".equals(stringExtra)) {
com.qihoo.appstore.r.a.a("spcb", 1);
com.qihoo.appstore.r.f.f3207a = 103;
} else if ("invite".equals(stringExtra)) {
com.qihoo.appstore.r.a.a("spyb", 1);
com.qihoo.appstore.r.f.f3207a = Config.MEASUREMENT_END_PROGRESS;
} else if ("system".equals(stringExtra)) {
com.qihoo.appstore.r.f.f3207a = 104;
com.qihoo.appstore.r.a.a("spxb", 1);
} else {
com.qihoo.appstore.r.f.f3207a = 10;
}
}
if (intent.getBooleanExtra("AnQuanHuanJi", false)) {
com.qihoo.appstore.r.a.a("AnQuanHuanJi", 1);
}
this.r.postDelayed(new ei(this, intent2), 1L);
} else if (intent.getBooleanExtra("push_urgent_update", false)) {
if ("onNewIntent".equalsIgnoreCase(str)) {
a(true, true, false);
}
} else if (intent.getBooleanExtra("push_msg", false)) {
com.qihoo.appstore.r.f.f3207a = 601;
Intent intent3 = new Intent(e(), (Class<?>) SmsListActivity.class);
intent3.putExtra("title", intent.getStringExtra("title"));
this.r.postDelayed(new ek(this, intent3), 1L);
} else if (intent.getBooleanExtra("push_ring", false)) {
com.qihoo.appstore.r.f.f3207a = 602;
this.r.postDelayed(new el(this, new Intent(e(), (Class<?>) RingActivity.class)), 1L);
} else if (intent.getBooleanExtra("push_webview", false)) {
com.qihoo.appstore.r.f.f3207a = 603;
this.r.postDelayed(new em(this, intent.getStringExtra("push_url")), 1L);
}
Bundle extras2 = intent.getExtras();
if (extras2 == null || !extras2.getBoolean("from_push_destktop", false)) {
return;
}
com.qihoo.appstore.r.f.f3207a = (com.qihoo.appstore.r.f.f3207a * 10) + 1;
}
private void d(Intent intent) {
ArrayList parcelableArrayListExtra = intent.getParcelableArrayListExtra("android.intent.extra.STREAM");
com.qihoo.explorer.a.a.f4381b.clear();
if (parcelableArrayListExtra != null) {
if (Build.VERSION.SDK_INT <= 7) {
e().a(0, (Bundle) null);
Toast.makeText(this, R.string.system_version_no_this_feature, 0).show();
return;
}
ArrayList arrayList = new ArrayList();
Iterator it = parcelableArrayListExtra.iterator();
while (it.hasNext()) {
Uri uri = (Uri) it.next();
String scheme = uri.getScheme();
if ("content".equals(scheme) && "media".equals(uri.getAuthority())) {
Cursor query = getContentResolver().query(uri, null, null, null, null);
if (query != null) {
try {
if (query.moveToFirst()) {
int columnIndex = query.getColumnIndex("_data");
if (!query.isNull(columnIndex)) {
arrayList.add(new FileItem(query.getString(columnIndex)));
}
}
} catch (Throwable th) {
if (query != null) {
query.close();
}
throw th;
}
}
if (query != null) {
query.close();
}
} else if ("file".equals(scheme)) {
arrayList.add(new FileItem(uri.getPath()));
}
}
if (!arrayList.isEmpty()) {
Iterator it2 = arrayList.iterator();
while (it2.hasNext()) {
com.qihoo.explorer.a.a.f4381b.add((FileItem) it2.next());
}
arrayList.clear();
com.qihoo.appstore.sharenearby.v.a((Context) this, true);
}
}
a(0, (Bundle) null);
}
private void d(View view) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "initGuideView2 " + com.qihoo.appstore.utils.de.h(this, W()));
}
if (com.qihoo.appstore.utils.de.h(this, W()) || this.O.size() != 1 || !"MainTab_0".equals(this.O.get(0)) || com.qihoo.appstore.r.f.f3207a == 3) {
this.m.setSlidingEnabled(true);
return;
}
this.J = (ViewGroup) view.findViewById(R.id.new_feature_guide);
this.J.addView(getLayoutInflater().inflate(com.qihoo.appstore.utils.dd.c(this.K), (ViewGroup) null));
this.J.setVisibility(0);
this.m.setSlidingEnabled(false);
this.J.setOnClickListener(new cz(this));
com.qihoo.appstore.utils.de.a((Context) this, W(), true);
}
private boolean d(String str) {
return c() instanceof HomeActivity;
}
public static MainActivity e() {
return C;
}
private void e(Intent intent) {
if (intent.getBooleanExtra("push_update", false) || intent.getBooleanExtra("push_urgent_update", false)) {
com.qihoo.appstore.r.f.f3207a = 600;
}
}
public void e(View view) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "----------initUserGuide------");
}
if (ab == null) {
return;
}
ac();
if (ae()) {
aa = (UserGuideLayout) ((ViewStub) view.findViewById(R.id.stub_import)).inflate();
aa.setGuideListener(new ef(this));
com.qihoo.appstore.ui.di.a(this, ab, true);
}
}
private void e(String str) {
String a2 = new com.qihoo.appstore.plugin.b.b(this).a(com.qihoo.appstore.plugin.f.a().b(this, str));
if (TextUtils.isEmpty(a2)) {
return;
}
com.qihoo.appstore.plugin.a.a aVar = new com.qihoo.appstore.plugin.a.a(str, a2);
String e2 = aVar.e();
if (TextUtils.isEmpty(e2)) {
return;
}
App app = new App();
app.m(str);
app.o(str);
app.b(aVar.b());
app.j(com.qihoo.appstore.plugin.f.a().a(this, str));
app.q(e2);
app.p(Integer.parseInt(aVar.c()));
com.qihoo.appstore.f.g.b(new ee(this, app));
}
public static com.qihoo.appstore.personnalcenter.sdk.e f() {
if (C == null) {
return null;
}
return C.E;
}
public static String g() {
if (e() == null) {
return Config.INVALID_IP;
}
if (!e().M() && !i) {
return Config.INVALID_IP;
}
StringBuilder N = e().N();
if (i) {
if (YJZJActivity.f4036b > 0) {
N.append("_akey").append(YJZJActivity.f4036b);
} else {
N.append("_akey");
}
}
N.append(ac);
return N.toString();
}
public static File m() {
File a2 = com.qihoo.appstore.l.b.a.a("/360Download/cachefiles");
if (a2.isDirectory() || a2.mkdirs()) {
return new File(a2.getPath() + "/special.html");
}
return null;
}
public void A() {
com.qihoo.appstore.utils.aj.a().execute(new eq(this, com.qihoo.appstore.personnalcenter.q.a(getBaseContext())));
}
public void B() {
View findViewById = findViewById(R.id.scan_wifi_connect_detail);
if (findViewById != null) {
findViewById.setVisibility(PushMessageHandle.f() ? 0 : 8);
}
}
@Override
public void C() {
com.qihoo.appstore.utils.u.a(false);
D();
}
public void D() {
if (this.z == null || findViewById(R.id.lottery_btn_tip) == null) {
return;
}
if (!G) {
this.z.setText(R.string.user_info_sign_in);
findViewById(R.id.lottery_btn_tip).setVisibility(8);
return;
}
com.qihoo.appstore.personnalcenter.e a2 = com.qihoo.appstore.personnalcenter.a.a();
a(a2, this.z);
this.z.setTextColor(-1);
findViewById(R.id.lottery_btn_tip).setVisibility(a2 != null && a2.e() ? 0 : 8);
}
public boolean E() {
try {
int parseInt = Integer.parseInt(com.qihoo.appstore.utils.de.i(this));
return parseInt >= 460001 && parseInt <= 460999;
} catch (Exception e2) {
return false;
}
}
@Override
public boolean F() {
return true;
}
public int a(Class cls) {
boolean z;
int i2;
int i3 = 0;
while (true) {
try {
if (i3 >= this.O.size()) {
z = false;
i2 = -1;
break;
}
Activity activity = K().getActivity((String) this.O.get(i3));
if (com.qihoo360.mobilesafe.a.a.f5313a) {
Log.v("MainActivity", "getBackToActivityStep activity " + activity);
}
if (cls.isInstance(activity)) {
z = true;
i2 = i3;
break;
}
i3++;
} catch (Exception e2) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
Log.d("MainActivity", "getBackToActivityStep failed.", e2);
}
return -1;
}
}
if (!z || i2 <= 0) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
Log.i("MainActivity", "getBackToActivityStep not found, return -1.");
}
return -1;
}
int size = this.O.size() - i2;
if (!com.qihoo360.mobilesafe.a.a.f5313a) {
return size;
}
Log.i("MainActivity", "getBackToActivityStep return " + size);
return size;
}
public void a(int i2) {
Intent intent = new Intent(this, (Class<?>) UserInfoActivity1.class);
intent.putExtra("extra_route_from", i2);
b(intent);
this.V = true;
}
public void a(int i2, Bundle bundle) {
Intent intent;
switch (i2) {
case 0:
case 1:
case 2:
case 3:
case 4:
intent = new Intent(this, (Class<?>) HomeActivity.class);
if (bundle == null) {
bundle = new Bundle();
}
bundle.putInt("home_tab_index", i2);
if (i2 == 3) {
this.r.post(new dn(this, intent));
break;
}
break;
case 6:
intent = new Intent(this, (Class<?>) HomeActivity.class);
intent.putExtra("home_tab_index", 1);
break;
case 7:
intent = new Intent(this, (Class<?>) AppInfoActivity.class);
break;
case 8:
intent = AppSearchActivity.a(this, bundle);
break;
case 9:
intent = new Intent(this, (Class<?>) AppSearchActivity.class);
break;
case 10:
intent = new Intent(this, (Class<?>) AppEssentialActivity.class);
break;
case 11:
case 12:
intent = new Intent(this, (Class<?>) HomeActivity.class);
break;
case 13:
Intent intent2 = new Intent();
intent2.setClassName(e(), "com.qihoo.appstore.sharenearby.ShareMainActivity");
intent2.putExtra("fm", "kuaichuan");
com.qihoo.appstore.plugin.b.h.a(e(), "com.qihoo.appstore.plugin", intent2, R.string.load_sharenearby_tips);
intent = null;
break;
case 14:
intent = new Intent(this, (Class<?>) AppMobileLiveActivity.class);
if (bundle == null) {
bundle = new Bundle();
}
bundle.putString("detail_url", "http://openbox.mobilem.360.cn/html/life/index2.html");
break;
case HttpConst.APP_UPDATE_PATCH_LIST_PARSER:
intent = MobileClearLauncher.getMobileClearIntentFromNotiy(this);
break;
case 16:
intent = MobileClearLauncher.getMobileClearIntentFromNeedScan(this);
break;
case HttpConst.APP_HOME_RECOMMAND_LIST_PARSER:
intent = new Intent(this, (Class<?>) AppUpdateActivityWrapper.class);
break;
case HttpConst.WALLPAPER_TOPIC_LIST_PARSER:
intent = new Intent(this, (Class<?>) AppUninstallActivity.class);
break;
case 20:
intent = new Intent(this, (Class<?>) DownloadPcActivityImpl.class);
break;
case 5000:
int i3 = bundle != null ? bundle.getInt("home_item_index", 0) : 0;
Intent intent3 = new Intent(this, (Class<?>) NewDownLoadActivity.class);
intent3.putExtra("download_tab_index", i3);
intent = intent3;
break;
default:
com.qihoo.appstore.utils.bk.e("MainActivity", "Switch to nonexit activity");
return;
}
if (intent != null) {
if (bundle != null) {
intent.putExtras(bundle);
}
a(i2, intent);
}
}
public void a(Intent intent) {
try {
String str = (String) this.O.removeLast();
this.f670a.clearFocus();
c(str);
b(intent);
} catch (Exception e2) {
e2.printStackTrace();
}
}
@Override
public void a(UpdateManager.BaoheUpdateInfo baoheUpdateInfo, boolean z) {
if (!this.Y.getAndSet(true) || z) {
boolean a2 = com.qihoo.appstore.f.g.a(getPackageName(), baoheUpdateInfo.d, true);
eb ebVar = new eb(this, a2, baoheUpdateInfo);
if (a2) {
com.qihoo.appstore.d.e.a(this, R.drawable.dialog_icon_info, R.string.updateinfotip_downloadfinished, C.getString(R.string.app_name) + baoheUpdateInfo.f3719a + C.getString(R.string.updateInfo), baoheUpdateInfo.c, R.string.update_immediate, ebVar);
} else {
com.qihoo.appstore.d.e.a(this, R.drawable.dialog_icon_info, R.string.updateinfotip, C.getString(R.string.app_name) + baoheUpdateInfo.f3719a + C.getString(R.string.updateInfo), baoheUpdateInfo.c, R.string.updatebackground, ebVar);
}
}
}
public void a(com.qihoo360.accounts.a.a.b.b bVar) {
if (e() == null) {
return;
}
this.T = false;
this.l = true;
a(true, false);
v();
e(true);
z();
b(true, true);
com.qihoo.appstore.personnalcenter.friends.af.c = true;
com.qihoo.appstore.personnalcenter.friends.af.b();
com.qihoo.appstore.personnalcenter.friends.am.b();
String b2 = com.qihoo.appstore.personnalcenter.g.b(this, "mobile", Config.INVALID_IP);
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "onAutoLoginSuccess() and mobile is:" + b2);
}
if (TextUtils.isEmpty(b2)) {
com.qihoo.appstore.personnalcenter.friends.af.f();
}
try {
android.support.v4.a.c.a(this).a(new Intent("BROADCAST_ACTION_LOGIN_STATE_CHANGED"));
} catch (Exception e2) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.d("MainActivity", "failed to send BROADCAST_ACTION_LOGIN_STATE_CHANGED broadcast.", e2);
}
}
}
public void a(String str) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "autoLoginFromPreference");
}
if (TextUtils.isEmpty(str)) {
str = com.qihoo.appstore.personnalcenter.g.b(getBaseContext(), "qt");
}
String b2 = com.qihoo.appstore.personnalcenter.g.b(this, "account");
if (b2 == null) {
b2 = com.qihoo.appstore.personnalcenter.g.b(this, "user_name");
}
com.qihoo.appstore.personnalcenter.h.a(this, b2, str, this.W);
}
public void a(boolean z) {
a(z, true);
}
public void a(boolean z, boolean z2) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.a("MainActivity", "setHasLogin, hasLogin = " + z + ", refreshAvatar = " + z2);
}
if (this.y == null) {
y();
}
G = z;
v();
if (z2) {
w();
}
if (z) {
b(true, true);
} else {
b(false, false);
}
}
public void a(boolean z, boolean z2, boolean z3) {
if (this.D == null) {
this.D = new UpdateManager(this);
this.D.a((com.qihoo.appstore.utils.da) this);
}
this.D.a(z, z2, z3);
}
public void b(Intent intent) {
a(P(), intent);
}
public void b(String str) {
Intent intent = new Intent(e(), (Class<?>) PopluarizeActivity.class);
if (str == null || str.length() == 0) {
str = "http://www.so.com";
}
Bundle bundle = new Bundle();
bundle.putString("detail_url", str);
intent.putExtras(bundle);
b(intent);
}
public void b(boolean z) {
if (z) {
try {
if (O()) {
return;
}
} catch (Exception e2) {
e2.printStackTrace();
return;
}
}
if (this.O.size() == 1) {
if (this.k) {
finish();
return;
} else {
com.qihoo.appstore.utils.de.a((Activity) this, false);
return;
}
}
String str = (String) this.O.removeLast();
String str2 = (String) this.O.getLast();
this.f670a.clearFocus();
if (str2 == null) {
a(0, (Bundle) null);
} else if (str2.contains("Wallpaper_page")) {
this.O.removeLast();
e().b(new Intent(e(), (Class<?>) WallpaperActivity.class));
} else if (str2.contains("Video_page")) {
this.O.removeLast();
e().b(new Intent(e(), (Class<?>) VideoMainActivity.class));
} else {
b(str2, K().getActivity(str2).getIntent());
}
c(str);
if (!this.v || this.m == null || this.m.d() || !d(g())) {
return;
}
u();
this.v = false;
}
public void b(boolean z, boolean z2) {
if (z) {
PushMessageHandle.b(true);
} else {
PushMessageHandle.b(false);
}
}
public boolean b() {
return G;
}
public Activity c() {
if (this.O.size() <= 0) {
return null;
}
return K().getActivity((String) this.O.getLast());
}
public void c(boolean z) {
try {
long currentTimeMillis = System.currentTimeMillis();
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "--clearCacheFast time=" + (System.currentTimeMillis() - currentTimeMillis));
}
} catch (Exception e2) {
}
if (z) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "complete exit");
}
((NotificationManager) getSystemService("notification")).cancel(428410902);
com.qihoo.appstore.f.g.o();
e().d(z);
} else if (com.qihoo.appstore.f.g.y()) {
runOnUiThread(new ea(this));
}
if (C == this) {
C = null;
}
if (com.qihoo.appstore.f.cx.f(this)) {
com.qihoo.appstore.f.g.b(true);
}
}
public void d() {
e().a(false);
this.E.b(this.E.a(C));
com.qihoo.appstore.personnalcenter.g.a(this, "qt", Config.INVALID_IP);
com.qihoo.appstore.personnalcenter.g.a(this, "qid", Config.INVALID_IP);
com.qihoo.appstore.personnalcenter.g.a(this, "account", Config.INVALID_IP);
com.qihoo.appstore.personnalcenter.g.a(this, "nick_name", Config.INVALID_IP);
com.qihoo.appstore.personnalcenter.g.a(this, "user_name", Config.INVALID_IP);
com.qihoo.appstore.personnalcenter.g.a(this, "head_pic", Config.INVALID_IP);
com.qihoo.appstore.personnalcenter.g.a(this, "level", Config.INVALID_IP);
com.qihoo.appstore.personnalcenter.a.b();
if (g().endsWith("webtg002")) {
i();
}
String g2 = g();
if (g2.endsWith("task01") || g2.endsWith("task02") || g2.endsWith("privi01") || g2.endsWith("privi02") || g2.endsWith("eventCenter") || g2.endsWith("editmyac") || g2.endsWith("friendapp")) {
i();
} else if (g2.endsWith("_wvrl")) {
i();
} else if (g2.endsWith("_set")) {
i();
}
try {
android.support.v4.a.c.a(getApplicationContext()).a(new Intent("BROADCAST_ACTION_LOGIN_STATE_CHANGED"));
} catch (Exception e2) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.d("MainActivity", "failed to send BROADCAST_ACTION_LOGIN_STATE_CHANGED broadcast.", e2);
}
}
com.qihoo.appstore.personnalcenter.friends.af.c();
com.qihoo.appstore.personnalcenter.friends.am.b();
NewAdminFragment.f2123a = false;
}
public void d(boolean z) {
PushMessageHandle.b();
stopService(new Intent(this, (Class<?>) DownloadCoreService.class));
stopService(new Intent(this, (Class<?>) DaemonCoreService.class));
Process.killProcess(Process.myPid());
}
@Override
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
Activity c;
if (keyEvent.getKeyCode() == 4 && (c = c()) != null) {
return c.dispatchKeyEvent(keyEvent);
}
if (keyEvent.getKeyCode() == 82 && keyEvent.getAction() == 0) {
com.qihoo.appstore.provider.a.a.a().h();
}
return super.dispatchKeyEvent(keyEvent);
}
public void e(boolean z) {
if (z) {
com.qihoo.appstore.personnalcenter.s.b().a(4001, new ep(this));
A();
}
}
@Override
public boolean f(boolean z) {
if (!z || !this.U || G || this.T || this.F == null) {
return true;
}
this.U = false;
R();
return true;
}
public boolean h() {
String g2 = g();
if (g2.endsWith("sf001") || g2.endsWith("home") || g2.endsWith("gm001") || g2.endsWith("dndl") || g2.endsWith("mblf") || g2.endsWith("manag") || g2.endsWith("yssy")) {
return aa == null || aa.getVisibility() != 0;
}
return false;
}
public void i() {
b(true);
}
public void j() {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "autoLoginFromDb");
}
this.F.a(this.W);
}
public void k() {
if (e() == null) {
return;
}
this.T = false;
this.l = true;
a(false);
v();
e(false);
b(true, false);
com.qihoo.appstore.personnalcenter.friends.af.f();
}
public void l() {
com.qihoo.appstore.personnalcenter.friends.af.f();
}
public void n() {
b(R.layout.menu_frame);
this.m = L();
this.m.setMode(0);
this.m.setTouchModeAbove(1);
this.m.setShadowWidthRes(R.dimen.shadow_width);
this.m.setBehindOffsetRes(R.dimen.slidingmenu_offset);
this.m.setShadowDrawable(R.drawable.shadow);
this.m.setFadeDegree(0.35f);
this.m.setOnOpenedListener(this);
g(false);
}
public boolean o() {
if (this.J == null) {
return false;
}
try {
this.J.setVisibility(8);
if (this.m != null) {
this.m.setSlidingEnabled(true);
}
if (this.J.getParent() instanceof ViewGroup) {
((ViewGroup) this.J.getParent()).removeView(this.J);
}
this.J = null;
} catch (Exception e2) {
this.J = null;
}
return true;
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.a("MainActivity", "onActivityResult, requestCode = " + i2 + ", resultCode = " + i3);
}
super.onActivityResult(i2, i3, intent);
if (i2 == 101) {
((PopluarizeActivity) K().getCurrentActivity()).onActivityResult(i2, i3, intent);
return;
}
if (i2 == 12345) {
((NetworkDetectActivity) K().getCurrentActivity()).onActivityResult(i2, i3, intent);
return;
}
if (i2 == 1550) {
Activity currentActivity = K().getCurrentActivity();
if (currentActivity instanceof AppInfoActivity) {
((AppInfoActivity) currentActivity).onActivityResult(i2, i3, intent);
return;
} else {
if (currentActivity instanceof NewCommentActivity) {
((NewCommentActivity) currentActivity).onActivityResult(i2, i3, intent);
return;
}
return;
}
}
if (i2 != 112 && i2 != 111 && i2 != 113) {
com.qihoo.appstore.share.a.a(this, 1).a(i2, i3, intent);
return;
}
Activity currentActivity2 = K().getCurrentActivity();
if (currentActivity2 instanceof UserInfoEditActivity) {
((UserInfoEditActivity) currentActivity2).onActivityResult(i2, i3, intent);
}
}
@Override
public void onAttachFragment(Fragment fragment) {
super.onAttachFragment(fragment);
com.qihoo.appstore.t.a.b("onAttachFragment", new String[0]);
}
@Override
public void onAttachedToWindow() {
com.qihoo360.mobilesafe.util.n.a("Ac", "at");
super.onAttachedToWindow();
com.qihoo.appstore.t.a.b("onAttachedToWindow", new String[0]);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.titleIcon:
u();
return;
case R.id.head_portrait:
case R.id.nick_name:
case R.id.button_login:
u();
s();
return;
default:
return;
}
}
@Override
public void onConfigurationChanged(Configuration configuration) {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("Info", "Main Activity Configuration change");
}
super.onConfigurationChanged(configuration);
}
@Override
@SuppressLint({"NewApi"})
public void onCreate(Bundle bundle) {
com.qihoo360.mobilesafe.util.n.a("Ac", "cr b");
if (Build.VERSION.SDK_INT >= 11) {
getWindow().setFlags(16777216, 16777216);
}
com.qihoo.appstore.utils.cl.a();
com.qihoo.explorer.a.a.f4380a = true;
com.qihoo.appstore.webview.z.a();
com.qihoo.appstore.utils.ac.f3721a = false;
com.qihoo.appstore.personnalcenter.friends.af.c = false;
com.qihoo.appstore.personnalcenter.friends.af.d = false;
com.qihoo.appstore.personnalcenter.friends.am.b();
NetworkMonitor.b().j();
NetworkMonitor.b().a(this);
if (!com.qihoo360.mobilesafe.a.a.f5313a && Build.VERSION.SDK_INT >= 9) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().permitAll().build());
}
super.onCreate(bundle);
try {
this.K = Integer.parseInt(com.qihoo.appstore.utils.de.j(this));
} catch (Throwable th) {
}
S();
UpdateManager.a();
V();
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "MainActivity onCreate()");
}
setContentView(R.layout.splash_view);
af();
com.qihoo.appstore.utils.d.a(this);
C = this;
n();
M = 1;
Iterator it = L.iterator();
while (it.hasNext()) {
((ff) it.next()).a();
}
com.qihoo.appstore.f.g.n = false;
com.qihoo.appstore.zhuanti.g.a();
com.qihoo.appstore.newadmin.m.a().a(this.X);
Q();
T();
this.E = new com.qihoo.appstore.personnalcenter.sdk.e(C);
this.T = false;
this.U = false;
this.l = false;
this.V = false;
NewAdminFragment.f2123a = false;
com.qihoo360.mobilesafe.util.n.a("Ac", "cr e");
PermForwardService.a(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return true;
}
@Override
public void onDestroy() {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "main activity destroy");
}
com.qihoo.appstore.newsearch.bp.b().g();
aa = null;
com.qihoo.appstore.notification.b.a();
com.qihoo.appstore.f.g.m = 0L;
com.qihoo.appstore.f.g.q = -1;
com.qihoo.appstore.f.g.a(this);
if (com.qihoo.express.mini.activity.aa.b() != null) {
com.qihoo.express.mini.activity.aa.b().c();
}
if (C == this) {
if (this.f670a != null) {
this.f670a.removeAllViews();
this.B = null;
}
com.qihoo.appstore.utils.d.a();
if (this.D != null) {
this.D.b();
this.D.a((com.qihoo.appstore.utils.da) null);
this.D = null;
}
com.qihoo.appstore.newHomePage.b.a().b();
com.qihoo.appstore.f.g.a(new ed(this));
com.qihoo.appstore.utils.m.a();
com.qihoo.appstore.utils.ac.a();
com.qihoo.appstore.utils.cm.b();
com.qihoo.appstore.personnalcenter.s.b().a();
NetworkMonitor.b().a();
}
M = 0;
if (L != null) {
for (ff ffVar : L) {
if (ffVar != null) {
ffVar.d();
}
}
L.clear();
}
if (K() != null) {
K().removeAllActivities();
}
com.qihoo.appstore.newadmin.m.a().b();
if (this.E != null) {
this.E.c();
}
super.onDestroy();
}
@Override
public boolean onKeyDown(int i2, KeyEvent keyEvent) {
if (this.h) {
return true;
}
switch (i2) {
case 4:
if (this.m.d()) {
u();
return true;
}
if (o()) {
return true;
}
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "getting keycode");
}
Activity currentActivity = K().getCurrentActivity();
if ((currentActivity instanceof RingSearchActivity) && ((RingSearchActivity) currentActivity).c.getVisibility() == 8) {
((RingSearchActivity) currentActivity).b();
return true;
}
i();
if ((currentActivity instanceof FriendAppPageActivity) && com.qihoo.appstore.personnalcenter.friends.b.f2946a) {
UserInfoActivity1.a(new Bundle(), 0, "friend");
return true;
}
if ((currentActivity instanceof LbsActivity) && LbsActivity.f2983a) {
UserInfoActivity1.a(new Bundle(), 0, "nearby");
return true;
}
if ((currentActivity instanceof FriendRelationshipActivity) && FriendRelationshipActivity.f2922a) {
i();
new com.qihoo.appstore.personnalcenter.friends.b(this).a(com.qihoo.appstore.personnalcenter.friends.b.f2946a, false);
return true;
}
if (!NewAdminFragment.f2123a) {
return true;
}
NewAdminFragment.f2123a = false;
if (currentActivity instanceof PopluarizeActivity) {
UserInfoActivity1.a(new Bundle(), 0, Config.INVALID_IP);
}
return true;
case 84:
com.qihoo.appstore.utils.bk.c("Gyz", "(Mainact)click in search button ");
a(9, (Bundle) null);
return true;
default:
return super.onKeyDown(i2, keyEvent);
}
}
@Override
public boolean onMenuOpened(int i2, Menu menu) {
Activity c = c();
return c == null || !((c instanceof NetworkDetectActivity) || (c instanceof NetworkIsNotOkActivity));
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "-------onNewIntent----" + intent);
}
if (intent == null || intent.getBooleanExtra("keep_orgin", false)) {
return;
}
H = intent;
if (this.I) {
a("onNewIntent", intent, true);
} else {
this.r.postDelayed(new da(this, intent), 100L);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
switch (menuItem.getItemId()) {
case R.id.quit:
com.qihoo.appstore.utils.de.a((Activity) C, true);
break;
case R.id.feedback:
Intent intent = new Intent(e(), (Class<?>) FeedBackActivity.class);
if (this.m.d()) {
this.v = true;
}
b(intent);
break;
case R.id.setting:
Intent intent2 = new Intent(getBaseContext(), (Class<?>) PreferencesActivity.class);
if (this.m.d()) {
this.v = true;
}
b(intent2);
break;
case R.id.share:
App app = new App();
app.m(getBaseContext().getPackageName());
app.o(getResources().getString(R.string.app_name));
app.n("100084");
com.qihoo.appstore.d.n nVar = new com.qihoo.appstore.d.n(C);
nVar.a(app);
nVar.show();
break;
case R.id.account:
if (!e().b()) {
Intent intent3 = new Intent(getBaseContext(), (Class<?>) UserLoginActivity.class);
intent3.putExtra("login_route", "menu");
if (this.m.d()) {
this.v = true;
}
e().b(intent3);
break;
} else {
UserInfoEditActivity.a(this);
break;
}
case R.id.night_mode:
if (!com.qihoo.appstore.o.a.c.c(this)) {
if (!com.qihoo.appstore.o.a.c.b(C)) {
com.qihoo.appstore.o.a.c.a(C, true, com.qihoo.appstore.o.a.c.a(C));
com.qihoo.appstore.o.a.c.b(C, true);
break;
} else {
new com.qihoo.appstore.o.a.a(C, false).show();
break;
}
} else {
com.qihoo.appstore.o.a.c.a(C, false, com.qihoo.appstore.o.a.c.a(C));
com.qihoo.appstore.o.a.c.b(C, false);
break;
}
}
}
@Override
public void onPause() {
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "MainActivity onPause");
}
if (this.N != null) {
this.N.dismiss();
}
super.onPause();
this.Z = false;
M = 1;
Iterator it = L.iterator();
while (it.hasNext()) {
((ff) it.next()).c();
}
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem item = menu.getItem(4);
if (G) {
item.setTitle(R.string.logout);
} else {
item.setTitle(R.string.login_count);
}
MenuItem item2 = menu.getItem(2);
if (com.qihoo.appstore.o.a.c.c(this)) {
item2.setIcon(R.drawable.m_menu_day);
item2.setTitle(R.string.day_mode);
} else {
item2.setIcon(R.drawable.m_menu_night);
item2.setTitle(R.string.nightly_model);
}
return super.onPrepareOptionsMenu(menu);
}
@Override
public void onResume() {
com.qihoo360.mobilesafe.util.n.a("Ac", "rs b");
super.onResume();
if (C == null) {
C = this;
}
this.Z = true;
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("MainActivity", "MainActivity onResume");
}
M = 2;
Iterator it = L.iterator();
while (it.hasNext()) {
((ff) it.next()).b();
}
if (PushMessageHandle.c()) {
PushMessageHandle.i();
}
this.V = false;
TextView textView = (TextView) findViewById(R.id.menu_adb_enable_txt);
ImageView imageView = (ImageView) findViewById(R.id.menu_adb_enable_btn);
boolean D = com.qihoo.appstore.utils.de.D(AppStoreApplication.d());
if (textView != null) {
textView.setText(D ? "开启USB调试" : "开启USB调试");
}
if (imageView != null) {
imageView.setImageResource(D ? R.drawable.slidding_menu_adb_enable_open : R.drawable.slidding_menu_adb_enable_close);
}
com.qihoo.appstore.t.a.a("onAttachedToWindow", new String[0]);
com.qihoo.appstore.t.a.a("onAttachFragment", new String[0]);
com.qihoo360.mobilesafe.util.n.a("Ac", "rs e");
}
@Override
public void onSaveInstanceState(Bundle bundle) {
}
public void p() {
X();
}
public void q() {
if (this.m.d()) {
u();
}
this.f670a.clearChildFocus(this.f670a.getFocusedChild());
this.f670a.clearFocus();
Intent intent = new Intent(this, (Class<?>) UserLoginActivity.class);
intent.putExtra("login_route", "home");
b(intent);
}
public void r() {
if (G) {
s();
} else {
q();
}
}
public void s() {
a(0);
}
public boolean t() {
return this.Z;
}
public void u() {
if (this.m != null) {
if (this.m.d()) {
if (this.n >= 0) {
this.m.setSlidingEnabled(this.n != 0);
}
this.m.c();
} else {
this.n = this.m.a() ? 1 : 0;
this.m.setSlidingEnabled(true);
if (this.y == null) {
y();
}
v();
this.m.c();
}
}
}
public void v() {
if (this.m != null) {
boolean z = (com.qihoo.appstore.personnalcenter.g.a(this) || this.T || this.l || this.U || com.qihoo.appstore.utils.ct.a(com.qihoo.appstore.personnalcenter.g.b(this, "qt"))) ? false : true;
if (G || z) {
this.y.a(com.qihoo.appstore.personnalcenter.g.b(getBaseContext(), "head_pic"), R.drawable.home_title_avatar);
this.t.setText(com.qihoo.appstore.personnalcenter.q.b(this));
findViewById(R.id.user_info).setVisibility(8);
findViewById(R.id.arrow).setVisibility(0);
} else {
this.t.setText(R.string.login_own_center);
this.y.a(Config.INVALID_IP, R.drawable.home_title_avatar);
findViewById(R.id.user_info).setVisibility(0);
findViewById(R.id.arrow).setVisibility(8);
}
}
B();
x();
}
public void w() {
String b2 = com.qihoo.appstore.personnalcenter.g.b(getBaseContext(), "qid");
String b3 = com.qihoo.appstore.personnalcenter.g.b(getBaseContext(), "qt");
aa();
if (G) {
com.qihoo.appstore.personnalcenter.a.a(C, b2, b3, new ec(this));
}
}
public void x() {
long a2 = com.qihoo.appstore.utils.f.a("pref_clear_onekey_space", -1L);
if (com.qihoo.appstore.utils.ac.a("show_mobile_clear_icon", this) && a2 < 0) {
((TextView) findViewById(R.id.mobile_clear)).setCompoundDrawablesWithIntrinsicBounds(R.drawable.sillding_menu_mobile_clear, 0, R.drawable.button_new, 0);
findViewById(R.id.mobile_clear_info).setVisibility(8);
return;
}
((TextView) findViewById(R.id.mobile_clear)).setCompoundDrawablesWithIntrinsicBounds(R.drawable.sillding_menu_mobile_clear, 0, 0, 0);
TextView textView = (TextView) findViewById(R.id.mobile_clear_info);
if (a2 > 0) {
textView.setText(String.format(getString(R.string.mobile_clear_sllding_menu_info3), com.qihoo.appstore.utils.ao.a(getBaseContext(), a2, true)));
} else {
textView.setText(MobileClearLauncher.getSilldingMenuInfo(this));
}
textView.setVisibility(0);
}
public void y() {
if (this.m.getMenu().findViewById(R.id.left_scroll_menu) == null) {
this.m.setMenu(R.layout.personnal_center_enter);
}
this.ad = (ScrollView) findViewById(R.id.left_scroll_menu);
this.ae = findViewById(R.id.res_push);
if (com.qihoo.appstore.utils.ac.c(this)) {
((TextView) this.ae).setCompoundDrawablesWithIntrinsicBounds(R.drawable.slidding_menu_fast_tranlater, 0, 0, 0);
com.qihoo.appstore.utils.ac.a((Context) this, false);
}
this.t = (TextView) findViewById(R.id.nick_name);
this.y = (HomeTitleAvatarIcon) findViewById(R.id.head_portrait);
this.y.setDefaultMeasurement(com.qihoo.appstore.utils.de.a(45.0f));
this.y.setBorderSize(com.qihoo.appstore.utils.de.a(2.0f));
this.z = (Button) findViewById(R.id.coin_signin_btn);
this.A = (Button) findViewById(R.id.lottery_btn);
this.s = findViewById(R.id.personnal_center_account_login);
this.s.setOnClickListener(this.w);
this.u = findViewById(R.id.scan_wifi_connect_view);
this.u.setOnClickListener(this.w);
this.ae.setOnClickListener(this.w);
this.z.setOnClickListener(this.w);
this.A.setOnClickListener(this.w);
findViewById(R.id.guess_you_like_view).setOnClickListener(this.w);
findViewById(R.id.my_favorite_view).setOnClickListener(this.w);
findViewById(R.id.setting_view).setOnClickListener(this.w);
((TextView) findViewById(R.id.textview_version)).setText(getString(R.string.now_version) + String.valueOf(com.qihoo.express.mini.c.a.a().i()));
findViewById(R.id.upgrade_view).setOnClickListener(this.w);
findViewById(R.id.feedback_view).setOnClickListener(this.w);
findViewById(R.id.submit_app).setOnClickListener(this.w);
findViewById(R.id.network_detect).setOnClickListener(this.w);
findViewById(R.id.mobile_clear).setOnClickListener(this.w);
if (com.qihoo.appstore.utils.ac.a("show_mobile_clear_icon", this)) {
((TextView) findViewById(R.id.mobile_clear)).setCompoundDrawablesWithIntrinsicBounds(R.drawable.sillding_menu_mobile_clear, 0, R.drawable.button_new, 0);
} else {
((TextView) findViewById(R.id.mobile_clear)).setCompoundDrawablesWithIntrinsicBounds(R.drawable.sillding_menu_mobile_clear, 0, 0, 0);
TextView textView = (TextView) findViewById(R.id.mobile_clear_info);
textView.setText(MobileClearLauncher.getSilldingMenuInfo(this));
textView.setVisibility(8);
}
findViewById(R.id.file_explorer_item).setOnClickListener(this.w);
findViewById(R.id.menu_adb_enable).setOnClickListener(this.w);
TextView textView2 = (TextView) findViewById(R.id.menu_adb_enable_txt);
ImageView imageView = (ImageView) findViewById(R.id.menu_adb_enable_btn);
boolean D = com.qihoo.appstore.utils.de.D(AppStoreApplication.d());
if (textView2 != null) {
textView2.setText(D ? "开启USB调试" : "开启USB调试");
}
if (imageView != null) {
imageView.setImageResource(D ? R.drawable.slidding_menu_adb_enable_open : R.drawable.slidding_menu_adb_enable_close);
imageView.setOnClickListener(this.w);
}
this.m.setOnOpenListener(new eo(this, textView2, imageView));
findViewById(R.id.freewifi).setOnClickListener(this.w);
if (com.qihoo.appstore.utils.ac.a("show_freewifi_icon", this)) {
((TextView) findViewById(R.id.freewifi)).setCompoundDrawablesWithIntrinsicBounds(R.drawable.sillding_menu_freewifi, 0, R.drawable.button_new, 0);
}
if (com.qihoo.appstore.h.a.b()) {
findViewById(R.id.freewifi).setVisibility(0);
} else {
findViewById(R.id.freewifi).setVisibility(8);
}
}
public void z() {
com.qihoo.usermsgcenter.e.a(this).a(new fg(null));
}
}