@extscreen/es-core 2.3.22 → 2.3.23

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/dist/index.js +74 -70
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import Vue from 'vue';
2
- import { ESLog, ESLogModule } from '@extscreen/es-log';
2
+ import { ESLog } from '@extscreen/es-log';
3
+ import { ESManager as ESManager$2 } from '@extscreen/es-core';
3
4
 
4
5
  /**
5
6
  *
@@ -3621,83 +3622,83 @@ var AndroidVersions$1 = new AndroidVersions();
3621
3622
 
3622
3623
  class ESPluginFix {
3623
3624
 
3624
- tryFix() {
3625
- if (ESManager$1.getESSDKVersionCode() >= 2.4) {
3626
- return;
3627
- }
3628
- if (AndroidVersions$1.isEqualsOrNewerThan(AndroidVersions$1.ANDROID_8_0)) {
3629
- ESLogModule.d('ESPluginModule', 'check art after android 8');
3630
- this.removeArtFiles();
3625
+ async tryFix() {
3626
+ try {
3627
+ if (ESManager$2.getESSDKVersionCode() >= 2.4) {
3628
+ return;
3629
+ }
3630
+ await AndroidVersions$1.init();
3631
+ if (AndroidVersions$1.isEqualsOrNewerThan(AndroidVersions$1.ANDROID_8_0)) {
3632
+ ESLog.d('ESPluginModule', 'android 8入口允许进入');
3633
+ await this.removeArtFiles();
3634
+ }
3635
+ } catch (err) {
3636
+
3631
3637
  }
3632
3638
  }
3633
3639
 
3634
- removeArtFiles() {
3635
- const path = ESManager$1.getESAppPath();
3636
- if (path == null) {
3637
- ESLogModule.e('ESPluginModule', 'not get host path');
3638
- return;
3639
- }
3640
- const idx = path.indexOf('app_rpk/apps');
3641
- if (idx < 0) {
3642
- ESLogModule.e('ESPluginModule', 'not find esapp path');
3643
- return;
3640
+ async removeArtFiles() {
3641
+ try {
3642
+ // 拿到host path
3643
+ const path = ESManager$2.getESAppPath();
3644
+ if (path == null) {
3645
+ ESLog.d('ESPluginModuleERR', 'not get host path');
3646
+ return;
3647
+ }
3648
+ // 拿到符合条件的pathIndex
3649
+ const idx = path.indexOf('app_rpk/apps');
3650
+ // 找不到返回
3651
+ if (idx < 0) {
3652
+ ESLog.d('ESPluginModule', 'not find esApp path');
3653
+ return;
3654
+ }
3655
+ // 拼接字符串
3656
+ const pluginDir = path.substr(0, idx + 8) + 'plugins';
3657
+ ESLog.d('ESPluginModule', 'pluginDir拼接' + pluginDir);
3658
+ await this.checkFile(pluginDir);
3659
+ } catch (err) {
3660
+ ESLog.d('ESPluginModule', 'removeArtFiles ' + ' ' + err);
3644
3661
  }
3645
- const pluginDir = path.substr(0, idx + 8) + 'plugins';
3646
- this.checkFile(pluginDir);
3647
3662
  }
3648
3663
 
3649
- checkFile(fileDir) {
3650
- if (ESLog.DEBUG) {
3651
- ESLog.d('ESPluginModule', ' ---> checkFile ' + fileDir);
3652
- }
3653
- const file = new ESFile();
3654
- file.newESFile(fileDir)
3655
- .then(() => {
3656
- if (ESLog.DEBUG) {
3657
- ESLog.d('ESPluginModule', ' ---> new file');
3658
- }
3659
- return file.exists();
3660
- })
3661
- .then((exists) => {
3662
- if (ESLog.DEBUG) {
3663
- ESLog.d('ESPluginModule', ' ---> exists ' + exists);
3664
- }
3665
- if (exists) {
3666
- return file.isDirectory();
3667
- }
3668
- return Promise.resolve(false);
3669
- })
3670
- .then((isDir) => {
3671
- if (ESLog.DEBUG) {
3672
- ESLog.d('ESPluginModule', ' ---> isDir ' + isDir);
3673
- }
3674
- if (isDir) {
3675
- return file.getAbsolutePath();
3676
- }
3677
- return Promise.reject();
3678
- })
3679
- .then((path) => {
3680
- ESLogModule.d('ESPluginModule', 'check ' + path);
3681
- file.list()
3682
- .then((fileList) => {
3683
- if (ESLog.DEBUG) {
3684
- ESLog.d('ESPluginModule', ' ---> chirld size ' + fileList.length);
3685
- }
3686
- for (let i = 0; i < fileList.length; i++) {
3687
- let nextPath = path + '/' + fileList[i];
3688
- if (path.endsWith('/arm')) {
3664
+ async checkFile(fileDir) {
3665
+ try {
3666
+ const file = new ESFile();
3667
+ const fileRes = await file.newESFile(fileDir);
3668
+ ESLog.d('ESPluginModule', ' --->file fileRes ' + fileRes);
3669
+ if (fileRes) {
3670
+ const existsRes = await file.exists();
3671
+ ESLog.d('ESPluginModule', ' --->existsRes ' + ' ' + existsRes);
3672
+ if (existsRes) {
3673
+ const isDirRes = await file.isDirectory();
3674
+ ESLog.d('ESPluginModule', ' --->isDirRes ' + ' ' + isDirRes);
3675
+ if (isDirRes) {
3676
+ const absolutePathRes = await file.getAbsolutePath();
3677
+ ESLog.d('ESPluginModule', ' --->absolutePathRes ' + ' ' + absolutePathRes);
3678
+ const fileListRes = await file.list();
3679
+ ESLog.d('ESPluginModule', ' --->fileListRes ' + ' ' + fileListRes);
3680
+ for (let i = 0; i < fileListRes.length; i++) {
3681
+ let nextPath = absolutePathRes + '/' + fileListRes[i];
3682
+ ESLog.d('ESPluginModule', ' --->nextPath ' + ' ' + nextPath);
3683
+ if (absolutePathRes.endsWith('/arm') || absolutePathRes.endsWith('/arm64')) {
3689
3684
  let nextFile = new ESFile();
3690
3685
  nextFile.newESFile(nextPath)
3691
3686
  .then(() => {
3692
- ESLogModule.d('ESPluginModule', ' ---> delete ' + nextPath);
3687
+ ESLog.d('ESPluginModule', ' ---> delete ' + nextPath);
3693
3688
  nextFile.delete();
3694
3689
  });
3695
3690
  } else {
3696
- this.checkFile(nextPath);
3691
+ await this.checkFile(nextPath);
3697
3692
  }
3698
3693
  }
3699
- });
3700
- });
3694
+ }
3695
+ } else {
3696
+ ESLog.d('ESPluginModule', ' --->absolutePathErr ');
3697
+ }
3698
+ }
3699
+ } catch (err) {
3700
+ ESLog.d('ESPluginModule', 'checkFile ' + ' ' + err);
3701
+ }
3701
3702
  }
3702
3703
  }
3703
3704
 
@@ -3709,10 +3710,13 @@ var ESPluginFix$1 = new ESPluginFix();
3709
3710
  */
3710
3711
  class ESPluginModule {
3711
3712
 
3712
- install(pluginArray) {
3713
- // 修复插件崩溃问题
3714
- ESPluginFix$1.tryFix();
3715
- return Vue.Native.callNative('ESPluginModule', 'install', pluginArray);
3713
+ async install(pluginArray) {
3714
+ try {
3715
+ await ESPluginFix$1.tryFix();
3716
+ return Vue.Native.callNative('ESPluginModule', 'install', pluginArray);
3717
+ } catch (e) {
3718
+
3719
+ }
3716
3720
  }
3717
3721
  }
3718
3722
 
@@ -3727,7 +3731,7 @@ class ESPluginManager {
3727
3731
  return Promise.resolve();
3728
3732
  }
3729
3733
 
3730
- installPlugin(plugin) {
3734
+ async installPlugin(plugin) {
3731
3735
  let pluginArray = [
3732
3736
  plugin
3733
3737
  ];
@@ -3736,7 +3740,7 @@ class ESPluginManager {
3736
3740
  "pluginArray:" + JSON.stringify(pluginArray)
3737
3741
  );
3738
3742
  }
3739
- ESPluginModule$1.install(pluginArray);
3743
+ await ESPluginModule$1.install(pluginArray);
3740
3744
  }
3741
3745
  }
3742
3746
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extscreen/es-core",
3
- "version": "2.3.22",
3
+ "version": "2.3.23",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {