| | |
| | | import android.net.Uri; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.annotation.RequiresApi; |
| | | |
| | | import android.util.Base64; |
| | | import android.util.Log; |
| | | import android.view.KeyEvent; |
| | |
| | | import com.alibaba.baichuan.android.trade.model.AlibcShowParams; |
| | | import com.alibaba.baichuan.trade.biz.AlibcConstants; |
| | | import com.alibaba.baichuan.trade.biz.applink.adapter.AlibcFailModeType; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailActivity; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.wpc.library.okhttp.OkHttpUtils; |
| | | import com.wpc.library.util.JDLinkCutUtil; |
| | |
| | | |
| | | private boolean interceptGoodsDetail; |
| | | |
| | | private String originalUrl=""; |
| | | private String originalUrl = ""; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | |
| | | AndroidBug5497Workaround.assistActivity(this); |
| | | TopStatusSettings.setStatusViewAndDeepColor(this); |
| | | String url = getIntent().getStringExtra("url"); |
| | | originalUrl=url; |
| | | originalUrl = url; |
| | | //是否允许粘贴板推荐 |
| | | String clipboradStr = getIntent().getStringExtra("clipboard"); |
| | | interceptGoodsDetail = getIntent().getBooleanExtra("interceptGoodsDetail", true); |
| | |
| | | webSettings.setPluginState(WebSettings.PluginState.ON); |
| | | webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);//设置缓存模式(根据cache-control决定是否从网络上取数据。) |
| | | //团油特殊设置 |
| | | if(originalUrl!=null&&originalUrl.contains(".czb365.com")) { |
| | | if (originalUrl != null && originalUrl.contains(".czb365.com")) { |
| | | webSettings.setUserAgentString("BLKS+Android"); |
| | | } |
| | | webview.setDrawingCacheEnabled(true); |
| | |
| | | @Override |
| | | public boolean shouldOverrideUrlLoading(WebView view, String url) { |
| | | // Log.e("mResult", "shouldOverrideUrlLoading----" + url); |
| | | if (goodsDetail&&interceptGoodsDetail) { |
| | | if (goodsDetail && interceptGoodsDetail) { |
| | | String taoBaoId = TaobaoLinkCutUtil.linkCutId(url); |
| | | String JDId = null; |
| | | String PDDId = null; |
| | |
| | | return true; |
| | | } |
| | | } |
| | | if (url != null && url.startsWith("yestv://copy")) { |
| | | if (url != null && url.startsWith("yestv://copy")) { |
| | | String murl = url.split("yestv://")[1]; |
| | | String[] params = murl.split("#"); |
| | | byte raw[] = Base64.decode(params[1], Base64.DEFAULT); |
| | |
| | | |
| | | @Override |
| | | public boolean onConsoleMessage(ConsoleMessage consoleMessage) { |
| | | Log.i("ShareBrowserActivity",consoleMessage.message() +" "+consoleMessage.lineNumber()); |
| | | Log.i("ShareBrowserActivity", consoleMessage.message() + " " + consoleMessage.lineNumber()); |
| | | return super.onConsoleMessage(consoleMessage); |
| | | } |
| | | |
| | |
| | | boolean extend = jsonObject.optJSONObject("data").optBoolean("extend"); |
| | | // Log.e("mResult", "extend:" + extend); |
| | | if (extend) {//有推广 |
| | | Intent intent = GoodsDetailJumpUtil.getGoodsDetailIntent(getApplicationContext(), goodsType); |
| | | |
| | | Intent intent = new Intent(getApplicationContext(), GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", goodsId); |
| | | intent.putExtra("goodsType", goodsType); |
| | | |
| | | intent.putExtra("id", goodsId); |
| | | intent.putExtra("from", "baichuanweb"); |
| | | startActivity(intent); |