mirror of https://github.com/termux/termux-app
Added: Add uid to app info
This commit is contained in:
parent
a987246bd8
commit
2c6d009657
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in New Issue