You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/entra/entra-id/app-integration/package-inspector-msal-android-native.md
+22-21Lines changed: 22 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,19 @@
2
2
title: Package Inspector for MSAL Android Native
3
3
description: Introduces how to install and use the Package Inspector tool.
4
4
ms.reviewer: markbukovich, v-weizhu
5
-
ms.topic: how-to
6
5
ms.service: entra-id
7
6
ms.date: 02/20/2025
8
7
ms.custom: sap:Developing or Registering apps with Microsoft identity platform
9
8
---
10
9
# Package Inspector for MSAL Android Native
11
10
12
-
The Microsoft Authentication Library (MSAL) for Android Native includes a tool called Package Inspector. This tool lists the packages installed on an Android device and allows users to view, copy, and paste the signature hash used to sign an application's package. Package Inspector can be invaluable for troubleshooting and verifying the signature hash for applications installed on an Android device. This article covers installation, usage, and common issues of the Package Inspector.
11
+
The Microsoft Authentication Library (MSAL) for Android Native includes a tool called Package Inspector. This tool lists the packages installed on an Android device and allows users to view, copy, and paste the signature hash used to sign an application's package. Package Inspector is invaluable for troubleshooting and verifying the signature hash for applications installed on an Android device. This article covers installation, usage, and common issues of the Package Inspector.
13
12
14
-
## Scenarios where you can use Package Inspector
13
+
## Scenarios for using Package Inspector
15
14
16
15
- You have successfully developed an application to use MSAL, but after deploying the app to the Google Play Store, the app fails to perform authentication.
17
16
18
-
In this scenario, Package Inspector will be useful to discover the new signature hash used by Google to sign in to the app package.
17
+
In this scenario, Package Inspector is useful to discover the new signature hash used by Google to sign the app package.
19
18
20
19
- You are implementing MSAL in your Android application, but encounter the following error:
21
20
@@ -27,7 +26,7 @@ The Microsoft Authentication Library (MSAL) for Android Native includes a tool c
27
26
28
27
> Intent filter for: BrowserTabActivity is missing
29
28
30
-
This error can occur because the signature hash specified in the *AndroidManifest.xml* file doesn't match the signature hash actually used to sign in to the APK file. In this scenario, the Package Inspector will be useful to verify what the signature hash actually is.
29
+
This error can occur because the signature hash specified in the *AndroidManifest.xml* file doesn't match the signature hash actually used to sign the APK file. In this scenario, Package Inspector is useful to verify what the signature hash actually is.
31
30
32
31
> [!NOTE]
33
32
> For more information about MSAL for Android Native, see [Microsoft Authentication Library (MSAL) for Android](https://github.com/AzureAD/microsoft-authentication-library-for-android).
@@ -37,64 +36,66 @@ The Microsoft Authentication Library (MSAL) for Android Native includes a tool c
37
36
Before you start, ensure you have the following:
38
37
39
38
- A recent version of Android Studio installed.
40
-
- A virtual Android device with applications installed, which can be managed using Android Studio's AVD manager. For more information, see [AVD manager](https://developer.android.com/studio/run/managing-avds).
39
+
40
+
Android Studio comes with an AVD manager. For more information, see [AVD manager](https://developer.android.com/studio/run/managing-avds).
41
+
- A virtual Android device with applications installed.
41
42
- A physical device with developer options, USB debugging enabled, and a USB cable. For more information, see [Developer options](https://developer.android.com/studio/debug/dev-options).
42
43
- An application installed to inspect.
43
44
44
45
## Install Package Inspector
45
46
46
47
There are two methods to install Package Inspector:
47
48
48
-
### Option 1: Clone the repository directly into Android Studio
49
+
### Option 1: Clone Android MSAL repository directly into Android Studio
49
50
50
51
1. Open Android Studio and close any open projects.
51
52
2. Select **Get From Version Control**.
52
53
53
54
:::image type="content" source="media/package-inspector-msal-android-native/get-from-version-control.png" alt-text="Screenshot that shows the 'Get From Version Control' option in Android Studio" lightbox="media/package-inspector-msal-android-native/get-from-version-control.png":::
54
-
3. Ensure **Git** is selected at the top of the window, paste the repository URL `https://github.com/AzureAD/microsoft-authentication-library-for-android.git`, and select **Clone**.
55
+
3. Ensure **Git** is selected at the top of the window, paste the Android MSAL repository URL `https://github.com/AzureAD/microsoft-authentication-library-for-android.git`, and then select **Clone**.
55
56
56
57
:::image type="content" source="media/package-inspector-msal-android-native/clone-msal-repository.png" alt-text="Screenshot that shows how to clone a Git repository in Android Studio" lightbox="media/package-inspector-msal-android-native/clone-msal-repository.png":::
57
58
58
-
### Option 2: Download as a zip file and open in Android Studio
59
+
### Option 2: Download Android MSAL repository and open it in Android Studio
59
60
60
-
1.[Download the repository](https://github.com/AzureAD/microsoft-authentication-library-for-android/archive/refs/heads/dev.zip).
61
+
1.[Download the Android MSAL repository](https://github.com/AzureAD/microsoft-authentication-library-for-android/archive/refs/heads/dev.zip).
61
62
2. Extract the zip file to your selected directory.
62
63
3. Open Android Studio and close any open projects.
63
64
4. Select **Open an Existing Project**.
64
65
65
-
:::image type="content" source="media/package-inspector-msal-android-native/c40bb5ff-38b6-45f4-ae7d-1eee54a441d0.png" alt-text="Screenshot that shows the 'Open an Existing Project' option in Android Studio" lightbox="media/package-inspector-msal-android-native/c40bb5ff-38b6-45f4-ae7d-1eee54a441d0.png":::
66
+
:::image type="content" source="media/package-inspector-msal-android-native/open-existing-project-android-studio.png" alt-text="Screenshot that shows the 'Open an Existing Project' option in Android Studio" lightbox="media/package-inspector-msal-android-native/open-existing-project-android-studio.png":::
66
67
5. Select the root package **msal-android** for the Android MSAL repository. Then, select **OK**.
67
68
68
-
:::image type="content" source="media/package-inspector-msal-android-native/8f4e6637-a29a-4605-9c96-e8674c9801d1.png" alt-text="Screenshot showing selecting the Root Package in Android Studio" lightbox="media/package-inspector-msal-android-native/8f4e6637-a29a-4605-9c96-e8674c9801d1.png":::
69
+
:::image type="content" source="media/package-inspector-msal-android-native/select-root-package.png" alt-text="Screenshot showing selecting the root package in Android Studio" lightbox="media/package-inspector-msal-android-native/select-root-package.png":::
69
70
70
71
> [!NOTE]
71
-
> - The default name of the root package is `microsoft-authentication-library-for-android-dev`, but you might have renamed it.
72
-
> - Don't select the **package-inspector** directory.
72
+
> - The default name of the root package is `microsoft-authentication-library-for-android-dev`. In this example, it's renamed `msal-android`.
73
+
> - Don't select the **package-inspector** directory.
73
74
74
75
## Use Package Inspector
75
76
76
-
1. With the Android MSAL project open in Android Studio, connect the desired Android device. This can be a physical device connected to the computer's USB port an emulator booted from Android Studio's AVD manager. Ensure your device appears in the drop-down list at the top of Android Studio and select it.
77
-
2.To the left of the device drop-down, there is another drop-down list. Select **package-inspector** from it.
77
+
1. With the Android MSAL project open in Android Studio, connect the desired Android device. This can be a physical device connected to the computer's USB port or an emulator booted from Android Studio's AVD manager. Ensure your device appears in the drop-down list at the top of Android Studio and select it.
78
+
2.On the left of the device drop-down list, there is another drop-down list. Select **package-inspector** from it.
78
79
79
-
:::image type="content" source="media/package-inspector-msal-android-native/b38c129a-9cfb-4901-85f6-da13cc592f36.png" alt-text="Screenshot that shows the selection of package-inspector in Android Studio" lightbox="media/package-inspector-msal-android-native/b38c129a-9cfb-4901-85f6-da13cc592f36.png":::
80
+
:::image type="content" source="media/package-inspector-msal-android-native/select-package-inspector.png" alt-text="Screenshot that shows the selection of package-inspector in Android Studio" lightbox="media/package-inspector-msal-android-native/select-package-inspector.png":::
80
81
3. Select the green **play** button (indicated with a green circle on the right) to build, install, and run the package inspector on the selected device.
81
82
4. Browse the list of packages in the Package Inspector app and select a package to view its signature hash. All accessible packages will appear in this list.
82
83
83
-
:::image type="content" source="media/package-inspector-msal-android-native/6adfe09a-5e98-4b7b-b2f3-2c83b60fff8f.png" alt-text="Screenshot that shows package selection in the Package Inspector app" lightbox="media/package-inspector-msal-android-native/6adfe09a-5e98-4b7b-b2f3-2c83b60fff8f.png":::
84
+
:::image type="content" source="media/package-inspector-msal-android-native/select-package-to-check-signature-hash.png" alt-text="Screenshot that shows package selection in the Package Inspector app" lightbox="media/package-inspector-msal-android-native/select-package-to-check-signature-hash.png":::
84
85
85
86
## Common issues
86
87
87
88
### Issues when loading Package Inspector into Android Studio
88
89
89
-
To resolve these issues, ensure you load the root package from the MSAL repository, not just the package inspector. The project you're loading should be named `microsoft-authentication-library-for-android-dev` or whatever you have renamed the root repository on your system instead of package-inspector. See step 5 under [Option 2](#option-2-download-as-a-zip-file-and-open-in-android-studio) in the [Install Package Inspector](#install-package-inspector) section.
90
+
To resolve these issues, ensure you load the root package from the MSAL repository, not the package inspector. Make sure that the Android MSAL project you load into Android Studio is named `microsoft-authentication-library-for-android-dev` or whatever you have renamed the root directory on your system instead of `package-inspector`. For more information, see step 5 under [Option 2](#option-2-download-as-a-zip-file-and-open-in-android-studio) in the [Install Package Inspector](#install-package-inspector) section.
90
91
91
92
### Not all packages appear in Package Inspector
92
93
93
-
You can install and open Package Inspector, and a list of packages appear in the app. However, you don't see packages for any of the apps you have installed on the device. It might be due to changes in Android 11 (API 30). For more information, see [here](https://developer.android.com/training/package-visibility).
94
+
You have installed and opened Package Inspector, and a list of packages appear in the app. However, you don't see packages for any apps you have installed on the device. It might be due to changes in Android 11 (API 30). For more information, see [Package visibility](https://developer.android.com/training/package-visibility).
94
95
95
96
To resolve this issue, follow these steps:
96
97
97
-
1. Open the AndroidManifest.xml file within the package-inspector directory on the left side of Android Studio.
98
+
1. Open the *AndroidManifest.xml* file within the `package-inspector` directory on the left side of Android Studio.
98
99
2. Add the following permission and query between the `<manifest></manifest>` tags:
0 commit comments