mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 02:35:19 +08:00
Added: Add uid to app info
This commit is contained in:
@@ -204,6 +204,28 @@ public class PackageUtils {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the uid for the package associated with the {@code context}.
|
||||
*
|
||||
* @param context The {@link Context} for the package.
|
||||
* @return Returns the uid.
|
||||
*/
|
||||
public static int getUidForPackage(@NonNull final Context context) {
|
||||
return getUidForPackage(context.getApplicationInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the uid for the package associated with the {@code applicationInfo}.
|
||||
*
|
||||
* @param applicationInfo The {@link ApplicationInfo} for the package.
|
||||
* @return Returns the uid.
|
||||
*/
|
||||
public static int getUidForPackage(@NonNull final ApplicationInfo applicationInfo) {
|
||||
return applicationInfo.uid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the {@code targetSdkVersion} for the package associated with the {@code context}.
|
||||
*
|
||||
|
@@ -74,6 +74,7 @@ public class AndroidUtils {
|
||||
AndroidUtils.appendPropertyToMarkdown(markdownString,"PACKAGE_NAME", PackageUtils.getPackageNameForPackage(applicationInfo));
|
||||
AndroidUtils.appendPropertyToMarkdown(markdownString,"VERSION_NAME", PackageUtils.getVersionNameForPackage(context, packageName));
|
||||
AndroidUtils.appendPropertyToMarkdown(markdownString,"VERSION_CODE", PackageUtils.getVersionCodeForPackage(context, packageName));
|
||||
AndroidUtils.appendPropertyToMarkdown(markdownString,"UID", PackageUtils.getUidForPackage(applicationInfo));
|
||||
AndroidUtils.appendPropertyToMarkdown(markdownString,"TARGET_SDK", PackageUtils.getTargetSDKForPackage(applicationInfo));
|
||||
AndroidUtils.appendPropertyToMarkdown(markdownString,"IS_DEBUGGABLE_BUILD", PackageUtils.isAppForPackageADebuggableBuild(applicationInfo));
|
||||
|
||||
|
Reference in New Issue
Block a user