android: Add activity to import VPN profiles from JSON-encoded files
The file format is documented on the wiki. URLs to .sswan files may be intercepted and downloaded files with a media type of application/vnd.strongswan.profile may also be opened (the file extension doesn't matter in that case). Whether downloaded files for which the media type is not correct but the extension is .sswan can be opened depends on the app that issues the Intent. For instance, from the default Downloads app it won't work due to the content:// URLs that do not contain the file name but when opening the downloaded file from within Chrome's Downloads view it works as these Intents use file:// URLs, which contain the complete file name (the latter requires a new permission).
This commit is contained in:
1 parent
cf6110f152
commit
3107634e30
12 files changed
+1053
No files matched your search
@@ -20,6 +20,7 @@
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
||||
<application
|
||||
android:name=".logic.StrongSwanApplication"
|
||||
@@ -63,6 +64,33 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.VpnProfileImportActivity"
|
||||
android:label="@string/profile_import"
|
||||
android:taskAffinity=""
|
||||
android:excludeFromRecents="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="http" />
|
||||
<data android:scheme="https" />
|
||||
<data android:scheme="file" />
|
||||
<data android:scheme="content" />
|
||||
<data android:mimeType="application/vnd.strongswan.profile" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="http" />
|
||||
<data android:scheme="https" />
|
||||
<data android:scheme="file" />
|
||||
<data android:scheme="content" />
|
||||
<data android:host="*" />
|
||||
<data android:pathPattern=".*\\.sswan" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.TrustedCertificateImportActivity"
|
||||
android:label="@string/import_certificate"
|
||||
|
||||
Reference in new issue
Block a user