@webspatial/builder 0.1.15 → 0.1.17

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 +1,116 @@
1
- 'use strict';const _0x3ce0ad=_0x13ab;(function(_0x1f5c98,_0x161c20){const _0xd247c7=_0x13ab,_0x42c69b=_0x1f5c98();while(!![]){try{const _0x1c647e=-parseInt(_0xd247c7(0xc6))/0x1+-parseInt(_0xd247c7(0xbc))/0x2*(-parseInt(_0xd247c7(0xc3))/0x3)+parseInt(_0xd247c7(0xd7))/0x4*(-parseInt(_0xd247c7(0xb4))/0x5)+-parseInt(_0xd247c7(0xc4))/0x6*(-parseInt(_0xd247c7(0xcf))/0x7)+parseInt(_0xd247c7(0xbd))/0x8+parseInt(_0xd247c7(0xd1))/0x9*(-parseInt(_0xd247c7(0xca))/0xa)+parseInt(_0xd247c7(0xb5))/0xb;if(_0x1c647e===_0x161c20)break;else _0x42c69b['push'](_0x42c69b['shift']());}catch(_0x1d6ff7){_0x42c69b['push'](_0x42c69b['shift']());}}}(_0x79f8,0x28e82));Object[_0x3ce0ad(0xd0)](exports,_0x3ce0ad(0xae),{'value':!![]});const path_1=require(_0x3ce0ad(0xbe)),fs=require('fs'),utils_1=require(_0x3ce0ad(0xbb));function _0x79f8(){const _0x46f4d8=['237263vIAxIt','../../run_history.txt','recordSimulator','object','5860JuaGpD','recordManifest','getAppInfoRecord','cmd','default','333263myekUu','defineProperty','1089Vdsssy','keys','stringify','warn','writeFileSync','appInfo','300iKdIxu','init','history','checkCommand','Historical\x20records\x20found','__esModule','join','name','readFileSync','parse','record','18600reDYtN','5038242RKELiX','log','CliLog','getSimulatorHistory','Mismatch\x20found\x20at\x20key:\x20','simulator','./utils','482nEutrQ','1579088DPTnKT','path','getSimulatorRecord','write','defaultHistory','compareObjects','51naidJu','12BBjbtR','utf-8'];_0x79f8=function(){return _0x46f4d8;};return _0x79f8();}function _0x13ab(_0x1e9cdc,_0x40368a){const _0x79f882=_0x79f8();return _0x13ab=function(_0x13ab86,_0x50a4d2){_0x13ab86=_0x13ab86-0xae;let _0x134cb3=_0x79f882[_0x13ab86];return _0x134cb3;},_0x13ab(_0x1e9cdc,_0x40368a);}class CliHistory{static[_0x3ce0ad(0xd8)](_0x273447){const _0x1f5daf=_0x3ce0ad;let _0x21b311=(0x0,path_1[_0x1f5daf(0xaf)])(__dirname,_0x1f5daf(0xc7)),_0x395f58=this[_0x1f5daf(0xc1)];if(!fs['existsSync'](_0x21b311))fs[_0x1f5daf(0xd5)](_0x21b311,'');else try{_0x395f58=JSON[_0x1f5daf(0xb2)](fs[_0x1f5daf(0xb1)](_0x21b311,_0x1f5daf(0xc5))),console[_0x1f5daf(0xb6)](_0x1f5daf(0xdb));}catch(_0x273588){utils_1[_0x1f5daf(0xb7)][_0x1f5daf(0xd4)]('No\x20historical\x20records\x20found');}this[_0x1f5daf(0xd9)]=_0x395f58,this[_0x1f5daf(0xb3)][_0x1f5daf(0xcd)]=_0x273447;}static[_0x3ce0ad(0xcc)](){const _0x53ec7a=_0x3ce0ad;return this['record'][_0x53ec7a(0xd6)];}static[_0x3ce0ad(0xbf)](){const _0x1f121c=_0x3ce0ad;return this[_0x1f121c(0xb3)][_0x1f121c(0xba)];}static[_0x3ce0ad(0xb8)](){const _0x11ad50=_0x3ce0ad;return this[_0x11ad50(0xd9)][_0x11ad50(0xba)];}static[_0x3ce0ad(0xcb)](_0x47af1e){const _0xe9c64f=_0x3ce0ad;this['record']['manifest']=_0x47af1e,this[_0xe9c64f(0xb3)][_0xe9c64f(0xd6)][_0xe9c64f(0xb0)]=_0x47af1e[_0xe9c64f(0xb0)],this['record'][_0xe9c64f(0xd6)]['id']=_0x47af1e['id'];}static[_0x3ce0ad(0xc8)](_0x2240b3){this['record']['simulator']=_0x2240b3;}static['checkManifest'](_0x45a221){const _0x17a8d8=_0x3ce0ad;return this[_0x17a8d8(0xc2)](this[_0x17a8d8(0xd9)]['manifest'],_0x45a221);}static[_0x3ce0ad(0xc2)](_0x6d7139,_0x16354e){const _0x1ac80a=_0x3ce0ad,_0x414d07=Object['keys'](_0x6d7139),_0x513ea5=Object[_0x1ac80a(0xd2)](_0x16354e);if(_0x414d07['length']!==_0x513ea5['length'])return![];for(const _0x46ba00 of _0x414d07){const _0x385b89=_0x6d7139[_0x46ba00],_0x2ff231=_0x16354e[_0x46ba00];if(_0x385b89===undefined||_0x2ff231===undefined){if(_0x385b89!==_0x2ff231)return![];continue;}if(typeof _0x385b89===_0x1ac80a(0xc9)&&_0x385b89!==null){if(!this[_0x1ac80a(0xc2)](_0x385b89,_0x2ff231))return![];continue;}if(_0x385b89!==_0x2ff231)return console[_0x1ac80a(0xb6)](_0x1ac80a(0xb9)+_0x46ba00),![];}return!![];}static[_0x3ce0ad(0xda)](_0x34b64a){return this['history']['cmd']===_0x34b64a;}static[_0x3ce0ad(0xc0)](){const _0x88c7a9=_0x3ce0ad;let _0x453fac=(0x0,path_1[_0x88c7a9(0xaf)])(__dirname,_0x88c7a9(0xc7));fs['writeFileSync'](_0x453fac,JSON[_0x88c7a9(0xd3)](this[_0x88c7a9(0xb3)]));}}CliHistory[_0x3ce0ad(0xc1)]={'cmd':'','manifest':{},'appInfo':{'name':'','id':''},'simulator':''},CliHistory[_0x3ce0ad(0xb3)]={'cmd':'','manifest':{},'appInfo':{'name':'','id':''},'simulator':''},exports[_0x3ce0ad(0xce)]=CliHistory;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const path_1 = require("path");
4
+ const fs = require("fs");
5
+ const utils_1 = require("./utils");
6
+ const resource_1 = require("../resource");
7
+ /*
8
+ Histoy is used to record information about successful execution of the run command,
9
+ including cmd, manifest, appInfo, simulator.
10
+ The historical record is used to determine whether the current execution is the same as the historical execution.
11
+ If the current execution is the same as the historical execution, the historical record will be used to avoid repeated execution.
12
+ If the current execution is different from the historical execution, the historical record will be overwritten.
13
+ */
14
+ class CliHistory {
15
+ /*
16
+ If history file not exist, create it
17
+ If history file exist, read it
18
+ If history file is empty, use default history
19
+ */
20
+ static init(cmd) {
21
+ let historyFile = (0, path_1.join)(__dirname, '../../run_history.txt');
22
+ let history = this.defaultHistory;
23
+ if (!fs.existsSync(historyFile)) {
24
+ fs.writeFileSync(historyFile, '');
25
+ }
26
+ else {
27
+ try {
28
+ history = JSON.parse(fs.readFileSync(historyFile, 'utf-8'));
29
+ console.log('Historical records found');
30
+ }
31
+ catch (e) {
32
+ utils_1.CliLog.warn('No historical records found');
33
+ }
34
+ }
35
+ this.history = history;
36
+ this.record.cmd = cmd;
37
+ }
38
+ static getAppInfoRecord() {
39
+ return this.record.appInfo;
40
+ }
41
+ static getSimulatorRecord() {
42
+ return this.record.simulator;
43
+ }
44
+ static getSimulatorHistory() {
45
+ return this.history.simulator;
46
+ }
47
+ static recordManifest(manifest) {
48
+ this.record.manifest = manifest;
49
+ this.record.appInfo.name = manifest.name;
50
+ this.record.appInfo.id = manifest.id;
51
+ }
52
+ static recordSimulator(simulator) {
53
+ this.record.simulator = simulator;
54
+ }
55
+ static checkManifest(manifest) {
56
+ return this.compareObjects(this.history.manifest, manifest);
57
+ }
58
+ // Check whether the test app exists
59
+ static checkTestAppIsExist() {
60
+ const appInfo = this.getAppInfoRecord();
61
+ const appFile = (0, path_1.join)(resource_1.PROJECT_TEST_DIRECTORY, `Build/Products/Debug-xrsimulator/${appInfo.name}.app`);
62
+ return fs.existsSync(appFile);
63
+ }
64
+ // Compare whether two objects are equal
65
+ static compareObjects(obj1, obj2) {
66
+ // 1. Check if the number of properties is the same
67
+ const keys1 = Object.keys(obj1);
68
+ const keys2 = Object.keys(obj2);
69
+ if (keys1.length !== keys2.length) {
70
+ return false;
71
+ }
72
+ // 2. Deep comparison of each attribute
73
+ for (const key of keys1) {
74
+ const value1 = obj1[key];
75
+ const value2 = obj2[key];
76
+ // Dealing with undefined/null situations
77
+ if (value1 === undefined || value2 === undefined) {
78
+ if (value1 !== value2)
79
+ return false;
80
+ continue;
81
+ }
82
+ // Recursive comparison of nested objects
83
+ if (typeof value1 === 'object' && value1 !== null) {
84
+ if (!this.compareObjects(value1, value2))
85
+ return false;
86
+ continue;
87
+ }
88
+ // Basic comparison of primitive types
89
+ if (value1 !== value2) {
90
+ console.log(`Mismatch found at key: ${key}`);
91
+ return false;
92
+ }
93
+ }
94
+ return true;
95
+ }
96
+ static checkCommand(cmd) {
97
+ return this.history.cmd === cmd;
98
+ }
99
+ static write() {
100
+ let historyFile = (0, path_1.join)(__dirname, '../../run_history.txt');
101
+ fs.writeFileSync(historyFile, JSON.stringify(this.record));
102
+ }
103
+ }
104
+ CliHistory.defaultHistory = {
105
+ cmd: '',
106
+ manifest: {},
107
+ appInfo: { name: '', id: '' },
108
+ simulator: '',
109
+ };
110
+ CliHistory.record = {
111
+ cmd: '',
112
+ manifest: {},
113
+ appInfo: { name: '', id: '' },
114
+ simulator: '',
115
+ };
116
+ exports.default = CliHistory;
@@ -1 +1,102 @@
1
- 'use strict';const _0x39450a=_0x4704;function _0x1bce(){const _0x417e4b=['Decompressing\x20the\x20JDK\x2011\x20Sources...','\x0aSigning\x20key\x20creation','--manifest','Path\x20to\x20your\x20existing\x20JDK\x2011:','Country\x20(2\x20letter\x20code):','Do\x20you\x20want\x20picoxr-web\x20to\x20install\x20the\x20Android\x20SDK\x20(recommended)?\x0a\x20\x20(Enter\x20\x22No\x22\x20to\x20use\x20your\x20own\x20Android\x20SDK\x20installation)','6zULnno','--manifest-url','Downloading\x20JDK\x2011\x20to\x20','24TzPizp','Password\x20for\x20the\x20Key\x20Store:','Downloading\x20the\x20JDK\x2011\x20Binaries...','Path\x20to\x20your\x20existing\x20Android\x20SDK:','Icon\x20URL:','bold','\x20and\x20alias\x20','\x22.\x0a','8102016nIrPeE','Minimum\x20length\x20is\x20','https://developer.android.com/studio/terms.html','\x09-\x20Generated\x20Android\x20APK\x20at\x20','Do\x20you\x20agree\x20to\x20the\x20Android\x20SDK\x20terms\x20and\x20conditions\x20at\x20','Do\x20you\x20want\x20to\x20create\x20one\x20now?','Password\x20for\x20the\x20Key:','25243290ekNFjO','\x20validation\x20successful.Here\x20is\x20the\x20relevant\x20information:','green','license\x20agreement.','Missing\x20required\x20parameter\x20','Trusted\x20Web\x20Activities\x20are\x20currently\x20incompatible','1069050ddHUmx','Downloading\x20Android\x20SDK\x20to\x20','Decompressing\x20the\x20Android\x20SDK...','Downloading\x20the\x20JDK\x2011\x20Sources...','WARNING:\x20','759966YNmwMZ','__esModule','defineProperty','\x20Families\x0apolicies\x20to\x20learn\x20more.\x0a','(5/5)','yellow','Decompressing\x20the\x20JDK\x2011\x20Binaries...','Generating\x20Android\x20Project.','Organization\x20(eg:\x20Company\x20Name):','messages','Downloading\x20the\x20Android\x20SDK...','96quLifN','\x0aBuilding\x20the\x20Android\x20App...','Invalid\x20icon\x20path:\x20','https://play.google.com/console/about/families/','\x20but\x20input\x20is\x20','5218344CgCaIe','51639HulXVa','First\x20and\x20Last\x20names\x20(eg:\x20PICO):','underline','\x20can\x20not\x20be\x20accessible.','Do\x20you\x20want\x20picoxr-web\x20to\x20install\x20the\x20JDK\x20(recommended)?\x0a\x20\x20(Enter\x20\x22No\x22\x20to\x20use\x20your\x20own\x20JDK\x2011\x20installation)','Initializing\x20application\x20from\x20Local\x20Manifest:\x0a\x09-\x20\x20','Downloading\x20Android\x20SDK\x20failed\x20because\x20Terms\x20and\x20Conditions\x20was\x20not\x20signed.','Invalid\x20integer\x20provided:\x20','Maximum\x20length\x20is\x20','cyan','Starting\x20version\x20code\x20for\x20the\x20new\x20app\x20version:','Initializing\x20application\x20from\x20Web\x20Manifest:\x0a\x09-\x20\x20','\x20URL\x20','392707QJWsXW','URL\x20'];_0x1bce=function(){return _0x417e4b;};return _0x1bce();}(function(_0x14c41d,_0x5f025b){const _0x1094ed=_0x4704,_0x56e5e9=_0x14c41d();while(!![]){try{const _0x1fe24a=parseInt(_0x1094ed(0x1e6))/0x1+-parseInt(_0x1094ed(0x1c9))/0x2*(-parseInt(_0x1094ed(0x1b4))/0x3)+parseInt(_0x1094ed(0x1cc))/0x4*(-parseInt(_0x1094ed(0x1e1))/0x5)+-parseInt(_0x1094ed(0x1ae))/0x6*(parseInt(_0x1094ed(0x1c1))/0x7)+-parseInt(_0x1094ed(0x1d4))/0x8+parseInt(_0x1094ed(0x1b3))/0x9+parseInt(_0x1094ed(0x1db))/0xa;if(_0x1fe24a===_0x5f025b)break;else _0x56e5e9['push'](_0x56e5e9['shift']());}catch(_0x207c84){_0x56e5e9['push'](_0x56e5e9['shift']());}}}(_0x1bce,0xb065a));function _0x4704(_0x29e6b6,_0xf19bcc){const _0x1bce29=_0x1bce();return _0x4704=function(_0x470427,_0x4b9b1f){_0x470427=_0x470427-0x1a7;let _0x290f97=_0x1bce29[_0x470427];return _0x290f97;},_0x4704(_0x29e6b6,_0xf19bcc);}Object[_0x39450a(0x1e8)](exports,_0x39450a(0x1e7),{'value':!![]}),exports['messages']=void 0x0;const colors_1=require('colors');exports[_0x39450a(0x1ac)]={'promptInstallJdk':_0x39450a(0x1b8),'promptJdkPath':_0x39450a(0x1c6),'messageDownloadJdk':_0x39450a(0x1cb),'messageDownloadJdkSrc':_0x39450a(0x1e4),'messageDecompressJdkSrc':_0x39450a(0x1c3),'messageDownloadJdkBin':_0x39450a(0x1ce),'messageDecompressJdkBin':_0x39450a(0x1a9),'promptInstallSdk':_0x39450a(0x1c8),'promptSdkPath':_0x39450a(0x1cf),'messageDownloadSdk':_0x39450a(0x1e2),'errorSdkTerms':_0x39450a(0x1ba),'promptSdkTerms':_0x39450a(0x1d8)+(0x0,colors_1[_0x39450a(0x1b6)])(_0x39450a(0x1d6))+'?','messageDownloadAndroidSdk':_0x39450a(0x1ad),'messageDecompressAndroidSdk':_0x39450a(0x1e3),'messageInstallingBuildTools':'Installing\x20Android\x20Build\x20Tools.\x20Please,\x20read\x20and\x20accept\x20the\x20'+_0x39450a(0x1de),'messageGeneratingAndroidProject':_0x39450a(0x1aa),'messageCheckSuccess':(_0x3f9fdd,_0x4fdb85)=>{const _0x144c71=_0x39450a;return _0x144c71(0x1c0)+(0x0,colors_1[_0x144c71(0x1bd)])(_0x3f9fdd)+'\x20'+(_0x4fdb85?'redirected\x20to\x20'+(0x0,colors_1[_0x144c71(0x1bd)])(_0x4fdb85):'')+_0x144c71(0x1dc);},'errorMissingManifestParameter':_0x39450a(0x1df)+((0x0,colors_1[_0x39450a(0x1bd)])(_0x39450a(0x1ca))+'\x20or\x20'+(0x0,colors_1[_0x39450a(0x1bd)])(_0x39450a(0x1c5))),'messageInitializingWebManifest':_0x32a38a=>{const _0x1466fd=_0x39450a;return _0x1466fd(0x1bf)+(0x0,colors_1[_0x1466fd(0x1bd)])(_0x32a38a);},'messageInitializingLocalManifest':_0x38e729=>{const _0x207c86=_0x39450a;return _0x207c86(0x1b9)+(0x0,colors_1[_0x207c86(0x1bd)])(_0x38e729);},'messageInvalidIcon':_0xec0f0b=>{const _0x3f4f3a=_0x39450a;return _0x3f4f3a(0x1b0)+(0x0,colors_1[_0x3f4f3a(0x1bd)])(_0xec0f0b);},'errorStartUrlNotReachable':_0x5a4c86=>_0x39450a(0x1c2)+_0x5a4c86+_0x39450a(0x1b7)+'Please\x20check\x20your\x20internet\x20connection\x20or\x20start_url\x20in\x20manifest\x20file.','warnFamilyPolicy':(0x0,colors_1[_0x39450a(0x1d1)])((0x0,colors_1[_0x39450a(0x1a8)])(_0x39450a(0x1e5)))+_0x39450a(0x1e0)+'\x20with\x20applications\x0atargeting\x20children\x20under\x20the\x20age\x20of\x2013.'+'\x20Check\x20out\x20the\x20Play\x20for'+_0x39450a(0x1e9)+(0x0,colors_1[_0x39450a(0x1bd)])(_0x39450a(0x1b1)),'promptIconUrl':_0x39450a(0x1d0),'errorInvalidUrl':_0x351f04=>{return'Invalid\x20URL:\x20'+_0x351f04;},'errorUrlMustBeImage':_0xf8f292=>{return'URL\x20must\x20resolve\x20to\x20an\x20image/*\x20mime-type,\x20but\x20resolved\x20to\x20'+_0xf8f292+'.';},'promptVersionCode':_0x39450a(0x1be),'promptVersionName':'Starting\x20version\x20name\x20for\x20the\x20new\x20app\x20version:','messageSigningKeyInformation':(0x0,colors_1['underline'])('\x0aSigning\x20key\x20information\x20'+(0x0,colors_1[_0x39450a(0x1dd)])(_0x39450a(0x1a7))),'messageProjectGeneratedSuccess':'\x0aProject\x20generated\x20successfully.','messageSigningKeyCreation':(0x0,colors_1[_0x39450a(0x1b6)])(_0x39450a(0x1c4)),'messageSigningKeyNotFound':_0x4fd1d5=>{const _0x45e0ad=_0x39450a;return'\x0aAn\x20existing\x20key\x20store\x20could\x20not\x20be\x20found\x20at\x20\x22'+_0x4fd1d5+_0x45e0ad(0x1d3);},'promptCreateKey':_0x39450a(0x1d9),'promptKeyFullName':_0x39450a(0x1b5),'promptKeyOrganizationalUnit':'Organizational\x20Unit\x20(eg:\x20PICO\x20Dept):','promptKeyOrganization':_0x39450a(0x1ab),'promptKeyCountry':_0x39450a(0x1c7),'promptKeystorePassword':_0x39450a(0x1cd),'promptKeyPassword':_0x39450a(0x1da),'messageBuildingApp':_0x39450a(0x1af),'messageEnterPasswords':(_0x695770,_0x34ae10)=>{const _0x312b55=_0x39450a;return'Please,\x20enter\x20passwords\x20for\x20the\x20keystore\x20'+(0x0,colors_1[_0x312b55(0x1bd)])(_0x695770)+_0x312b55(0x1d2)+(0x0,colors_1[_0x312b55(0x1bd)])(_0x34ae10)+'.\x0a';},'errorMinLength':(_0x2d9a08,_0xdfecbd)=>{const _0x46236e=_0x39450a;return _0x46236e(0x1d5)+_0x2d9a08+_0x46236e(0x1b2)+_0xdfecbd+'.';},'errorMaxLength':(_0x4f7a37,_0x34ef61)=>{const _0x4c298a=_0x39450a;return _0x4c298a(0x1bc)+_0x4f7a37+_0x4c298a(0x1b2)+_0x34ef61+'.';},'errorInvalidInteger':_0xf0d94c=>{const _0x23b879=_0x39450a;return _0x23b879(0x1bb)+_0xf0d94c;},'messageApkSuccess':_0x4ee7d8=>{const _0x523cb8=_0x39450a;return _0x523cb8(0x1d7)+(0x0,colors_1[_0x523cb8(0x1bd)])(_0x4ee7d8);},'missingUrlToCheck':_0x39450a(0x1df)+(''+(0x0,colors_1[_0x39450a(0x1bd)])('--url'))};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.messages = void 0;
4
+ const colors_1 = require("colors");
5
+ exports.messages = {
6
+ promptInstallJdk: `Do you want picoxr-web to install the JDK (recommended)?
7
+ (Enter "No" to use your own JDK 11 installation)`,
8
+ promptJdkPath: 'Path to your existing JDK 11:',
9
+ messageDownloadJdk: 'Downloading JDK 11 to ',
10
+ messageDownloadJdkSrc: 'Downloading the JDK 11 Sources...',
11
+ messageDecompressJdkSrc: 'Decompressing the JDK 11 Sources...',
12
+ messageDownloadJdkBin: 'Downloading the JDK 11 Binaries...',
13
+ messageDecompressJdkBin: 'Decompressing the JDK 11 Binaries...',
14
+ promptInstallSdk: `Do you want picoxr-web to install the Android SDK (recommended)?
15
+ (Enter "No" to use your own Android SDK installation)`,
16
+ promptSdkPath: 'Path to your existing Android SDK:',
17
+ messageDownloadSdk: 'Downloading Android SDK to ',
18
+ errorSdkTerms: 'Downloading Android SDK failed because Terms and Conditions was not signed.',
19
+ promptSdkTerms: `Do you agree to the Android SDK terms and conditions at ${(0, colors_1.underline)('https://developer.android.com/studio/terms.html')}?`,
20
+ messageDownloadAndroidSdk: 'Downloading the Android SDK...',
21
+ messageDecompressAndroidSdk: 'Decompressing the Android SDK...',
22
+ messageInstallingBuildTools: 'Installing Android Build Tools. Please, read and accept the ' +
23
+ 'license agreement.',
24
+ messageGeneratingAndroidProject: 'Generating Android Project.',
25
+ // 可安装检测成功输出
26
+ messageCheckSuccess: (url, redirectLocation) => {
27
+ return ` URL ${(0, colors_1.cyan)(url)} ${redirectLocation ? `redirected to ${(0, colors_1.cyan)(redirectLocation)}` : ''} validation successful.Here is the relevant information:`;
28
+ },
29
+ errorMissingManifestParameter: 'Missing required parameter ' +
30
+ `${(0, colors_1.cyan)('--manifest-url')} or ${(0, colors_1.cyan)('--manifest')}`,
31
+ messageInitializingWebManifest: (manifestUrl) => {
32
+ return `Initializing application from Web Manifest:\n\t- ${(0, colors_1.cyan)(manifestUrl)}`;
33
+ },
34
+ messageInitializingLocalManifest: (manifestPath) => {
35
+ return `Initializing application from Local Manifest:\n\t- ${(0, colors_1.cyan)(manifestPath)}`;
36
+ },
37
+ messageInvalidIcon: (iconPath) => {
38
+ return `Invalid icon path: ${(0, colors_1.cyan)(iconPath)}`;
39
+ },
40
+ errorStartUrlNotReachable: (launchUrl) => `URL ${launchUrl} can not be accessible.` +
41
+ 'Please check your internet connection or start_url in manifest file.',
42
+ warnFamilyPolicy: (0, colors_1.bold)((0, colors_1.yellow)('WARNING: ')) +
43
+ 'Trusted Web Activities are currently incompatible' +
44
+ ' with applications\ntargeting children under the age of 13.' +
45
+ ' Check out the Play for' +
46
+ ' Families\npolicies to learn more.\n' +
47
+ (0, colors_1.cyan)('https://play.google.com/console/about/families/'),
48
+ // 本地manifest,交互式提供icon
49
+ promptIconUrl: 'Icon URL:',
50
+ errorInvalidUrl: (url) => {
51
+ return `Invalid URL: ${url}`;
52
+ },
53
+ errorUrlMustBeImage: (mimeType) => {
54
+ return `URL must resolve to an image/* mime-type, but resolved to ${mimeType}.`;
55
+ },
56
+ promptVersionCode: 'Starting version code for the new app version:',
57
+ promptVersionName: 'Starting version name for the new app version:',
58
+ messageSigningKeyInformation: (0, colors_1.underline)(`\nSigning key information ${(0, colors_1.green)('(5/5)')}`),
59
+ // messageSigningKeyInformationDesc: `
60
+ // Please, enter information about the key store containing the keys that will be used
61
+ // to sign the application. If a key store does not exist on the provided path,
62
+ // picoxr-web will prompt for the creation of a new keystore.
63
+ // \t- ${bold('Key store location:')} The location of the key store in the file
64
+ // \t system.
65
+ // \t- ${bold('Key name:')} The alias used on the key.
66
+ // Read more about Android signing keys at:
67
+ // \t ${cyan('https://developer.android.com/studio/publish/app-signing')}\n`,
68
+ // promptKeyAlias: 'Key name:',
69
+ messageProjectGeneratedSuccess: '\nProject generated successfully.',
70
+ // 创建keystore
71
+ messageSigningKeyCreation: (0, colors_1.underline)('\nSigning key creation'),
72
+ messageSigningKeyNotFound: (path) => {
73
+ return `\nAn existing key store could not be found at "${path}".\n`;
74
+ },
75
+ promptCreateKey: 'Do you want to create one now?',
76
+ promptKeyFullName: 'First and Last names (eg: PICO):',
77
+ promptKeyOrganizationalUnit: 'Organizational Unit (eg: PICO Dept):',
78
+ promptKeyOrganization: 'Organization (eg: Company Name):',
79
+ promptKeyCountry: 'Country (2 letter code):',
80
+ promptKeystorePassword: 'Password for the Key Store:',
81
+ promptKeyPassword: 'Password for the Key:',
82
+ messageBuildingApp: '\nBuilding the Android App...',
83
+ messageEnterPasswords: (keypath, keyalias) => {
84
+ return `Please, enter passwords for the keystore ${(0, colors_1.cyan)(keypath)} and alias \
85
+ ${(0, colors_1.cyan)(keyalias)}.\n`;
86
+ },
87
+ // build时,校验输入的keystore和key的密码长度
88
+ errorMinLength: (minLength, actualLength) => {
89
+ return `Minimum length is ${minLength} but input is ${actualLength}.`;
90
+ },
91
+ errorMaxLength: (maxLength, actualLength) => {
92
+ return `Maximum length is ${maxLength} but input is ${actualLength}.`;
93
+ },
94
+ errorInvalidInteger: (integer) => {
95
+ return `Invalid integer provided: ${integer}`;
96
+ },
97
+ messageApkSuccess: (filename) => {
98
+ return `\t- Generated Android APK at ${(0, colors_1.cyan)(filename)}`;
99
+ },
100
+ // 可安装检测url参数缺失
101
+ missingUrlToCheck: 'Missing required parameter ' + `${(0, colors_1.cyan)('--url')}`,
102
+ };
@@ -1 +1,15 @@
1
- 'use strict';function _0x43a7(_0x2661cb,_0x2ee675){const _0x957c4b=_0x957c();return _0x43a7=function(_0x43a78c,_0xfb11e8){_0x43a78c=_0x43a78c-0x8d;let _0x4020ce=_0x957c4b[_0x43a78c];return _0x4020ce;},_0x43a7(_0x2661cb,_0x2ee675);}const _0x361396=_0x43a7;(function(_0x61e6d,_0x2a0fc3){const _0x5325c4=_0x43a7,_0x4ad542=_0x61e6d();while(!![]){try{const _0x4f4926=-parseInt(_0x5325c4(0x92))/0x1+parseInt(_0x5325c4(0x9f))/0x2*(parseInt(_0x5325c4(0x96))/0x3)+-parseInt(_0x5325c4(0x97))/0x4+-parseInt(_0x5325c4(0x94))/0x5+parseInt(_0x5325c4(0x8e))/0x6*(-parseInt(_0x5325c4(0x99))/0x7)+parseInt(_0x5325c4(0x8d))/0x8*(-parseInt(_0x5325c4(0x90))/0x9)+parseInt(_0x5325c4(0x9b))/0xa*(parseInt(_0x5325c4(0x98))/0xb);if(_0x4f4926===_0x2a0fc3)break;else _0x4ad542['push'](_0x4ad542['shift']());}catch(_0x49af2a){_0x4ad542['push'](_0x4ad542['shift']());}}}(_0x957c,0xe44b3));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[_0x361396(0x9a)]=void 0x0,exports['parseRouter']=parseRouter;const Log_1=require(_0x361396(0x8f));function _0x957c(){const _0x2e73f8=['22cKbCcU','7ahYTWp','CliLog','17739820HbIhdi','join','replace','webspatial-builder','17634xNoAYV','9779688sOOJPP','6742788LOuNMa','./Log','9PtDJHr','split','933874xrqRLx','ConsoleLog','938715FreknC','indexOf','429aIbQkj','1623312nQKpWf'];_0x957c=function(){return _0x2e73f8;};return _0x957c();}function parseRouter(_0x1d15c4){const _0x2d402d=_0x361396;let _0x4f9843=_0x1d15c4[_0x2d402d(0x91)]('/');_0x4f9843['pop']();let _0x1c8da1=_0x4f9843[_0x2d402d(0x9c)]();while(_0x1c8da1[_0x2d402d(0x95)](',')>=0x0){_0x1c8da1=_0x1c8da1[_0x2d402d(0x9d)](',','/');}return _0x1c8da1;}exports[_0x361396(0x9a)]=new Log_1[(_0x361396(0x93))](_0x361396(0x9e));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CliLog = void 0;
4
+ exports.parseRouter = parseRouter;
5
+ const Log_1 = require("./Log");
6
+ function parseRouter(url) {
7
+ let urlParts = url.split('/');
8
+ urlParts.pop();
9
+ let pathUrl = urlParts.join();
10
+ while (pathUrl.indexOf(',') >= 0) {
11
+ pathUrl = pathUrl.replace(',', '/');
12
+ }
13
+ return pathUrl;
14
+ }
15
+ exports.CliLog = new Log_1.ConsoleLog('webspatial-builder');
@@ -1 +1,35 @@
1
- 'use strict';const _0x246b7e=_0x5449;(function(_0x1f806e,_0x55267b){const _0x42456e=_0x5449,_0x2f1164=_0x1f806e();while(!![]){try{const _0x354a85=-parseInt(_0x42456e(0x20c))/0x1+-parseInt(_0x42456e(0x1ff))/0x2*(-parseInt(_0x42456e(0x1f0))/0x3)+-parseInt(_0x42456e(0x203))/0x4*(parseInt(_0x42456e(0x20d))/0x5)+-parseInt(_0x42456e(0x206))/0x6*(parseInt(_0x42456e(0x1f5))/0x7)+parseInt(_0x42456e(0x204))/0x8+parseInt(_0x42456e(0x1f1))/0x9+-parseInt(_0x42456e(0x20a))/0xa;if(_0x354a85===_0x55267b)break;else _0x2f1164['push'](_0x2f1164['shift']());}catch(_0x353d40){_0x2f1164['push'](_0x2f1164['shift']());}}}(_0x1334,0xf0fc6));Object[_0x246b7e(0x1f3)](exports,_0x246b7e(0x207),{'value':!![]}),exports['XcodeManager']=void 0x0;const fs=require('fs'),resource_1=require('../resource'),xcodeproject_1=require(_0x246b7e(0x202)),xcodebuild_1=require(_0x246b7e(0x1f2)),xcrun_1=require('./xcrun'),path_1=require('path');class XcodeManager{static async[_0x246b7e(0x205)](_0x1631f0,_0x1e70a6=![]){const _0x3e2959=_0x246b7e,_0x4746cf=resource_1[_0x3e2959(0x1f6)]+_0x3e2959(0x208);await xcodeproject_1['default'][_0x3e2959(0x20b)](_0x4746cf,_0x1631f0,_0x1e70a6),console['log'](_0x3e2959(0x1fd));!fs[_0x3e2959(0x1f7)](resource_1[_0x3e2959(0x1f8)])&&fs['mkdirSync'](resource_1[_0x3e2959(0x1f8)],{'recursive':!![]});if(!_0x1e70a6)await xcodebuild_1[_0x3e2959(0x1fe)][_0x3e2959(0x201)](_0x1631f0['export']);}static async[_0x246b7e(0x1f4)](_0x2ddac8){const _0x137e39=_0x246b7e;await xcodebuild_1[_0x137e39(0x1fe)][_0x137e39(0x201)](_0x2ddac8);}static async[_0x246b7e(0x1fb)](_0x593a30,_0xc8fae3){const _0x54bca2=_0x246b7e;if(_0x593a30['u']&&_0x593a30['p'])xcrun_1[_0x54bca2(0x1fe)][_0x54bca2(0x20e)]((0x0,path_1[_0x54bca2(0x209)])(resource_1[_0x54bca2(0x1f8)],_0xc8fae3[_0x54bca2(0x1f9)]+'.ipa'),_0x593a30['u'],_0x593a30['p'],!![]);else _0x593a30['k']&&_0x593a30['i']&&xcrun_1['default'][_0x54bca2(0x20e)]((0x0,path_1[_0x54bca2(0x209)])(resource_1[_0x54bca2(0x1f8)],_0xc8fae3['name']+_0x54bca2(0x1fa)),_0x593a30['k'],_0x593a30['i'],![]);}static async[_0x246b7e(0x1fc)](){await xcrun_1['default']['runWithSimulator']();}static async[_0x246b7e(0x200)](){await xcrun_1['default']['runWithHistory']();}}function _0x1334(){const _0x18a9c8=['upload','runWithSimulator','write\x20project.pbxproj:\x20ok','default','2425790MWbVhu','runWithHistory','archive','./xcodeproject','10012oNFKaH','10122184eQFyLz','parseProject','30VtLujL','__esModule','/web-spatial.xcodeproj/project.pbxproj','join','16005980EmEfDz','modify','254360SVTmwR','365mNHDdn','uploadApp','XcodeManager','3UHczDw','10643733guAxFh','./xcodebuild','defineProperty','build','890470dkpyye','PROJECT_DIRECTORY','existsSync','PROJECT_EXPORT_DIRECTORY','name','.ipa'];_0x1334=function(){return _0x18a9c8;};return _0x1334();}function _0x5449(_0x1c728e,_0x319c3d){const _0x133453=_0x1334();return _0x5449=function(_0x54492d,_0x5113ea){_0x54492d=_0x54492d-0x1f0;let _0x2cd706=_0x133453[_0x54492d];return _0x2cd706;},_0x5449(_0x1c728e,_0x319c3d);}exports[_0x246b7e(0x20f)]=XcodeManager;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XcodeManager = void 0;
4
+ const resource_1 = require("../resource");
5
+ const xcodeproject_1 = require("./xcodeproject");
6
+ const xcodebuild_1 = require("./xcodebuild");
7
+ const xcrun_1 = require("./xcrun");
8
+ const path_1 = require("path");
9
+ class XcodeManager {
10
+ static async parseProject(option, isDev = false) {
11
+ const projectPath = resource_1.PROJECT_DIRECTORY + '/web-spatial.xcodeproj/project.pbxproj';
12
+ await xcodeproject_1.default.modify(projectPath, option, isDev);
13
+ console.log('write project.pbxproj: ok');
14
+ }
15
+ static async build(exportPath) {
16
+ await xcodebuild_1.default.archive(exportPath);
17
+ }
18
+ static async upload(option, appInfo) {
19
+ if (option['u'] && option['p']) {
20
+ // use username, password
21
+ xcrun_1.default.uploadApp((0, path_1.join)(resource_1.PROJECT_EXPORT_DIRECTORY, `${appInfo.name}.ipa`), option['u'], option['p'], true);
22
+ }
23
+ else if (option['k'] && option['i']) {
24
+ // use apiKey, apiIssuer
25
+ xcrun_1.default.uploadApp((0, path_1.join)(resource_1.PROJECT_EXPORT_DIRECTORY, `${appInfo.name}.ipa`), option['k'], option['i'], false);
26
+ }
27
+ }
28
+ static async runWithSimulator() {
29
+ await xcrun_1.default.runWithSimulator();
30
+ }
31
+ static async runWithHistory() {
32
+ await xcrun_1.default.runWithHistory();
33
+ }
34
+ }
35
+ exports.XcodeManager = XcodeManager;
@@ -1 +1,109 @@
1
- 'use strict';var _0x40f5ec=_0x51ef;function _0x5464(){var _0x2d1efe=['__esModule','33181300FYesoF','15DGDevZ','1103271GOQApc','16164GSNSil','2656pXWebP','1077296TztZhz','178859YEIVeM','14uSQdHM','5003768FDedOo','defineProperty','3406038hSGidN','manifestSwiftTemplate'];_0x5464=function(){return _0x2d1efe;};return _0x5464();}(function(_0x598946,_0x5c28c9){var _0x53baaa=_0x51ef,_0x351b77=_0x598946();while(!![]){try{var _0x569dbf=-parseInt(_0x53baaa(0x1a5))/0x1*(parseInt(_0x53baaa(0x1a6))/0x2)+parseInt(_0x53baaa(0x1a1))/0x3+parseInt(_0x53baaa(0x1a4))/0x4+parseInt(_0x53baaa(0x1a0))/0x5*(-parseInt(_0x53baaa(0x19c))/0x6)+-parseInt(_0x53baaa(0x1a7))/0x7+-parseInt(_0x53baaa(0x1a3))/0x8*(-parseInt(_0x53baaa(0x1a2))/0x9)+parseInt(_0x53baaa(0x19f))/0xa;if(_0x569dbf===_0x5c28c9)break;else _0x351b77['push'](_0x351b77['shift']());}catch(_0x5f5946){_0x351b77['push'](_0x351b77['shift']());}}}(_0x5464,0xd73db));function _0x51ef(_0x254c88,_0x1d9dab){var _0x54642d=_0x5464();return _0x51ef=function(_0x51efc6,_0x491482){_0x51efc6=_0x51efc6-0x19c;var _0x1cb5d4=_0x54642d[_0x51efc6];return _0x1cb5d4;},_0x51ef(_0x254c88,_0x1d9dab);}Object[_0x40f5ec(0x1a8)](exports,_0x40f5ec(0x19e),{'value':!![]}),exports[_0x40f5ec(0x19d)]=void 0x0,exports[_0x40f5ec(0x19d)]='\x0aimport\x20Foundation\x0a\x0avar\x20pwaManager\x20=\x20PWAManager()\x0a\x0astruct\x20PWAManager:\x20Codable\x20{\x0a\x20\x20\x20\x20var\x20isLocal:\x20Bool\x20=\x20false\x0a\x20\x20\x20\x20var\x20start_url:\x20String\x20=\x20\x22START_URL\x22\x0a\x20\x20\x20\x20var\x20scope:\x20String\x20=\x20\x22SCOPE\x22\x0a\x20\x20\x20\x20var\x20id:\x20String\x20=\x20\x22AppID\x22\x0a\x0a\x20\x20\x20\x20var\x20name:\x20String\x20=\x20\x22AppName\x22\x0a\x20\x20\x20\x20var\x20short_name:\x20String\x20=\x20\x22name\x22\x0a\x20\x20\x20\x20var\x20description:\x20String\x20=\x20\x22Description\x22\x0a\x0a\x20\x20\x20\x20var\x20display:\x20PWADisplayMode\x20=\x20.minimal\x0a\x20\x20\x20\x20var\x20display_override:\x20[PWADisplayMode]\x20=\x20[]\x0a\x20\x20\x20\x20var\x20protocol_handlers:\x20[PWAProtocol]\x20=\x20[PWAProtocol(protocolValue:\x20\x22\x22,\x20url:\x20\x22\x22)]\x0a\x20\x20\x20\x20var\x20mainScene:\x20WindowContainerOptions\x20=\x20.init(\x0a\x20\x20\x20\x20\x20\x20\x20\x20defaultSize:\x20.init(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20SceneWidth,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20SceneHeight\x0a\x20\x20\x20\x20\x20\x20\x20\x20),\x0a\x20\x20\x20\x20\x20\x20\x20\x20resizability:\x20SceneResizability\x0a\x20\x20\x20\x20)\x0a\x20\x20\x20\x20var\x20useMainScene:\x20Bool\x20=\x20USE_MAIN_SCENE\x0a\x0a\x20\x20\x20\x20mutating\x20func\x20_init()\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20urlType\x20=\x20start_url.split(separator:\x20\x22://\x22).first\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20!(urlType\x20==\x20\x22http\x22\x20||\x20urlType\x20==\x20\x22https\x22)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20scope\x20==\x20\x22\x22\x20||\x20scope\x20==\x20\x22/\x22\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20scope\x20=\x20\x22./\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20startUrl\x20=\x20Bundle.main.url(forResource:\x20start_url,\x20withExtension:\x20\x22\x22,\x20subdirectory:\x20\x22\x22)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20start_url\x20=\x20startUrl!.absoluteString\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20scope\x20=\x20URL(string:\x20scope,\x20relativeTo:\x20startUrl)!.absoluteString\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20isLocal\x20=\x20true\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20display_override.count\x20>\x200\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display\x20=\x20display_override[0]\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20for\x20i\x20in\x200\x20...\x20protocol_handlers.count\x20-\x201\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20item\x20=\x20protocol_handlers[i]\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20protocol_handlers[i].updateUrl(scope\x20+\x20item.url)\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20func\x20checkInScope(url:\x20String)\x20->\x20Bool\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20url.starts(with:\x20scope)\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20//\x20web+spatial://test\x0a\x20\x20\x20\x20func\x20checkInDeeplink(url:\x20String)\x20->\x20String\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20var\x20linkUrl:\x20String\x20=\x20url\x0a\x20\x20\x20\x20\x20\x20\x20\x20for\x20item\x20in\x20protocol_handlers\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20linkUrl.starts(with:\x20item.protocolValue)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20queryString:\x20String\x20=\x20linkUrl.replacingOccurrences(of:\x20item.protocolValue,\x20with:\x20\x22\x22).addingPercentEncoding(withAllowedCharacters:\x20.urlQueryAllowed)!\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20linkUrl\x20=\x20item.url.replacingOccurrences(of:\x20\x22%s\x22,\x20with:\x20item.protocolValue\x20+\x20queryString)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20logger.debug(linkUrl)\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20linkUrl\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20func\x20getLocalResourceURL(url:\x20String)\x20->\x20String\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20path\x20=\x20String(url.split(separator:\x20\x22file://\x22).first!.split(separator:\x20\x22?\x22).first!)\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20newUrl\x20=\x20URL(string:\x20url)\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20fileManager\x20=\x20FileManager.default\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20fileManager.fileExists(atPath:\x20newUrl!.path)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20url\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20var\x20resource:\x20String\x20=\x20Bundle.main.url(forResource:\x20newUrl?.path,\x20withExtension:\x20\x22\x22,\x20subdirectory:\x20\x22\x22)?.absoluteString\x20??\x20\x22\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20resource\x20==\x20\x22\x22\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource\x20=\x20Bundle.main.url(forResource:\x20\x22static-web\x22\x20+\x20path,\x20withExtension:\x20\x22\x22,\x20subdirectory:\x20\x22\x22)?.absoluteString\x20??\x20\x22\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20resource\x20==\x20\x22\x22\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20url\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20newUrl?.query()\x20!=\x20nil\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource\x20+=\x20\x22?\x22\x20+\x20(newUrl?.query())!\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20newUrl?.fragment()\x20!=\x20nil\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource\x20+=\x20\x22#\x22\x20+\x20(newUrl?.fragment())!\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20resource\x0a\x20\x20\x20\x20}\x0a}\x0a\x0aenum\x20PWADisplayMode:\x20Codable\x20{\x0a\x20\x20\x20\x20case\x20minimal\x0a\x20\x20\x20\x20case\x20standalone\x0a\x20\x20\x20\x20case\x20fullscreen\x0a}\x0a\x0astruct\x20PWAProtocol:\x20Codable\x20{\x0a\x20\x20\x20\x20var\x20protocolValue:\x20String\x20=\x20\x22\x22\x0a\x20\x20\x20\x20var\x20url:\x20String\x20=\x20\x22\x22\x0a\x0a\x20\x20\x20\x20mutating\x20func\x20updateUrl(_\x20str:\x20String)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20url\x20=\x20str\x0a\x20\x20\x20\x20}\x0a}\x0a\x0a';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.manifestSwiftTemplate = void 0;
4
+ exports.manifestSwiftTemplate = `
5
+ import Foundation
6
+
7
+ var pwaManager = PWAManager()
8
+
9
+ struct PWAManager: Codable {
10
+ var isLocal: Bool = false
11
+ var start_url: String = "START_URL"
12
+ var scope: String = "SCOPE"
13
+ var id: String = "AppID"
14
+
15
+ var name: String = "AppName"
16
+ var short_name: String = "name"
17
+ var description: String = "Description"
18
+
19
+ var display: PWADisplayMode = .minimal
20
+ var display_override: [PWADisplayMode] = []
21
+ var protocol_handlers: [PWAProtocol] = [PWAProtocol(protocolValue: "", url: "")]
22
+ var mainScene: WindowContainerOptions = .init(
23
+ defaultSize: .init(
24
+ width: SceneWidth,
25
+ height: SceneHeight
26
+ ),
27
+ resizability: SceneResizability
28
+ )
29
+ var useMainScene: Bool = USE_MAIN_SCENE
30
+
31
+ mutating func _init() {
32
+ let urlType = start_url.split(separator: "://").first
33
+ if !(urlType == "http" || urlType == "https") {
34
+ if scope == "" || scope == "/" {
35
+ scope = "./"
36
+ }
37
+ let startUrl = Bundle.main.url(forResource: start_url, withExtension: "", subdirectory: "")
38
+ start_url = startUrl!.absoluteString
39
+ scope = URL(string: scope, relativeTo: startUrl)!.absoluteString
40
+ isLocal = true
41
+ }
42
+
43
+ if display_override.count > 0 {
44
+ display = display_override[0]
45
+ }
46
+
47
+ for i in 0 ... protocol_handlers.count - 1 {
48
+ let item = protocol_handlers[i]
49
+ protocol_handlers[i].updateUrl(scope + item.url)
50
+ }
51
+ }
52
+
53
+ func checkInScope(url: String) -> Bool {
54
+ return url.starts(with: scope)
55
+ }
56
+
57
+ // web+spatial://test
58
+ func checkInDeeplink(url: String) -> String {
59
+ var linkUrl: String = url
60
+ for item in protocol_handlers {
61
+ if linkUrl.starts(with: item.protocolValue) {
62
+ let queryString: String = linkUrl.replacingOccurrences(of: item.protocolValue, with: "").addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
63
+ linkUrl = item.url.replacingOccurrences(of: "%s", with: item.protocolValue + queryString)
64
+ }
65
+ }
66
+ logger.debug(linkUrl)
67
+ return linkUrl
68
+ }
69
+
70
+ func getLocalResourceURL(url: String) -> String {
71
+ let path = String(url.split(separator: "file://").first!.split(separator: "?").first!)
72
+ let newUrl = URL(string: url)
73
+ let fileManager = FileManager.default
74
+ if fileManager.fileExists(atPath: newUrl!.path) {
75
+ return url
76
+ }
77
+ var resource: String = Bundle.main.url(forResource: newUrl?.path, withExtension: "", subdirectory: "")?.absoluteString ?? ""
78
+ if resource == "" {
79
+ resource = Bundle.main.url(forResource: "static-web" + path, withExtension: "", subdirectory: "")?.absoluteString ?? ""
80
+ }
81
+ if resource == "" {
82
+ return url
83
+ }
84
+ if newUrl?.query() != nil {
85
+ resource += "?" + (newUrl?.query())!
86
+ }
87
+ if newUrl?.fragment() != nil {
88
+ resource += "#" + (newUrl?.fragment())!
89
+ }
90
+ return resource
91
+ }
92
+ }
93
+
94
+ enum PWADisplayMode: Codable {
95
+ case minimal
96
+ case standalone
97
+ case fullscreen
98
+ }
99
+
100
+ struct PWAProtocol: Codable {
101
+ var protocolValue: String = ""
102
+ var url: String = ""
103
+
104
+ mutating func updateUrl(_ str: String) {
105
+ url = str
106
+ }
107
+ }
108
+
109
+ `;
@@ -1 +1,119 @@
1
- 'use strict';const _0x4171e0=_0x4907;(function(_0x187646,_0xe40f06){const _0x138bad=_0x4907,_0xfc8874=_0x187646();while(!![]){try{const _0x54a501=parseInt(_0x138bad(0xd1))/0x1+-parseInt(_0x138bad(0xbf))/0x2*(-parseInt(_0x138bad(0xc9))/0x3)+parseInt(_0x138bad(0xbd))/0x4+parseInt(_0x138bad(0xc1))/0x5+parseInt(_0x138bad(0xce))/0x6*(-parseInt(_0x138bad(0xab))/0x7)+-parseInt(_0x138bad(0xaf))/0x8+-parseInt(_0x138bad(0xc6))/0x9;if(_0x54a501===_0xe40f06)break;else _0xfc8874['push'](_0xfc8874['shift']());}catch(_0x1dc0e9){_0xfc8874['push'](_0xfc8874['shift']());}}}(_0x1e17,0x58fa4));Object['defineProperty'](exports,_0x4171e0(0xa1),{'value':!![]}),exports[_0x4171e0(0xca)]=void 0x0;const fs=require('fs'),path_1=require(_0x4171e0(0xb3)),resource_1=require(_0x4171e0(0xbc)),semver_1=require(_0x4171e0(0xc3)),file_1=require(_0x4171e0(0xcc)),{execSync,exec}=require(_0x4171e0(0xc8));class Xcodebuild{static async[_0x4171e0(0xa9)](){const _0x4dcc4a=_0x4171e0;try{await new Promise((_0x275869,_0x1e02b3)=>{const _0x29b6c6=_0x4907,_0x127fa3=resource_1['PROJECT_DIRECTORY']+_0x29b6c6(0xa2),_0x251523=execSync(new XcodebuildCMD()[_0x29b6c6(0xa9)](_0x127fa3)[_0x29b6c6(0xc2)]()[_0x29b6c6(0xb2)]);console[_0x29b6c6(0xa6)](_0x251523['toString']()),_0x275869(_0x251523);});}catch(_0x192105){console[_0x4dcc4a(0xa6)](_0x192105);}}static async['list'](){const _0x3a2120=_0x4171e0;try{await new Promise((_0x4463da,_0x3adab6)=>{const _0x37d0c4=_0x4907,_0x106125=resource_1[_0x37d0c4(0xaa)]+_0x37d0c4(0xa2),_0x2f99c2=execSync(new XcodebuildCMD()['project'](_0x106125)['list']()[_0x37d0c4(0xb2)]);console[_0x37d0c4(0xa6)](_0x2f99c2[_0x37d0c4(0xa7)]()),_0x4463da(_0x2f99c2);});}catch(_0x5464d5){console[_0x3a2120(0xa6)](_0x5464d5);}}static async[_0x4171e0(0xb8)](_0x3ab8c5){const _0xa8dd39=_0x4171e0;try{return console[_0xa8dd39(0xa6)](_0xa8dd39(0xd3)),!fs['existsSync'](resource_1[_0xa8dd39(0xd0)])&&fs[_0xa8dd39(0xc4)](resource_1[_0xa8dd39(0xd0)],{'recursive':!![]}),await new Promise((_0x755db3,_0xd31497)=>{const _0x59b4e8=_0xa8dd39,_0xd01fe3=resource_1[_0x59b4e8(0xaa)]+'/web-spatial.xcodeproj',_0x475ebb=execSync(new XcodebuildCMD()[_0x59b4e8(0xa9)](_0xd01fe3)['scheme']('web-spatial')['archive']((0x0,path_1[_0x59b4e8(0xcd)])(resource_1['PROJECT_BUILD_DIRECTORY'],'./pack'))['clean']()[_0x59b4e8(0xb2)]);let _0x175f37=_0x475ebb[_0x59b4e8(0xa7)]();if(_0x175f37[_0x59b4e8(0xb6)](_0x59b4e8(0xcf))>0x0){console[_0x59b4e8(0xa6)]('-------------------\x20ARCHIVE\x20SUCCEEDED\x20-------------------'),console['log'](_0x59b4e8(0xbb));const _0x1fdae0=execSync(new XcodebuildCMD()[_0x59b4e8(0xcb)]((0x0,path_1['join'])(resource_1['PROJECT_BUILD_DIRECTORY'],_0x59b4e8(0xd2)),resource_1[_0x59b4e8(0xd0)],(0x0,path_1[_0x59b4e8(0xcd)])(resource_1[_0x59b4e8(0xa8)],_0x59b4e8(0xa5)))['allowProvisioningUpdates']()['line']);_0x175f37=_0x1fdae0[_0x59b4e8(0xa7)]();if(_0x175f37[_0x59b4e8(0xb6)](_0x59b4e8(0xba))>0x0){const _0x28277b=_0x3ab8c5!==null&&_0x3ab8c5!==void 0x0?_0x3ab8c5:'./build',_0x423c2c=(0x0,path_1['join'])(process['cwd'](),_0x28277b);!fs['existsSync'](_0x423c2c)&&fs['mkdirSync'](_0x423c2c,{'recursive':!![]}),(0x0,file_1[_0x59b4e8(0xc0)])(resource_1[_0x59b4e8(0xd0)],_0x423c2c),console['log'](_0x59b4e8(0xb0)),_0x755db3(!![]);}(0x0,semver_1[_0x59b4e8(0xb9)])(resource_1[_0x59b4e8(0xa8)]);}_0x755db3(![]);});}catch(_0x334b88){console[_0xa8dd39(0xa6)](_0x334b88);}}}exports['default']=Xcodebuild;function _0x1e17(){const _0x56362b=['XcodebuildCMD','output','../resource/file','join','12AHEBTv','ARCHIVE\x20SUCCEEDED','PROJECT_EXPORT_DIRECTORY','363237DtkXKZ','pack.xcarchive','start\x20archive','xcodebuild','__esModule','/web-spatial.xcodeproj','\x20-destination\x20\x27','\x20-scheme\x20','ExportOptions.plist','log','toString','PROJECT_BUILD_DIRECTORY','project','PROJECT_DIRECTORY','2083893AGSgMm','\x20-exportPath\x20','allowProvisioningUpdates','\x20-exportOptionsPlist\x20','763184KeoXxx','-------------------\x20EXPORT\x20SUCCEEDED\x20-------------------','\x20-archivePath\x20','line','path','scheme','\x20-exportArchive\x20-archivePath\x20','indexOf','\x20-allowProvisioningUpdates','archive','clean','EXPORT\x20SUCCEEDED','start\x20export','../resource','725360kSJEkX','destination','16hUgyAq','copyDir','2675990nhSIgy','list','semver','mkdirSync','\x20archive','2447055EYOJjs','\x20clean','child_process','92763AZBIQg'];_0x1e17=function(){return _0x56362b;};return _0x1e17();}class XcodebuildCMD{constructor(){const _0x495041=_0x4171e0;this[_0x495041(0xb2)]=_0x495041(0xd4);}[_0x4171e0(0xa9)](_0x4b4776){const _0x141dbf=_0x4171e0;return this[_0x141dbf(0xb2)]+='\x20-project\x20'+_0x4b4776,this;}[_0x4171e0(0xc2)](){const _0x6a99dd=_0x4171e0;return this[_0x6a99dd(0xb2)]+='\x20-list',this;}[_0x4171e0(0xb4)](_0x424e90){const _0x53c24e=_0x4171e0;return this[_0x53c24e(0xb2)]+=_0x53c24e(0xa4)+_0x424e90,this;}[_0x4171e0(0xb8)](_0x92535f){const _0x199bdb=_0x4171e0;return this[_0x199bdb(0xb2)]+=_0x199bdb(0xb1)+_0x92535f+_0x199bdb(0xc5),this;}[_0x4171e0(0xad)](){const _0x9fbea=_0x4171e0;return this[_0x9fbea(0xb2)]+=_0x9fbea(0xb7),this;}[_0x4171e0(0xbe)](_0x217fb3){const _0x4c8d6c=_0x4171e0;return this[_0x4c8d6c(0xb2)]+=_0x4c8d6c(0xa3)+_0x217fb3+'\x27',this;}[_0x4171e0(0xcb)](_0x538de5,_0x592836,_0x342866){const _0x3eeecf=_0x4171e0;return this[_0x3eeecf(0xb2)]+=_0x3eeecf(0xb5)+_0x538de5+_0x3eeecf(0xac)+_0x592836+_0x3eeecf(0xae)+_0x342866,this;}['clean'](){const _0x54daf1=_0x4171e0;return this['line']+=_0x54daf1(0xc7),this;}}function _0x4907(_0x346b18,_0x561035){const _0x1e170f=_0x1e17();return _0x4907=function(_0x490707,_0x2d57b1){_0x490707=_0x490707-0xa1;let _0xae2ce1=_0x1e170f[_0x490707];return _0xae2ce1;},_0x4907(_0x346b18,_0x561035);}exports[_0x4171e0(0xca)]=XcodebuildCMD;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XcodebuildCMD = void 0;
4
+ const fs = require("fs");
5
+ const path_1 = require("path");
6
+ const resource_1 = require("../resource");
7
+ const semver_1 = require("semver");
8
+ const file_1 = require("../resource/file");
9
+ const { execSync, exec } = require('child_process');
10
+ class Xcodebuild {
11
+ static async project() {
12
+ try {
13
+ await new Promise((resolve, reject) => {
14
+ const projectFile = resource_1.PROJECT_DIRECTORY + '/web-spatial.xcodeproj';
15
+ const execRes = execSync(new XcodebuildCMD().project(projectFile).list().line);
16
+ console.log(execRes.toString());
17
+ resolve(execRes);
18
+ });
19
+ }
20
+ catch (error) {
21
+ console.log(error);
22
+ }
23
+ }
24
+ static async list() {
25
+ try {
26
+ await new Promise((resolve, reject) => {
27
+ const projectFile = resource_1.PROJECT_DIRECTORY + '/web-spatial.xcodeproj';
28
+ const execRes = execSync(new XcodebuildCMD().project(projectFile).list().line);
29
+ console.log(execRes.toString());
30
+ resolve(execRes);
31
+ });
32
+ }
33
+ catch (error) {
34
+ console.log(error);
35
+ }
36
+ }
37
+ static async archive(exportPath) {
38
+ try {
39
+ console.log('start archive');
40
+ if (!fs.existsSync(resource_1.PROJECT_EXPORT_DIRECTORY)) {
41
+ fs.mkdirSync(resource_1.PROJECT_EXPORT_DIRECTORY, { recursive: true });
42
+ }
43
+ return await new Promise((resolve, reject) => {
44
+ const projectFile = resource_1.PROJECT_DIRECTORY + '/web-spatial.xcodeproj';
45
+ // Archive
46
+ const archiveRes = execSync(new XcodebuildCMD()
47
+ .project(projectFile)
48
+ .scheme('web-spatial')
49
+ .archive((0, path_1.join)(resource_1.PROJECT_BUILD_DIRECTORY, './pack'))
50
+ .clean().line);
51
+ let resString = archiveRes.toString();
52
+ if (resString.indexOf('ARCHIVE SUCCEEDED') > 0) {
53
+ console.log('------------------- ARCHIVE SUCCEEDED -------------------');
54
+ console.log('start export');
55
+ // Export
56
+ const outRes = execSync(new XcodebuildCMD()
57
+ .output((0, path_1.join)(resource_1.PROJECT_BUILD_DIRECTORY, 'pack.xcarchive'), resource_1.PROJECT_EXPORT_DIRECTORY, (0, path_1.join)(resource_1.PROJECT_BUILD_DIRECTORY, 'ExportOptions.plist'))
58
+ .allowProvisioningUpdates().line);
59
+ resString = outRes.toString();
60
+ if (resString.indexOf('EXPORT SUCCEEDED') > 0) {
61
+ // copy .ipa file to export path
62
+ const useExportPath = exportPath !== null && exportPath !== void 0 ? exportPath : './build';
63
+ const path = (0, path_1.join)(process.cwd(), useExportPath);
64
+ if (!fs.existsSync(path)) {
65
+ fs.mkdirSync(path, { recursive: true });
66
+ }
67
+ (0, file_1.copyDir)(resource_1.PROJECT_EXPORT_DIRECTORY, path);
68
+ console.log('------------------- EXPORT SUCCEEDED -------------------');
69
+ resolve(true);
70
+ }
71
+ (0, semver_1.clean)(resource_1.PROJECT_BUILD_DIRECTORY);
72
+ }
73
+ resolve(false);
74
+ });
75
+ }
76
+ catch (error) {
77
+ console.log(error);
78
+ }
79
+ }
80
+ }
81
+ exports.default = Xcodebuild;
82
+ class XcodebuildCMD {
83
+ constructor() {
84
+ this.line = 'xcodebuild';
85
+ }
86
+ project(xcodeproj) {
87
+ this.line += ` -project ${xcodeproj}`;
88
+ return this;
89
+ }
90
+ list() {
91
+ this.line += ' -list';
92
+ return this;
93
+ }
94
+ scheme(schemeName) {
95
+ this.line += ` -scheme ${schemeName}`;
96
+ return this;
97
+ }
98
+ archive(path) {
99
+ this.line += ` -archivePath ${path} archive`;
100
+ return this;
101
+ }
102
+ allowProvisioningUpdates() {
103
+ this.line += ' -allowProvisioningUpdates';
104
+ return this;
105
+ }
106
+ destination(target) {
107
+ this.line += ` -destination '${target}'`;
108
+ return this;
109
+ }
110
+ output(archivePath, outPath, plistPath) {
111
+ this.line += ` -exportArchive -archivePath ${archivePath} -exportPath ${outPath} -exportOptionsPlist ${plistPath}`;
112
+ return this;
113
+ }
114
+ clean() {
115
+ this.line += ' clean';
116
+ return this;
117
+ }
118
+ }
119
+ exports.XcodebuildCMD = XcodebuildCMD;