File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
app/src/main/kotlin/com/neko/v2ray/util Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 1
1
package com.neko.v2ray.util
2
2
3
- import android.Manifest
4
3
import android.content.Context
5
4
import android.content.pm.ApplicationInfo
6
- import android.content.pm.PackageInfo
7
5
import android.content.pm.PackageManager
8
6
import com.neko.v2ray.dto.AppInfo
9
7
import io.reactivex.rxjava3.core.Observable
10
8
11
9
object AppManagerUtil {
12
- fun loadNetworkAppList (ctx : Context ): ArrayList <AppInfo > {
10
+ private fun loadNetworkAppList (ctx : Context ): ArrayList <AppInfo > {
13
11
val packageManager = ctx.packageManager
14
12
val packages = packageManager.getInstalledPackages(PackageManager .GET_PERMISSIONS )
15
13
val apps = ArrayList <AppInfo >()
16
14
17
15
for (pkg in packages) {
18
- if (! pkg.hasInternetPermission && pkg.packageName != " android" ) continue
16
+ // if (!pkg.hasInternetPermission && pkg.packageName != "android") continue
19
17
20
18
val applicationInfo = pkg.applicationInfo
21
19
@@ -35,9 +33,9 @@ object AppManagerUtil {
35
33
it.onNext(loadNetworkAppList(ctx))
36
34
}
37
35
38
- val PackageInfo .hasInternetPermission: Boolean
39
- get() {
40
- val permissions = requestedPermissions
41
- return permissions?.any { it == Manifest .permission.INTERNET } ? : false
42
- }
36
+ // val PackageInfo.hasInternetPermission: Boolean
37
+ // get() {
38
+ // val permissions = requestedPermissions
39
+ // return permissions?.any { it == Manifest.permission.INTERNET } ?: false
40
+ // }
43
41
}
You can’t perform that action at this time.
0 commit comments