capacitor-community / capacitor-community/play-integrity

App is crashed

Open
#3 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9
Forks
0
PR merge metrics
No merged PRs in 30d

Description

![b14a2a70-f829-41f9-8b36-8e5d464c9958](https://github.com/user-attachments/assets/1357af4c-ce03-488b-937d-21435b0d9233)

My code is

```
const initPlayIntegrity=async()=>{
try {
// Nonce: See https://developer.android.com/google/play/integrity/classic
// googleCloudProjectNumber: leave as 0 for the default for the application
// or get from https://console.firebase.google.com/ Project Settings > General
const nonce = generateNonce();


debugger

const result = await PlayIntegrity.requestIntegrityToken({
nonce: nonce,
googleCloudProjectNumber: 0
});
debugger;
// Use result.token and decrypt and verify the integrity verdict
// https://developer.android.com/google/play/integrity/classic#decrypt-verify
console.log(`Play Integrity Result`, result);
} catch (err) {
debugger;
// Recommendation: Report to backend and exit the application
}
}

const generateNonce=()=> {

// Generate a unique string for the nonce
const array = new Uint8Array(32); // 32 bytes of randomness
window.crypto.getRandomValues(array);
return btoa(String.fromCharCode(...array)); // Base64 encode the nonce
}
```

But this app is crashed

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the crash with the provided initPlayIntegrity snippet and inspect the PlayIntegrity.requestIntegrityToken call, generateNonce, and the surrounding error handling. Capture the actual exception and relevant Android logs, then trace the failure to its source. Done means the reported flow no longer crashes and the behavior is covered or clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
mobile, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.