Skip to content

Commit 4a050c5

Browse files
committed
add images
1 parent 36e566c commit 4a050c5

5 files changed

Lines changed: 22 additions & 21 deletions

File tree

29.3 KB
Loading
54.7 KB
Loading
44.9 KB
Loading
34.5 KB
Loading

support/entra/entra-id/app-integration/package-inspector-msal-android-native.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22
title: Package Inspector for MSAL Android Native
33
description: Introduces how to install and use the Package Inspector tool.
44
ms.reviewer: markbukovich, v-weizhu
5-
ms.topic: how-to
65
ms.service: entra-id
76
ms.date: 02/20/2025
87
ms.custom: sap:Developing or Registering apps with Microsoft identity platform
98
---
109
# Package Inspector for MSAL Android Native
1110

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.
1312

14-
## Scenarios where you can use Package Inspector
13+
## Scenarios for using Package Inspector
1514

1615
- 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.
1716

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.
1918

2019
- You are implementing MSAL in your Android application, but encounter the following error:
2120

@@ -27,7 +26,7 @@ The Microsoft Authentication Library (MSAL) for Android Native includes a tool c
2726

2827
> Intent filter for: BrowserTabActivity is missing
2928
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.
3130

3231
> [!NOTE]
3332
> 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
3736
Before you start, ensure you have the following:
3837

3938
- 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.
4142
- 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).
4243
- An application installed to inspect.
4344

4445
## Install Package Inspector
4546

4647
There are two methods to install Package Inspector:
4748

48-
### Option 1: Clone the repository directly into Android Studio
49+
### Option 1: Clone Android MSAL repository directly into Android Studio
4950

5051
1. Open Android Studio and close any open projects.
5152
2. Select **Get From Version Control**.
5253

5354
:::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**.
5556

5657
:::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":::
5758

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
5960

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).
6162
2. Extract the zip file to your selected directory.
6263
3. Open Android Studio and close any open projects.
6364
4. Select **Open an Existing Project**.
6465

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":::
6667
5. Select the root package **msal-android** for the Android MSAL repository. Then, select **OK**.
6768

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":::
6970

7071
> [!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.
7374
7475
## Use Package Inspector
7576

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.
7879

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":::
8081
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.
8182
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.
8283

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":::
8485

8586
## Common issues
8687

8788
### Issues when loading Package Inspector into Android Studio
8889

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.
9091

9192
### Not all packages appear in Package Inspector
9293

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).
9495

9596
To resolve this issue, follow these steps:
9697

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.
9899
2. Add the following permission and query between the `<manifest></manifest>` tags:
99100

100101
```xml

0 commit comments

Comments
 (0)