Commit Graph

23 Commits

Author SHA1 Message Date
agnostic-apollo
e75680a884 Changed: Do not re-set component state if current state equals new state in PackageUtils.setComponentState() 2022-06-14 04:04:09 +05:00
agnostic-apollo
c2ddc23ae5 Added: Add MAX_PHANTOM_PROCESSES and DEVICE_CONFIG_SYNC_DISABLED value to device info output like shown in Termux About page
Related commit b6963035
2022-06-12 02:50:38 +05:00
agnostic-apollo
b69630355a Added: Add PhantomProcessUtils to get phantom processes related settings values
- `settings_enable_monitor_phantom_procs` feature flag value can be received with a call to `getFeatureFlagMonitorPhantomProcsValueString()`. Likely only available on Android `12L+`.

- `max_phantom_processes` value from `dumpsys activity settings` output can be received with a call to `getActivityManagerMaxPhantomProcesses()`. Requires granting Termux `DUMP` and `PACKAGE_USAGE_STATS` permission. Can be granted with `adb shell "pm grant com.termux android.permission.PACKAGE_USAGE_STATS; pm grant com.termux android.permission.DUMP"` and revoked with `adb shell "pm revoke com.termux android.permission.PACKAGE_USAGE_STATS; pm revoke com.termux android.permission.DUMP"`.

- `device_config_sync_disabled` settings global namespace value can be received with a call to `getSettingsGlobalDeviceConfigSyncDisabled()`.
2022-06-12 02:48:36 +05:00
agnostic-apollo
42eee49d30 Added: Add SettingsProviderUtils to get Setting global, secure and system namespace values 2022-06-12 02:35:46 +05:00
agnostic-apollo
f9e9193c4e Added: Add package APK_PATH, SE_PROCESS_CONTEXT, SE_FILE_CONTEXT and SE_INFO when generating app info markdown string 2022-06-11 14:15:33 +05:00
agnostic-apollo
790481b802 Added: Add functions to PackageUtils to get base APK path of package 2022-06-11 14:12:58 +05:00
agnostic-apollo
1788013c80 Added: Add functions to PackageUtils to get seInfo and seInfoUser of package 2022-06-11 14:11:58 +05:00
agnostic-apollo
5759411109 Added: Add SELinuxUtils to get process and file paths security contexts 2022-06-11 14:10:34 +05:00
agnostic-apollo
980bf8f0ae Added: Add support to get termux app package context with code classloader for plugin usage 2022-06-01 00:06:05 +05:00
agnostic-apollo
37f08c4fcc Fixed: Fix Settings.ACTION_* permission requests for non-activity contexts
This was caused by ce12b8ad

Closes #2769
2022-05-29 07:42:53 +05:00
agnostic-apollo
ab9b620c88 Added: Add ResourceUtils to get resource ids from names
This will mainly be used later when MediaViewer gets added.
2022-05-24 01:19:45 +05:00
agnostic-apollo
677a580042 Changed: Add general compatibility fixes for minSdkVerion 21 2022-05-24 01:19:45 +05:00
agnostic-apollo
9a71074c7d Added: Add function to ProcessUtils to get app process name for a pid from ActivityManager 2022-04-23 00:36:12 +05:00
agnostic-apollo
69cc65c3ac Added: Add functions to UserUtils to get user name for user id from PackageManager and Libcore 2022-04-23 00:36:12 +05:00
agnostic-apollo
ce12b8ad2d Fixed: Fix Settings.ACTION_* permission requests result callback
Adding `FLAG_ACTIVITY_NEW_TASK` will start permission activity in separate task and `onActivityResult()` will be called early in the calling activity without grant/not-grant result being actually set.
2022-03-30 19:45:55 +05:00
agnostic-apollo
14c5fc7b1e Fixed: Suppress warnings for requiring android 11 to request MANAGE_EXTERNAL_STORAGE permission and call Environment.isExternalStorageManager() 2022-03-17 02:10:51 +05:00
agnostic-apollo
792c33c9a5 Fixed: Fix PermissionUtils.requestPermissions() not requesting multiple permissions correctly 2022-03-17 02:10:51 +05:00
agnostic-apollo
68cdbd6ff4 Added: Add support for getting feature flag values and show MONITOR_PHANTOM_PROCS value in about page
MONITOR_PHANTOM_PROCS will only be shown in Android 12+ devices and will be marked "<unsupported>" if its not supported in current android build. It will show in Termux Settings->About->Device Info->Software and in reports. Flag is available on Pixel Android 12L beta 3 and Android 13. Check FeatureFlagUtils for more details.

Getting supported feature flags and their values is done through reflection on android "android.util.FeatureFlagUtils" class and requires bypassing android hidden API restrictions.

Related issue #2366
https://issuetracker.google.com/u/1/issues/205156966#comment27
2022-02-13 00:37:41 +05:00
agnostic-apollo
36e49707ec Added: Add support to request Settings.ACTION* permissions to be requested via Service context 2022-01-23 01:40:22 +05:00
agnostic-apollo
b69d14119e Changed: Return Error instead of boolean for ActivityUtils.startActivityForResult() 2022-01-23 01:40:22 +05:00
agnostic-apollo
8c43b7f0a1 Changed: Remove TermuxConstants reference from PackageUtils 2022-01-23 01:40:22 +05:00
agnostic-apollo
361bfb3961 Changed!: Move to package-by-feature hierarchy for classes not using it since termux-shared is growing too big and layers are getting out of hand 2022-01-23 01:40:22 +05:00
agnostic-apollo
5252fbbe11 Changed!: Move Termux specific classes to com.termux.shared.termux package
This will allow segregation of Termux utils/classes from general ones and also allow easier management of GPLv3 License for Termux classes
2022-01-23 01:36:41 +05:00