manager: possible fix

- Possible fix a bug where IUserManager.getUsers(ZZZ) are not defined in the framework.jar
- Refactored WebUI X to meet the new WXInterface
- Only fetch the app from the current user and not all users

* manager: remove unused AIDL interfaces

Signed-off-by: Der_Googler <54764558+DerGoogler@users.noreply.github.com>
This commit is contained in:
ShirkNeko
2025-05-23 16:31:13 +08:00
parent f1f78d2485
commit 99fe6623de
4 changed files with 4 additions and 19 deletions

View File

@@ -50,7 +50,6 @@ android {
} }
buildFeatures { buildFeatures {
aidl = true
buildConfig = true buildConfig = true
compose = true compose = true
prefab = true prefab = true

View File

@@ -1,8 +0,0 @@
package com.sukisu.zako;
import android.content.pm.PackageInfo;
import rikka.parcelablelist.ParcelableListSlice;
interface IKsuInterface {
ParcelableListSlice<PackageInfo> getPackages(int flags);
}

View File

@@ -187,15 +187,9 @@ class SuperUserViewModel : ViewModel() {
val pm = ksuApp.packageManager val pm = ksuApp.packageManager
val start = SystemClock.elapsedRealtime() val start = SystemClock.elapsedRealtime()
val userInfos = Platform.userManager.getUsers() val userManager = Platform.userManager
val packages = mutableListOf<PackageInfo>()
val packageManager = Platform.packageManager val packageManager = Platform.packageManager
val packages = packageManager.getInstalledPackages(0, userManager.myUserId)
for (userInfo in userInfos) {
Log.i(TAG, "fetchAppList: ${userInfo.id}")
packages.addAll(packageManager.getInstalledPackages(0, userInfo.id))
}
apps = packages.map { apps = packages.map {
val appInfo = it.applicationInfo val appInfo = it.applicationInfo
val uid = appInfo!!.uid val uid = appInfo!!.uid

View File

@@ -226,7 +226,7 @@ class WebViewInterface(
@JavascriptInterface @JavascriptInterface
fun moduleInfo(): String { fun moduleInfo(): String {
val moduleInfos = JSONArray(listModules()) val moduleInfos = JSONArray(listModules())
var currentModuleInfo = JSONObject() val currentModuleInfo = JSONObject()
currentModuleInfo.put("moduleDir", modDir) currentModuleInfo.put("moduleDir", modDir)
val moduleId = File(modDir).getName() val moduleId = File(modDir).getName()
for (i in 0 until moduleInfos.length()) { for (i in 0 until moduleInfos.length()) {
@@ -236,7 +236,7 @@ class WebViewInterface(
continue continue
} }
var keys = currentInfo.keys() val keys = currentInfo.keys()
for (key in keys) { for (key in keys) {
currentModuleInfo.put(key, currentInfo.get(key)) currentModuleInfo.put(key, currentInfo.get(key))
} }