UncaughtException detected: android.os.FileUriExposedException: file:///storage/emulated/0/DCIM/Camera/1536649175379.jpg exposed beyond app through ClipData.Item.getUri() at android.os.StrictMode.onFileUriExposed(StrictMode.java:1958) at android.net.Uri.checkFileUriExposed(Uri.java:2356) at android.content.ClipData.prepareToLeaveProcess(ClipData.java:941) at android.content.Intent.prepareToLeaveProcess(Intent.java:9747) at android.content.Intent.prepareToLeaveProcess(Intent.java:9732) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1611) at android.app.Activity.startActivityForResult(Activity.java:4536) at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:65) at android.app.Activity.startActivityForResult(Activity.java:4494) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:711) at android.app.Activity.startActivity(Activity.java:4855) at android.app.Activity.startActivity(Activity.java:4823) at android.content.ContextWrapper.startActivity(ContextWrapper.java:376) at org.chromium.android_webview.ResourcesContextWrapperFactory$WebViewContextWrapper.startActivity(Unknown Source:11) at com.tencent.tbs.core.partner.b.a$2.onClick(Unknown Source:406) at android.view.View.performClick(View.java:6266) at android.view.View$PerformClick.run(View.java:24730) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:171) at android.app.ActivityThread.main(ActivityThread.java:6672) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:246) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
LinearLayout fuckTbsLayout; List<TextView> fuckTextViews; @Override public void onViewAdded(View child) { if (child.getClass().getName().startsWith("com.tencent.tbs.") && child instanceof LinearLayout && ((LinearLayout) child).getChildCount() > 0 ) { fuckTbsLayout = (LinearLayout) child; TextView fuckItem; if (fuckTbsLayout.getChildAt(0) instanceof TextView) { fuckItem = (TextView) fuckTbsLayout.getChildAt(0); String fuckTitle = fuckItem.getText().toString(); if (fuckTitle.contains("请选择上传方式") || fuckTitle.contains("相册") || fuckTitle.contains("拍照") || fuckTitle.contains("其它方式")) { fuckTextViews = new ArrayList<>(); for (int i = 0; i < fuckTbsLayout.getChildCount(); i++) { TextView fuckTextView = null; if (fuckTbsLayout.getChildAt(i) instanceof TextView) { fuckTextView = (TextView) fuckTbsLayout.getChildAt(i); } if (fuckTextView != null && fuckTextView.getText().toString().trim().contains("拍照")) { fuckTextViews.add(fuckTextView); } } if (fuckTextViews != null && fuckTextViews.size() > 0) { for (TextView todoRemoveFuckTextView : fuckTextViews) { fuckTbsLayout.removeView(todoRemoveFuckTextView); } } fuckTextViews = null; } } } super.onViewAdded(child); } //sorry for the F words.
主要思想就是在 WebView 的 onViewAdded 方法中做手脚,此方法是作甚的呢?
1 2 3 4 5 6 7 8
/** * Called when a new child is added to this ViewGroup. Overrides should always * call super.onViewAdded. * * @param child the added child view */ public void onViewAdded(View child) { }