QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 LiveBaseRoomPage.java 源代码,内容仅作参考
package com.tencent.mtt.nowlivewrapper.pages.room;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.net.Uri;
import android.widget.FrameLayout;
import com.facebook.common.util.UriUtil;
import com.tencent.falco.utils.ThreadCenter;
import com.tencent.mtt.base.NowLiveLiteWrapper;
import com.tencent.mtt.base.nativeframework.NativePage;
import com.tencent.mtt.base.stat.utils.PlatformStatUtils;
import com.tencent.mtt.base.utils.QBUrlUtils;
import com.tencent.mtt.browser.window.IPage;
import com.tencent.mtt.browser.window.IWebView;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.browser.window.templayer.BaseNativeGroup;
import com.tencent.mtt.nowlivewrapper.pages.NowLivePageContainer;
import com.tencent.now.utils.NowLogs;
import com.tencent.now.utils.event.EventCenter;
import com.tencent.now.utils.event.Eventor;
import com.tencent.now.utils.event.impl.OnEvent;
import com.tencent.now.webcomponent.WebCookieManager;
import com.tencent.now.webcomponent.event.CloseNativePageEvent;
import com.tencent.now.webcomponent.event.OpenNewNativePageEvent;
import com.xiaomi.mipush.sdk.Constants;
import java.net.URLEncoder;
import java.util.HashMap;
public class LiveBaseRoomPage extends NativePage implements ThreadCenter.HandlerKeyable {
public UrlParams f68634a;
public String f68635b;
public Context f68636c;
public boolean f68637d;
public boolean e;
protected Eventor f;
public LiveBaseRoomPage(Context context, FrameLayout.LayoutParams layoutParams, BaseNativeGroup baseNativeGroup, UrlParams urlParams) {
super(context, layoutParams, baseNativeGroup);
this.f68637d = false;
this.e = false;
this.f = new Eventor();
PlatformStatUtils.a("action_nowlive_wrapper_enter_lite_sdk");
setBackgroundColor(-16777216);
this.f68636c = context;
this.f68634a = urlParams;
this.f68635b = d();
b();
a();
EventCenter.a();
ThreadCenter.a(this, new Runnable() {
@Override
public void run() {
if (LiveBaseRoomPage.this.f68636c == null || !(LiveBaseRoomPage.this.f68636c instanceof Activity)) {
return;
}
((Activity) LiveBaseRoomPage.this.f68636c).getWindow().addFlags(128);
}
}, 5000L);
c();
}
private void b() {
NowLiveLiteWrapper.q().r();
NowLiveLiteWrapper.q().s();
this.e = true;
}
private void c() {
this.f.a(new OnEvent<OpenNewNativePageEvent>() {
@Override
public void a(OpenNewNativePageEvent openNewNativePageEvent) {
LiveBaseRoomPage.this.a(openNewNativePageEvent);
}
});
this.f.a(new OnEvent<CloseNativePageEvent>() {
@Override
public void a(CloseNativePageEvent closeNativePageEvent) {
if (LiveBaseRoomPage.this.getNativeGroup() != null) {
LiveBaseRoomPage.this.getNativeGroup().back();
}
}
});
}
private String d() {
UrlParams urlParams = this.f68634a;
if (urlParams != null) {
String str = urlParams.f46351a;
if ("qb://nowlive".equals(str)) {
if (this.f68634a.h != null) {
return this.f68634a.h.getString("nowsdkparam");
}
} else {
if (str.startsWith("qb://nowlive")) {
return QBUrlUtils.d(str.replaceAll("\\?", Constants.ACCEPT_TIME_SEPARATOR_SP)).get("nowsdkparam");
}
if (str.startsWith("qb://ext/nowliveroom")) {
try {
return URLEncoder.encode(Uri.parse(str).getQueryParameter("nowsdkparam"), "UTF-8");
} catch (Exception unused) {
NowLogs.e("SchemeUtil", "parse nowSdkParam decode exception");
return null;
}
}
}
}
return "";
}
protected void a() {
WebCookieManager.a(this.f68636c, ".qq.com");
WebCookieManager.a(this.f68636c, "https://ilive.qq.com".replace(UriUtil.HTTPS_SCHEME, UriUtil.HTTP_SCHEME));
WebCookieManager.a(this.f68636c, "https://now.qq.com".replace(UriUtil.HTTPS_SCHEME, UriUtil.HTTP_SCHEME));
WebCookieManager.a(this.f68636c, "https://ilive.qq.com");
WebCookieManager.a(this.f68636c, "https://now.qq.com");
}
protected void a(OpenNewNativePageEvent openNewNativePageEvent) {
String str = openNewNativePageEvent.f76176a;
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("roomId", openNewNativePageEvent.f76177b);
hashMap.put("programId", openNewNativePageEvent.f76178c);
hashMap.put("source", openNewNativePageEvent.f76179d);
hashMap.put("liveInfo", openNewNativePageEvent.e);
getNativeGroup().replacePage(getNativeGroup().getCurrentPage(), ((NowLivePageContainer) getNativeGroup()).a(str, this.f68636c, null, hashMap));
getNativeGroup().forward();
}
@Override
public void active() {
super.active();
}
@Override
public boolean coverToolbar() {
return true;
}
@Override
public void deactive() {
super.deactive();
}
@Override
public void destroy() {
super.destroy();
ThreadCenter.a(this);
Context context = this.f68636c;
if (context != null && (context instanceof Activity)) {
((Activity) context).getWindow().clearFlags(128);
}
this.f.a();
}
@Override
public IPage.INSTANT_TYPE getInstType() {
return IPage.INSTANT_TYPE.DEFAULT_MULTI;
}
@Override
public IPage.POP_TYPE getPopType() {
return IPage.POP_TYPE.INCLUDE_SELF;
}
@Override
public String getUrl() {
return "qb://nowlive";
}
@Override
public boolean isSupportSkinBg() {
return true;
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
if (configuration.orientation == 2) {
this.f68637d = true;
} else if (configuration.orientation == 1) {
this.f68637d = false;
}
}
@Override
public void onStart() {
super.onStart();
}
@Override
public void onStop() {
super.onStop();
}
@Override
public void preActive() {
super.preActive();
}
@Override
public void preDeactive() {
super.preDeactive();
}
@Override
public IWebView.STATUS_BAR statusBarType() {
return IWebView.STATUS_BAR.NO_SHOW_LIGHT;
}
}