esoftplay 0.0.268 → 0.0.269-beta35a4429

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.
@@ -0,0 +1,37 @@
1
+ const { withAndroidManifest } = require('@expo/config-plugins');
2
+
3
+ module.exports = function withAndroidPermissionsFix(config) {
4
+ return withAndroidManifest(config, async (config) => {
5
+ const manifest = config.modResults.manifest;
6
+
7
+ // 1. Ensure the 'tools' namespace exists in the <manifest> tag
8
+ manifest.$['xmlns:tools'] = 'http://schemas.android.com/tools';
9
+
10
+ // 2. Find or create the READ_MEDIA_IMAGES permission entry
11
+ if (!manifest['uses-permission']) {
12
+ manifest['uses-permission'] = [];
13
+ }
14
+
15
+ const permissionName = 'android.permission.READ_MEDIA_IMAGES';
16
+ const existingPermission = manifest['uses-permission'].find(
17
+ (p) => p.$['android:name'] === permissionName
18
+ );
19
+
20
+ if (existingPermission) {
21
+ // Update existing entry to include the replace rule
22
+ existingPermission.$['android:maxSdkVersion'] = '34';
23
+ existingPermission.$['tools:replace'] = 'android:maxSdkVersion';
24
+ } else {
25
+ // Add new entry if it doesn't exist
26
+ manifest['uses-permission'].push({
27
+ $: {
28
+ 'android:name': permissionName,
29
+ 'android:maxSdkVersion': '34',
30
+ 'tools:replace': 'android:maxSdkVersion',
31
+ },
32
+ });
33
+ }
34
+
35
+ return config;
36
+ });
37
+ };
package/bin/build.js CHANGED
@@ -6,6 +6,7 @@ const DIR = "../../"
6
6
  const packjson = DIR + "package.json"
7
7
  const appjson = DIR + "app.json"
8
8
  const easjson = DIR + "eas.json"
9
+ const metroconfigjs = DIR + "metro.config.js"
9
10
  const confjson = DIR + "config.json"
10
11
  const conflivejson = DIR + "config.live.json"
11
12
  const gitignore = DIR + ".gitignore"
@@ -40,7 +41,8 @@ if (fs.existsSync(packjson)) {
40
41
 
41
42
  if (args[0] == "install") {
42
43
  $package.scripts.start = "esp start && bunx expo start --dev-client"
43
- $package.trustedDependencies = [
44
+ const existedTrustedDependencies = $package.trustedDependencies
45
+ const trustedDependencies = [
44
46
  "esoftplay",
45
47
  "esoftplay-android-print",
46
48
  "esoftplay-chatting",
@@ -54,6 +56,7 @@ if (fs.existsSync(packjson)) {
54
56
  "esoftplay-web",
55
57
  "esoftplay-web-pwa"
56
58
  ]
59
+ $package.trustedDependencies = trustedDependencies.concat(existedTrustedDependencies || []).reduce((acc, item) => acc.includes(item) ? acc : [...acc, item], []);
57
60
  writeFileSyncWithLog(packjson, JSON.stringify($package, null, 2));
58
61
  }
59
62
 
@@ -142,6 +145,7 @@ if (fs.existsSync(packjson)) {
142
145
  "./raw/plugins/heapSize",
143
146
  "./raw/plugins/fcmIcon",
144
147
  "./raw/plugins/noDarkAndroid",
148
+ "./raw/plugins/withAndroidPermissionsFix",
145
149
  "./raw/plugins/withAndroidVerifiedLinksWorkaround",
146
150
  ]
147
151
 
@@ -214,7 +218,21 @@ if (fs.existsSync(packjson)) {
214
218
  }
215
219
  }`
216
220
 
217
- writeFileSyncWithLog(easjson, easconfg);
221
+ if (!fs.existsSync(easjson))
222
+ writeFileSyncWithLog(easjson, easconfg);
223
+
224
+
225
+ const metroConfig = `// Learn more https://docs.expo.io/guides/customizing-metro
226
+ const { getDefaultConfig } = require('expo/metro-config');
227
+ const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config');
228
+
229
+ /** @type {import('expo/metro-config').MetroConfig} */
230
+ const config = getDefaultConfig(__dirname);
231
+
232
+ module.exports = wrapWithReanimatedMetroConfig(config);
233
+ `;
234
+ writeFileSyncWithLog(metroconfigjs, metroConfig)
235
+
218
236
 
219
237
  const babelconf = `module.exports = function (api) {
220
238
  api.cache(true);
@@ -282,10 +300,12 @@ yarn-error.log
282
300
  const AppJS = `import { LibNotification } from 'esoftplay/cache/lib/notification/import';
283
301
  import { UserIndex } from 'esoftplay/cache/user/index/import';
284
302
  import * as Notifications from 'expo-notifications';
303
+ import { Platform } from 'react-native';
285
304
  import { SafeAreaProvider } from 'react-native-safe-area-context';
286
305
  import { enableFreeze, enableScreens } from 'react-native-screens';
287
306
 
288
- enableFreeze()
307
+ if (Platform.OS == 'android')
308
+ enableFreeze()
289
309
  enableScreens()
290
310
 
291
311
  Notifications.addNotificationResponseReceivedListener(x => LibNotification.onAction(x));
package/bin/cli.js CHANGED
@@ -27,6 +27,7 @@ var args = process.argv.slice(2);
27
27
 
28
28
  // console.log(modpath, "sdofsjdofjsd")
29
29
  async function execution() {
30
+ command('bun ./node_modules/esoftplay/bin/connector.js')
30
31
  const preload = await preload_api()
31
32
  console.log("PRELOAD", preload)
32
33
  if (preload) {
@@ -386,7 +387,7 @@ function configUpdate(state) {
386
387
  if (fs.existsSync('/var/www/html/ota/scripts/config_version.js')) {
387
388
  command(`bun /var/www/html/ota/scripts/config_version.js ${_slug} ${newVersion}`)
388
389
  }
389
- command(`curl -v -F 'chat_id=-496494136' -F caption='#` + _slug + `\n${newVersion}\n` + os.userInfo().username + '@' + os.hostname() + `' -F document=@` + _path + ` https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendDocument`)
390
+ command(`curl -v -F 'chat_id=-496494136' -F caption='#` + _slug + `\n${newVersion}\n` + os.userInfo().username + '@' + os.hostname() + `' -F document=@` + _path + ` https://api.telegram.org/bot${readToJSON(confjson).config.errorReport.bot}/sendDocument`)
390
391
  }
391
392
  else
392
393
  consoleError(_path, _slug)
@@ -1092,7 +1093,7 @@ function buildPrepare(include = true) {
1092
1093
  try {
1093
1094
  command('cp -r -v ./modules/* ./assets/esoftplaymodules')
1094
1095
  } catch (error) {
1095
-
1096
+
1096
1097
  }
1097
1098
  }
1098
1099
 
@@ -1328,6 +1329,7 @@ function build() {
1328
1329
  if (d) {
1329
1330
  let cmd = d.cmd
1330
1331
  let pre = d.pre
1332
+ let name = d.name
1331
1333
  if (pre) pre()
1332
1334
  consoleSucces("⚙⚙⚙ ... \n" + cmd)
1333
1335
  command(cmd)
@@ -1423,9 +1425,11 @@ function build() {
1423
1425
  // allOutputString contains the full captured output as a single JS string
1424
1426
  const allOutputString = lines.join('\n');
1425
1427
  // also print to stdout for convenience
1426
- const message = " ✅ Build Success by " + os.userInfo().username + '@' + os.hostname() + "\n" + allOutputString
1428
+ const filename = name + '.txt'
1429
+ fs.writeFileSync(filename, allOutputString)
1427
1430
  let tmId = "-1001429450501"
1428
- command("curl -d \"text=" + encodeURIComponent(message) + "&disable_web_page_preview=true&chat_id=" + tmId + "\" 'https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage'")
1431
+ command("curl -F \"document=@" + filename + "\" -F \"chat_id=" + tmId + "\" -F \"caption=" + " ✅ Build Success by " + os.userInfo().username + '@' + os.hostname() + "\" \"https://api.telegram.org/bot" + readToJSON(confjson).config.errorReport.bot + "/sendDocument\"")
1432
+ fs.unlinkSync(filename)
1429
1433
  if (fs.existsSync('./build/post.js'))
1430
1434
  command('bun ./build/post.js')
1431
1435
  configAvailable(false)
package/bin/router.js CHANGED
@@ -184,7 +184,8 @@ function createIndex() {
184
184
  AllRoutes.forEach((nav) => {
185
185
  const [module, task] = nav.split('/')
186
186
  const comp = ucword(module) + ucword(task)
187
- if (!task.includes('.debug') && !task.includes('.live')) {
187
+
188
+ if (!task.endsWith('.debug') && !task.endsWith('.live') && !task.endsWith('.d') && !task.endsWith('.web')) {
188
189
  importer.push(`import { ${comp} } from ${'"esoftplay/cache/' + module + '/' + task + '/import"'} `)
189
190
  importer.push(`import * as ${comp}Property from ${'"esoftplay/cache/' + module + '/' + task + '/import"'} `)
190
191
  }
@@ -1,6 +1,5 @@
1
1
  // noPage
2
2
  // withObject
3
- import { InteractionManager } from 'react-native'
4
3
 
5
4
  let updater: any
6
5
  /** Klik [disini](https://github.com/dev-esoftplay/mobile-docs/blob/main/modules/lib/autoreload.md) untuk melihat dokumentasi*/
@@ -12,7 +11,7 @@ export default {
12
11
  updater = undefined
13
12
  }
14
13
  updater = setInterval(() => {
15
- InteractionManager.runAfterInteractions(() => {
14
+ requestIdleCallback(() => {
16
15
  callback()
17
16
  });
18
17
  }, duration || 6000)