codeplay-common 1.9.3 → 1.9.4

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.
Files changed (2) hide show
  1. package/files/finalrelease +20 -9
  2. package/package.json +1 -1
@@ -43,13 +43,7 @@ const storeNames = {
43
43
 
44
44
 
45
45
 
46
-
47
- const ffmpegUsedPackages = [
48
- "vfx.green.editor",
49
- "audio.music.sound.editor",
50
- "video.to.gif.maker"
51
- ];
52
-
46
+
53
47
 
54
48
 
55
49
 
@@ -77,8 +71,24 @@ function fileExists(filePath) {
77
71
  }
78
72
 
79
73
 
74
+ const ffmpegPluginXmlPath = path.join(__dirname, 'node_modules', 'codeplay-fmpg', 'plugin.xml');
80
75
  const capacitorConfigPath = join(process.cwd(), 'capacitor.config.json');
81
76
 
77
+
78
+
79
+ function isFfmpegUsed() {
80
+ try {
81
+ const xmlContent = fs.readFileSync(ffmpegPluginXmlPath, 'utf8');
82
+ // Simple check: if plugin.xml exists and contains <plugin> tag (or any FFmpeg-specific tag)
83
+ return /<plugin\b/.test(xmlContent);
84
+ } catch (err) {
85
+ console.log('⚠️ FFmpeg plugin not found:', err.message);
86
+ return false;
87
+ }
88
+ }
89
+
90
+ const _isffmpegUsed = isFfmpegUsed();
91
+
82
92
  function getAdMobConfig() {
83
93
  if (!fileExists(capacitorConfigPath)) {
84
94
  throw new Error('❌ capacitor.config.json not found. Ensure this is a Capacitor project.');
@@ -493,7 +503,7 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
493
503
 
494
504
 
495
505
  // Determine desired minify value
496
- const desiredMinify = ffmpegUsedPackages.includes(_appPackageId) ? 'false' : 'true';
506
+ const desiredMinify = !_isffmpegUsed;
497
507
 
498
508
  // Check if minifyEnabled is already present
499
509
  if (/minifyEnabled\s+(true|false)/.test(updatedGradleContent)) {
@@ -578,7 +588,8 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
578
588
  if (storeName === "SamsungStore" || storeName === "PlayStore" ||
579
589
  //_appPackageId=="vfx.green.editor" || _appPackageId=="audio.music.sound.editor" || _appPackageId=="video.to.gif.maker"
580
590
 
581
- ffmpegUsedPackages.includes(_appPackageId)
591
+ //ffmpegUsedPackages.includes(_appPackageId)
592
+ _isffmpegUsed
582
593
  ) {
583
594
  if (currentMinSdkVersion !== 24) {
584
595
  variablesGradleContent = variablesGradleContent.replace(/minSdkVersion\s*=\s*\d+/, 'minSdkVersion = 24');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",