final int uid = android.os.Process.myUid();
if (uid == android.os.Process.ROOT_UID || uid == android.os.Process.SYSTEM_UID || uid == android.os.Process.PHONE_UID || uid == android.os.Process.NFC_UID || uid == android.os.Process.BLUETOOTH_UID)
{ throw new UnsupportedOperationException( "For security reasons, WebView is not allowed in privileged processes");
}| But doing this case raise security concern which never wants to allow So can anyone suggest a more feasible solution to un WebView on system app. |
We have our System application (.apk) installed on the device with system signature. Now we want to use WebView of android for loading HTML pages on UI. When we try to use WebView on our application, It does not allow and showing below the crash log.Caused by: java.lang.UnsupportedOperationException: For security reasons, WebView is not allowed in privileged processesFor Solution of this issue, we might do the following by removing following code checking from https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/webkit/WebViewFactory.java :IF we remove the following checkingfinal int uid = android.os.Process.myUid();
if (uid == android.os.Process.ROOT_UID || uid == android.os.Process.SYSTEM_UID || uid == android.os.Process.PHONE_UID || uid == android.os.Process.NFC_UID || uid == android.os.Process.BLUETOOTH_UID)
{ throw new UnsupportedOperationException( "For security reasons, WebView is not allowed in privileged processes");
}
But doing this case raise security concern which never wants to allow So can anyone suggest a more feasible solution to un WebView on system app.
--
--
unsubscribe: android-porti...@googlegroups.com
website: http://groups.google.com/group/android-porting
---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-porti...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/eec89286-e5d9-483a-8a20-2fa0bc3040e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Tue, Jul 2, 2019 at 7:55 PM Himanshu Mistri <mistrih...@gmail.com> wrote:We have our System application (.apk) installed on the device with system signature. Now we want to use WebView of android for loading HTML pages on UI. When we try to use WebView on our application, It does not allow and showing below the crash log.Caused by: java.lang.UnsupportedOperationException: For security reasons, WebView is not allowed in privileged processesFor Solution of this issue, we might do the following by removing following code checking from https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/webkit/WebViewFactory.java :IF we remove the following checkingfinal int uid = android.os.Process.myUid();
if (uid == android.os.Process.ROOT_UID || uid == android.os.Process.SYSTEM_UID || uid == android.os.Process.PHONE_UID || uid == android.os.Process.NFC_UID || uid == android.os.Process.BLUETOOTH_UID)
{ throw new UnsupportedOperationException( "For security reasons, WebView is not allowed in privileged processes");
}
Code is there for specific reason as mentioned. If at all you want to use webview then just removeuid == android.os.Process.SYSTEM_UID check.
--
But doing this case raise security concern which never wants to allow So can anyone suggest a more feasible solution to un WebView on system app.
--
unsubscribe: android...@googlegroups.com
website: http://groups.google.com/group/android-porting
---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/eec89286-e5d9-483a-8a20-2fa0bc3040e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Regards,
satish patel