360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0
以下内容为反编译后的 PopluarizeActivity.java 源代码,内容仅作参考
package com.qihoo.appstore.activities;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.WebBackForwardList;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.qihoo.appstore.webview.MusicWebView;
import com.qihoo.appstore.webview.MyVideoWebView;
import com.qihoo.appstore.webview.MyWebView;
import com.qihoo.freewifi.push.R;
public class PopluarizeActivity extends StatFragmentActivity implements com.qihoo.appstore.share.simple.f {
private String f681a;
private View f682b;
public MyWebView c;
public View f;
public TextView g;
public FrameLayout i;
private View n;
private com.qihoo.appstore.share.simple.c q;
boolean d = false;
boolean e = false;
private ImageView o = null;
boolean h = true;
private String p = null;
boolean j = true;
boolean k = false;
boolean l = false;
long m = 0;
public static String a(String str) {
String a2 = a(str, "webpg");
return a2 != null ? a2 : "popluarize";
}
private static String a(String str, String str2) {
if (str == null) {
return null;
}
try {
return Uri.parse(str).getQueryParameter(str2);
} catch (Exception e) {
return null;
}
}
public static boolean b(String str) {
return !"0".equals(a(str, "showTitleBar"));
}
public static boolean c(String str) {
return "1".equals(a(str, "nc"));
}
private boolean d(String str) {
return "1".equals(a(str, "play_music"));
}
private boolean e(String str) {
return "1".equals(a(str, "pvideo"));
}
private boolean f(String str) {
return "1".equals(a(str, "titlebar_space"));
}
private String g(String str) {
return a(str, "showSearch");
}
public void a(boolean z) {
this.l = z;
}
protected boolean a() {
if (!this.c.i()) {
try {
WebBackForwardList copyBackForwardList = this.c.copyBackForwardList();
if (copyBackForwardList != null) {
String url = copyBackForwardList.getCurrentItem().getUrl();
String url2 = copyBackForwardList.getItemAtIndex(0).getUrl();
if (url != null && url.equals(url2)) {
this.c.clearHistory();
}
}
} catch (Exception e) {
}
if (!this.c.canGoBack() || System.currentTimeMillis() - this.m <= 500) {
if (this.c != null) {
this.c.clearHistory();
this.c.goBack();
this.c.loadUrl("javascript:void document.body.innerHTML = '';");
}
new Handler().postDelayed(new fz(this), 500L);
} else {
this.m = System.currentTimeMillis();
this.c.goBack();
}
}
return true;
}
public boolean b() {
return this.c.d();
}
@Override
public com.qihoo.appstore.share.simple.c c() {
if (this.q == null) {
this.q = new ga(this, this);
}
return this.q;
}
@Override
public String getStatTag() {
return !TextUtils.isEmpty(this.p) ? this.p : this.mStatTag;
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
if (i != 101) {
super.onActivityResult(i, i2, intent);
} else if (this.c != null) {
this.c.a(i, i2, intent);
}
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
if (configuration.orientation == 2) {
this.f.setVisibility(8);
} else {
this.f.setVisibility(0);
}
}
@Override
public void onCreate(Bundle bundle) {
int i;
super.onCreate(bundle);
Bundle extras = getIntent().getExtras();
if (extras == null) {
finish();
}
this.f681a = extras.getString("detail_url");
boolean z = extras.getBoolean("fromPush", false);
if (z) {
String a2 = com.qihoo.appstore.notification.i.a(this, this.f681a);
if (!TextUtils.isEmpty(a2)) {
this.f681a = a2;
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b(com.qihoo.appstore.notification.i.f2873a, " use cache url:" + a2);
}
}
}
com.qihoo.appstore.webview.y.a(z);
this.p = extras.getString("statTag");
this.d = extras.getBoolean("refreshOnresume", false);
this.e = extras.getBoolean("refreshOnNewIntent", false);
String string = extras.getString("bannerIndex");
boolean c = !extras.containsKey("needCookie") ? c(this.f681a) : extras.getBoolean("needCookie", false);
boolean z2 = extras.getBoolean("showScan", true);
if ("0".equals(g(this.f681a))) {
z2 = false;
}
String lowerCase = this.f681a.toLowerCase();
boolean z3 = (true == lowerCase.startsWith("http://openbox.mobilem.360.cn/html/ebook") || true == lowerCase.startsWith("http://ebook.openbox.mobilem.360.cn") || true == lowerCase.startsWith("http://openbox.mobilem.360.cn/third/ebook")) ? false : z2;
boolean z4 = extras.getBoolean("forceNoCache", false);
this.h = extras.getBoolean("useJavaInterface", true);
String string2 = extras.getString("title");
if (!TextUtils.isEmpty(string)) {
try {
i = Integer.parseInt(string) + 1;
} catch (Exception e) {
i = 1;
}
this.mStatTag = "B" + i + "_";
}
setContentView(R.layout.popluarize_activity);
this.mStatTag += a(this.f681a);
this.f682b = findViewById(R.id.loading);
this.f = findViewById(R.id.title_bar);
if (f(this.f681a)) {
this.f.setBackgroundResource(R.drawable.title_bar_no_spacing);
}
if (!b(this.f681a)) {
this.f.setVisibility(8);
}
this.g = (TextView) findViewById(R.id.custom_button);
this.n = findViewById(R.id.retry);
this.i = (FrameLayout) findViewById(R.id.webview_container);
boolean d = d(this.f681a);
if (e(this.f681a)) {
this.c = new MyVideoWebView(this);
} else if (d) {
this.c = new MusicWebView(this);
} else {
this.c = new MyWebView(this);
}
this.i.addView(this.c, 0);
this.c.setCacheMode(z4 ? 1 : 0);
this.c.a(this.f682b, this.n, this.f);
this.c.g.setActivity(this);
this.c.setActivity(this);
findViewById(R.id.title_left_root).setOnClickListener(new fw(this));
this.c.clearHistory();
if (c) {
this.c.setNeedCookie(true);
}
this.o = (ImageView) findViewById(R.id.titleSearch);
if (z3) {
this.o.setVisibility(0);
this.o.setOnClickListener(new fx(this));
} else {
this.o.setVisibility(8);
}
if (!TextUtils.isEmpty(string2)) {
setTitle(string2);
} else if (this.f != null) {
((TextView) this.f.findViewById(R.id.title)).setText(R.string.isloading);
}
findViewById(R.id.title_shadow).setVisibility(8);
if (com.qihoo360.mobilesafe.a.a.f5313a) {
com.qihoo.appstore.utils.bk.b("PopluarizeActivity", this.f681a);
}
}
@Override
public void onDestroy() {
if (this.c != null) {
this.c.b();
this.c.loadUrl("javascript:document.body.innerHTML = '';");
this.c.destroy();
}
com.qihoo.appstore.webview.y.a(false);
if (this.q != null) {
this.q.c();
}
super.onDestroy();
}
@Override
public boolean onKeyDown(int i, KeyEvent keyEvent) {
return i == 4 ? a() : super.onKeyDown(i, keyEvent);
}
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
this.k = true;
}
@Override
public void onPause() {
super.onPause();
if (this.c != null) {
this.c.clearFocus();
this.c.g();
try {
if (this.c != null) {
this.c.getClass().getMethod("onPause", new Class[0]).invoke(this.c, (Object[]) null);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public void onResume() {
super.onResume();
if (this.j || this.l) {
if (this.f681a != null) {
this.c.loadUrl(this.f681a);
} else {
this.c.loadUrl("http://www.so.com");
}
this.j = false;
this.l = false;
}
if (this.c != null) {
this.c.requestFocus();
}
if (this.d || (this.k && this.e)) {
this.c.reload();
}
this.k = false;
this.c.f();
try {
if (this.c != null) {
this.c.getClass().getMethod("onResume", new Class[0]).invoke(this.c, (Object[]) null);
}
} catch (Exception e) {
e.printStackTrace();
}
if (MainActivity.e() == null || MainActivity.e().b() || getStatTag() == null || !getStatTag().endsWith("_wvrl")) {
return;
}
new Handler().post(new fy(this));
}
@Override
public void setTitle(CharSequence charSequence) {
this.c.a(true);
((TextView) this.f.findViewById(R.id.title)).setText(charSequence);
}
}