We are using Custom tablet power by Qualcomm 845 SOC

162 views
Skip to first unread message

Himanshu Mistri

unread,
Jul 2, 2019, 10:25:07 AM7/2/19
to android-porting
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 processes

For 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 checking 

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.

Satish Patel

unread,
Jul 3, 2019, 6:42:19 PM7/3/19
to mistrih...@gmail.com, android-porting
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 processes

For 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 checking 

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");
}
Code is there for specific reason as mentioned. If at all you want to use webview then just remove 
uid == 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-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.


--
Regards,
satish patel

Himanshu Mistri

unread,
Jul 5, 2019, 7:12:40 PM7/5/19
to android-porting
We don't want to remove that check:- 

uid == android.os.Process.SYSTEM_UID As it will raise Security concerns, We are looking into a solution which is security safe.


On Thursday, 4 July 2019 04:12:19 UTC+5:30, Satish Patel wrote:
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 processes

For 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 checking 

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");
}
Code is there for specific reason as mentioned. If at all you want to use webview then just remove 
uid == 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.

--
--

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.


--
Regards,
satish patel
Reply all
Reply to author
Forward
0 new messages