Remove VPNPermissionHelper class
This commit is contained in:
parent
712fb4d0d3
commit
ccdcfdce8a
2 changed files with 0 additions and 50 deletions
|
|
@ -138,15 +138,6 @@
|
||||||
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE" android:value="vpn" />
|
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE" android:value="vpn" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service
|
|
||||||
android:name=".VPNPermissionHelper"
|
|
||||||
android:permission="android.permission.BIND_VPN_SERVICE"
|
|
||||||
android:foregroundServiceType="specialUse"
|
|
||||||
android:exported="true">
|
|
||||||
|
|
||||||
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE" android:value="vpn" />
|
|
||||||
</service>
|
|
||||||
|
|
||||||
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
|
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
package org.amnezia.vpn
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.content.Intent
|
|
||||||
import android.util.Log
|
|
||||||
|
|
||||||
class VPNPermissionHelper : android.net.VpnService() {
|
|
||||||
|
|
||||||
private val tag = "VPNPermissionHelper"
|
|
||||||
/**
|
|
||||||
* This small service does nothing else then checking if the vpn permission
|
|
||||||
* is present and prompting if not.
|
|
||||||
*/
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
|
||||||
Log.i(tag, "onStartCommand")
|
|
||||||
val intent = prepare(this.applicationContext)
|
|
||||||
if (intent != null) {
|
|
||||||
startActivityForResult(intent)
|
|
||||||
}
|
|
||||||
return START_NOT_STICKY
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
@JvmStatic
|
|
||||||
fun startService(c: Context) {
|
|
||||||
val appC = c.applicationContext
|
|
||||||
appC.startService(Intent(appC, VPNPermissionHelper::class.java))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetches the Global QTAndroidActivity and calls startActivityForResult with the given intent
|
|
||||||
* Is used to request the VPN-Permission, if not given.
|
|
||||||
* Actually Implemented in src/platforms/android/AndroidController.cpp
|
|
||||||
*/
|
|
||||||
external fun startActivityForResult(i: Intent)
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue