codeplay-common 4.10.9 → 4.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Version 6.8: preserve Capacitor permission annotations for Love Calculator Android builds.
|
|
1
2
|
// Version 6.7: deferred IAP startup, ownership-safe ads, and unified store preparation.
|
|
2
3
|
// Version 6.7: migrate AdMob files to ZIP-distributed folder packages.
|
|
3
4
|
// Version 6.7: recreate failed WebViews, defer background recovery, and suppress foreground recovery toasts.
|
|
@@ -3668,7 +3669,7 @@ const syncFirebaseAnalyticsPackages = () => {
|
|
|
3668
3669
|
|
|
3669
3670
|
if (analyticsConfig.enabled) {
|
|
3670
3671
|
if (!isPackageAvailable("@capacitor-firebase/analytics") || !isPackageAvailable("firebase")) {
|
|
3671
|
-
runNpmCommand("npm install @capacitor-firebase/analytics
|
|
3672
|
+
runNpmCommand("npm install @capacitor-firebase/analytics");
|
|
3672
3673
|
} else {
|
|
3673
3674
|
console.log("ℹ️ Firebase Analytics packages already installed.");
|
|
3674
3675
|
}
|
|
@@ -4521,8 +4522,30 @@ function findAndroidBuildBlock(content, name) {
|
|
|
4521
4522
|
return null;
|
|
4522
4523
|
}
|
|
4523
4524
|
|
|
4525
|
+
function syncAndroidCapacitorPermissionRules() {
|
|
4526
|
+
if (buildPlatform !== 'android' || !fs.existsSync(androidAppBuildGradlePath)) return;
|
|
4527
|
+
const capacitorConfig = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
4528
|
+
if (capacitorConfig.appId !== 'codeplay.love.calculator') return;
|
|
4529
|
+
|
|
4530
|
+
const rulesPath = path.join(androidPlatformPath, 'app', 'proguard-rules.pro');
|
|
4531
|
+
const original = fs.existsSync(rulesPath) ? fs.readFileSync(rulesPath, 'utf8') : '';
|
|
4532
|
+
const newline = original.includes('\r\n') ? '\r\n' : '\n';
|
|
4533
|
+
const rules = [
|
|
4534
|
+
'-keepattributes RuntimeVisibleAnnotations,AnnotationDefault',
|
|
4535
|
+
'-keep @interface com.getcapacitor.annotation.CapacitorPlugin { *; }',
|
|
4536
|
+
'-keep @interface com.getcapacitor.annotation.Permission { *; }'
|
|
4537
|
+
];
|
|
4538
|
+
const existingRules = original.split(/\r?\n/).map(line => line.trim());
|
|
4539
|
+
const missingRules = rules.filter(rule => !existingRules.includes(rule));
|
|
4540
|
+
if (!missingRules.length) return;
|
|
4541
|
+
|
|
4542
|
+
const next = `${original.trimEnd()}${newline}${newline}# Preserve Capacitor permission metadata used at runtime.${newline}${missingRules.join(newline)}${newline}`;
|
|
4543
|
+
fs.writeFileSync(rulesPath, next, 'utf8');
|
|
4544
|
+
}
|
|
4545
|
+
|
|
4524
4546
|
function syncAndroidBuildOptimization() {
|
|
4525
4547
|
if (buildPlatform !== 'android' || !fs.existsSync(androidAppBuildGradlePath)) return;
|
|
4548
|
+
syncAndroidCapacitorPermissionRules();
|
|
4526
4549
|
|
|
4527
4550
|
const original = fs.readFileSync(androidAppBuildGradlePath, 'utf8');
|
|
4528
4551
|
const newline = original.includes('\r\n') ? '\r\n' : '\n';
|