mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-11-08 19:46:10 +01:00
Added: Add uid to app info
This commit is contained in:
parent
a987246bd8
commit
2c6d009657
2 changed files with 23 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue