mirror of
https://github.com/vesper8/Quest2Frame.git
synced 2026-10-10 21:01:03 +02:00
Update UI, wireless installs, app names, refresh rates and progress
Include managed uninstall and tests. Keep-awake integration is work in progress: Frame authorization currently rejects the inhibitor and blocks wireless installation until resolved.
This commit is contained in:
1 parent
5f723dc889
commit
6b014289d3
19 files changed
+1018
-66
No files matched your search
@@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/** Read installed app labels as the ADB shell user; no APK installation needed. */
|
||||
public final class QuestAppLabels {
|
||||
public static void main(String[] args) throws Exception {
|
||||
Class<?> threadClass = Class.forName("android.app.ActivityThread");
|
||||
Object thread = threadClass.getMethod("systemMain").invoke(null);
|
||||
Context context = (Context) threadClass.getMethod("getSystemContext").invoke(thread);
|
||||
PackageManager pm = context.createPackageContext("com.android.shell", 0).getPackageManager();
|
||||
JSONObject labels = new JSONObject();
|
||||
for (String name : args) {
|
||||
try {
|
||||
ApplicationInfo info = pm.getApplicationInfo(name, 0);
|
||||
labels.put(name, pm.getApplicationLabel(info).toString());
|
||||
} catch (PackageManager.NameNotFoundException ignored) {
|
||||
// Packages can disappear during a scan; the caller retains its ID.
|
||||
}
|
||||
}
|
||||
System.out.println("Q2F_LABELS=" + labels.toString());
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user