readMobileBundleID reads the application/bundle ID for Flutter and React Native projects. Checks android/app/build.gradle first, then falls back to iOS project files.
(dir string)
| 510 | // readMobileBundleID reads the application/bundle ID for Flutter and React Native projects. |
| 511 | // Checks android/app/build.gradle first, then falls back to iOS project files. |
| 512 | func readMobileBundleID(dir string) string { |
| 513 | if data, err := os.ReadFile(filepath.Join(dir, "android", "app", "build.gradle")); err == nil { |
| 514 | if id := extractGradleApplicationID(string(data)); id != "" { |
| 515 | return id |
| 516 | } |
| 517 | } |
| 518 | // IOS fallback: try project.pbxproj first (the canonical source for the bundle ID), |
| 519 | // then Info.plist (only when CFBundleIdentifier is not a build variable reference). |
| 520 | return readIOSBundleID(dir) |
| 521 | } |
| 522 | |
| 523 | // readIOSBundleID reads the bundle ID from iOS project files (pbxproj then Info.plist). |
| 524 | func readIOSBundleID(dir string) string { |