Reputation: 31497
I'm trying to embed the Crosswalk runtime as a WebView
replacement in an app with other Java code (i.e. not as a simple wrapper for a web app).
Now their official documentation says you need the following permissions in any case:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
This is a lot!
So I tried with fewer permissions. What I found is that the following permissions are really required in any case:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
This is okay. So if this was sufficient, it would be a significant improvement over the list given in the docs.
But maybe the others are required in some cases as well. Can someone clarify? In what situations are the other permissions needed? Only when some action is triggered via JavaScript? Then one may use Crosswalk without these, probably, right?
Upvotes: 2
Views: 1815
Reputation: 3221
while you are correct about what the official documentation states, it's also true that there is some conflicting information on the crosswalk site.
Specifically, this link buried in the Cordova migration section:
Migrate using command line tools
suggests that:
Crosswalk requires a couple of extra permissions which are not inserted by the Cordova application generator.
and cites specifically:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Point is, cordova only adds
<uses-permission android:name="android.permission.INTERNET" />
and therefore one must derive that the only truly required permissions are:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
as you correctly concluded.
My guess is that the Crosswalk team added to the list the union of all permissions collectively needed by all features/extensions supported by the webview (which includes accessing the camera for WebRTC sessions).
In that regard, the list is appropriate (as quite similar to the ones other stand-alone browsers sport) and was possibly provided to cut short on the explanations.
Btw, I have made a test and removed the "CAMERA" permission from the manifest, and the webview handled the absence graciously (it didn't crash the application, the camera just stopped working and gave a black picture), which seems to point out that you can handle the webview to your users for generic browsing even with the limited set of permissions (but don't take my word on this: I just tried the camera!)
Hope this helps
Upvotes: 2