FAQs About Application Packages
How do I obtain the fingerprint in the signature information?
- Call an API.
You can call bundleManager.getBundleInfoForSelf to obtain the bundle information, which contains the signature information, and signature information in turn contains fingerprint information.
import { bundleManager } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION |
bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO;
try {
bundleManager.getBundleInfoForSelf(bundleFlags).then((bundleInfo:bundleManager.BundleInfo) => {
console.info('testTag', 'getBundleInfoForSelf successfully. fingerprint: ', bundleInfo.signatureInfo.fingerprint);
}).catch((err: BusinessError) => {
console.error('testTag', 'getBundleInfoForSelf failed. Cause: ', err.message);
});
} catch (err) {
let message = (err as BusinessError).message;
console.error('testTag', 'getBundleInfoForSelf failed: %{public}s', message);
}
- Use Bundle Manager (bm).
hdc shell
# Replace **com.example.myapplication** with the actual bundle name.
bm dump -n com.example.myapplication | grep fingerprint

-
Use the keytool. For details, see Generating a Signing Certificate Fingerprint.
What is appIdentifier?
appIdentifier, generated during application signing, is a field in the profile and is the unique identifier of an application. There are two ways to generate an application identifier:
- Randomly generate the appIdentifier field through automatic signing on DevEco Studio. Signing on different devices or re-signing will result in different values of appIdentifier.
- Manually configure the signature. The **appIdentifier** field here is the same as the **app-identifier** field in the [HarmonyAppProvision configuration file](../security/app-provision-structure.md). For details, see [hapsigner Guide](../security/hapsigntool-guidelines.md).
Therefore, manual signing is recommended in scenarios where appIdentifier must remain unchanged, such as cross-device debugging, cross-application interaction debugging, or multi-user development with a shared key. For details, see Use Cases for Automatic and Manual Signing.
How do I obtain appIdentifier from application information?
- You can call bundleManager.getBundleInfoForSelf to obtain the bundle information, which contains the signature information, and signature information in turn contains the appIdentifier.
import { bundleManager } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION |
bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO;
try {
bundleManager.getBundleInfoForSelf(bundleFlags).then((bundleInfo:bundleManager.BundleInfo) => {
console.info('testTag', 'getBundleInfoForSelf successfully. appIdentifier:', bundleInfo.signatureInfo.appIdentifier);
}).catch((err: BusinessError) => {
console.error('testTag', 'getBundleInfoForSelf failed. Cause:', err.message);
});
} catch (err) {
let message = (err as BusinessError).message;
console.error('testTag', 'getBundleInfoForSelf failed:', message);
}
- Use the bm tool.
hdc shell
# Replace **com.example.myapplication** with the actual bundle name.
bm dump -n com.example.myapplication | grep appIdentifier

What Is appId?
appId, the unique identifier of an application, consists of a bundle name, underscore (_), and Base64-encoded public key of the certificate. Since it changes with the public key of the signing certificate, you are advised to use appIdentifier as the unique identifier of an application.
How do I obtain appId from application information?
- You can call bundleManager.getBundleInfoForSelf to obtain the bundle information, which contains the signature information, and signature information in turn contains the appId.
import { bundleManager } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION |
bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO;
try {
bundleManager.getBundleInfoForSelf(bundleFlags).then((bundleInfo:bundleManager.BundleInfo) => {
console.info('testTag', 'getBundleInfoForSelf successfully. appId:', bundleInfo.signatureInfo.appId);
}).catch((err: BusinessError) => {
console.error('testTag', 'getBundleInfoForSelf failed. Cause:', err.message);
});
} catch (err) {
let message = (err as BusinessError).message;
console.error('testTag', 'getBundleInfoForSelf failed:', message);
}
- Use the bm tool.
hdc shell
# Replace **ohos.app.hap.myapplication** with the actual bundle name.
bm dump -n ohos.app.hap.myapplication |grep '"appId":'
