mirror of
https://github.com/outbackdingo/amnezia-client.git
synced 2026-01-27 10:18:14 +00:00
Get back the ability to open configuration files
Doesn't work in all applications because some applications pass an abstract URI instead of the file path in the 'content' scheme
This commit is contained in:
@@ -98,6 +98,34 @@
|
||||
|
||||
<data android:scheme="vpn" android:host="*" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data android:scheme="file" />
|
||||
<data android:scheme="content" />
|
||||
<data android:mimeType="*/*" />
|
||||
<data android:host="*" />
|
||||
|
||||
<data android:pathPattern=".*\\.vpn" />
|
||||
<data android:pathPattern=".*\\..*\\.vpn" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\.vpn" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\..*\\.vpn" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.vpn" />
|
||||
|
||||
<data android:pathPattern=".*\\.cfg" />
|
||||
<data android:pathPattern=".*\\..*\\.cfg" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\.cfg" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\..*\\.cfg" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.cfg" />
|
||||
|
||||
<data android:pathPattern=".*\\.conf" />
|
||||
<data android:pathPattern=".*\\..*\\.conf" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\.conf" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\..*\\.conf" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.conf" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
|
||||
@@ -55,15 +55,27 @@ class ImportConfigActivity : ComponentActivity() {
|
||||
return
|
||||
}
|
||||
|
||||
"text/plain" -> {
|
||||
intent.getStringExtra(EXTRA_TEXT)?.let(::startMainActivity)
|
||||
}
|
||||
"text/plain" -> intent.getStringExtra(EXTRA_TEXT)?.let(::startMainActivity)
|
||||
}
|
||||
}
|
||||
|
||||
ACTION_VIEW -> {
|
||||
Log.v(TAG, "Process VIEW action")
|
||||
intent.data?.toString()?.let(::startMainActivity)
|
||||
Log.v(TAG, "Process VIEW action, scheme: ${intent.scheme}")
|
||||
when (intent.scheme) {
|
||||
"file", "content" -> {
|
||||
intent.data?.let { uri ->
|
||||
checkPermissions(
|
||||
uri,
|
||||
onSuccess = ::processUri,
|
||||
onFail = ::finish
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
"vpn" -> intent.data?.toString()?.let(::startMainActivity)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
finish()
|
||||
|
||||
Reference in New Issue
Block a user