getShas method
Fetches the SHA-1 and SHA-256 fingerprints for the Android project.
Attempts to extract fingerprints using the Gradle signingReport.
If it fails, it will attempt a flutter build apk to generate
necessary build artifacts and try again.
Implementation
Future<Map<String, String>> getShas() async {
print('🔍 Fetching SHA values...');
var shas = await _extractShas();
if (shas['sha1']!.isNotEmpty || shas['sha256']!.isNotEmpty) {
return shas;
}
print('⚠️ SHA not found. Running Flutter build...');
await run('flutter', ['build', 'apk']);
shas = await _extractShas();
if (shas['sha1']!.isNotEmpty || shas['sha256']!.isNotEmpty) {
return shas;
}
print('❌ Still unable to find SHA');
return shas;
}