@webspatial/builder 0.1.16 → 0.1.18

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,102 @@
1
- 'use strict';const _0x2b5968=_0x3c63;(function(_0x164b37,_0x6eaf30){const _0x57f0b5=_0x3c63,_0x37ccae=_0x164b37();while(!![]){try{const _0x1b8312=-parseInt(_0x57f0b5(0xe4))/0x1*(-parseInt(_0x57f0b5(0xf0))/0x2)+parseInt(_0x57f0b5(0xf8))/0x3+-parseInt(_0x57f0b5(0xd5))/0x4+parseInt(_0x57f0b5(0xdb))/0x5*(-parseInt(_0x57f0b5(0xe7))/0x6)+-parseInt(_0x57f0b5(0xc8))/0x7*(-parseInt(_0x57f0b5(0xe1))/0x8)+-parseInt(_0x57f0b5(0xed))/0x9*(-parseInt(_0x57f0b5(0x100))/0xa)+parseInt(_0x57f0b5(0xcb))/0xb;if(_0x1b8312===_0x6eaf30)break;else _0x37ccae['push'](_0x37ccae['shift']());}catch(_0xa1e25c){_0x37ccae['push'](_0x37ccae['shift']());}}}(_0x2f89,0x1dbf6));function _0x2f89(){const _0x44267c=['green','bold','Invalid\x20URL:\x20','--url','Downloading\x20the\x20Android\x20SDK...','\x20or\x20','Do\x20you\x20want\x20to\x20create\x20one\x20now?','\x22.\x0a','7NnVgjA','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)','Path\x20to\x20your\x20existing\x20Android\x20SDK:','2221637cpVpit','Path\x20to\x20your\x20existing\x20JDK\x2011:','messages','Please\x20check\x20your\x20internet\x20connection\x20or\x20start_url\x20in\x20manifest\x20file.','\x20and\x20alias\x20','Installing\x20Android\x20Build\x20Tools.\x20Please,\x20read\x20and\x20accept\x20the\x20','Invalid\x20integer\x20provided:\x20','\x0aProject\x20generated\x20successfully.','underline','\x20Families\x0apolicies\x20to\x20learn\x20more.\x0a','677612awzVwF','Decompressing\x20the\x20JDK\x2011\x20Sources...','Downloading\x20the\x20JDK\x2011\x20Binaries...','cyan','Generating\x20Android\x20Project.','URL\x20','5pCJXII','\x20validation\x20successful.Here\x20is\x20the\x20relevant\x20information:','Starting\x20version\x20name\x20for\x20the\x20new\x20app\x20version:','Invalid\x20icon\x20path:\x20','Maximum\x20length\x20is\x20','\x20URL\x20','44216gkAYtJ','\x0aSigning\x20key\x20information\x20','license\x20agreement.','1qnOZmU','Initializing\x20application\x20from\x20Local\x20Manifest:\x0a\x09-\x20\x20','Country\x20(2\x20letter\x20code):','1009398fLSbgB','\x20Check\x20out\x20the\x20Play\x20for','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)','Downloading\x20the\x20JDK\x2011\x20Sources...','Missing\x20required\x20parameter\x20','First\x20and\x20Last\x20names\x20(eg:\x20PICO):','1665oRIOen','yellow','\x09-\x20Generated\x20Android\x20APK\x20at\x20','416180wBwYQQ','\x0aAn\x20existing\x20key\x20store\x20could\x20not\x20be\x20found\x20at\x20\x22','Organization\x20(eg:\x20Company\x20Name):','Trusted\x20Web\x20Activities\x20are\x20currently\x20incompatible','\x0aSigning\x20key\x20creation','Downloading\x20Android\x20SDK\x20to\x20','Please,\x20enter\x20passwords\x20for\x20the\x20keystore\x20','\x20can\x20not\x20be\x20accessible.','71199TSTdfQ','__esModule','--manifest-url','Minimum\x20length\x20is\x20','Do\x20you\x20agree\x20to\x20the\x20Android\x20SDK\x20terms\x20and\x20conditions\x20at\x20','Password\x20for\x20the\x20Key:','Organizational\x20Unit\x20(eg:\x20PICO\x20Dept):','Decompressing\x20the\x20JDK\x2011\x20Binaries...','1090UJpiWf','\x20but\x20input\x20is\x20'];_0x2f89=function(){return _0x44267c;};return _0x2f89();}Object['defineProperty'](exports,_0x2b5968(0xf9),{'value':!![]}),exports[_0x2b5968(0xcd)]=void 0x0;const colors_1=require('colors');function _0x3c63(_0x4baadf,_0x49ffb1){const _0x2f8952=_0x2f89();return _0x3c63=function(_0x3c631f,_0x59e51b){_0x3c631f=_0x3c631f-0xc3;let _0x2116a1=_0x2f8952[_0x3c631f];return _0x2116a1;},_0x3c63(_0x4baadf,_0x49ffb1);}exports[_0x2b5968(0xcd)]={'promptInstallJdk':_0x2b5968(0xc9),'promptJdkPath':_0x2b5968(0xcc),'messageDownloadJdk':'Downloading\x20JDK\x2011\x20to\x20','messageDownloadJdkSrc':_0x2b5968(0xea),'messageDecompressJdkSrc':_0x2b5968(0xd6),'messageDownloadJdkBin':_0x2b5968(0xd7),'messageDecompressJdkBin':_0x2b5968(0xff),'promptInstallSdk':_0x2b5968(0xe9),'promptSdkPath':_0x2b5968(0xca),'messageDownloadSdk':_0x2b5968(0xf5),'errorSdkTerms':'Downloading\x20Android\x20SDK\x20failed\x20because\x20Terms\x20and\x20Conditions\x20was\x20not\x20signed.','promptSdkTerms':_0x2b5968(0xfc)+(0x0,colors_1[_0x2b5968(0xd3)])('https://developer.android.com/studio/terms.html')+'?','messageDownloadAndroidSdk':_0x2b5968(0xc4),'messageDecompressAndroidSdk':'Decompressing\x20the\x20Android\x20SDK...','messageInstallingBuildTools':_0x2b5968(0xd0)+_0x2b5968(0xe3),'messageGeneratingAndroidProject':_0x2b5968(0xd9),'messageCheckSuccess':(_0x5677cf,_0x7f217e)=>{const _0x1c51ac=_0x2b5968;return _0x1c51ac(0xe0)+(0x0,colors_1[_0x1c51ac(0xd8)])(_0x5677cf)+'\x20'+(_0x7f217e?'redirected\x20to\x20'+(0x0,colors_1[_0x1c51ac(0xd8)])(_0x7f217e):'')+_0x1c51ac(0xdc);},'errorMissingManifestParameter':_0x2b5968(0xeb)+((0x0,colors_1['cyan'])(_0x2b5968(0xfa))+_0x2b5968(0xc5)+(0x0,colors_1['cyan'])('--manifest')),'messageInitializingWebManifest':_0x98a431=>{const _0x2e26d9=_0x2b5968;return'Initializing\x20application\x20from\x20Web\x20Manifest:\x0a\x09-\x20\x20'+(0x0,colors_1[_0x2e26d9(0xd8)])(_0x98a431);},'messageInitializingLocalManifest':_0x25718b=>{const _0x2438f6=_0x2b5968;return _0x2438f6(0xe5)+(0x0,colors_1[_0x2438f6(0xd8)])(_0x25718b);},'messageInvalidIcon':_0x7fe0=>{const _0x3770a8=_0x2b5968;return _0x3770a8(0xde)+(0x0,colors_1['cyan'])(_0x7fe0);},'errorStartUrlNotReachable':_0xfa2196=>_0x2b5968(0xda)+_0xfa2196+_0x2b5968(0xf7)+_0x2b5968(0xce),'warnFamilyPolicy':(0x0,colors_1[_0x2b5968(0x103)])((0x0,colors_1[_0x2b5968(0xee)])('WARNING:\x20'))+_0x2b5968(0xf3)+'\x20with\x20applications\x0atargeting\x20children\x20under\x20the\x20age\x20of\x2013.'+_0x2b5968(0xe8)+_0x2b5968(0xd4)+(0x0,colors_1[_0x2b5968(0xd8)])('https://play.google.com/console/about/families/'),'promptIconUrl':'Icon\x20URL:','errorInvalidUrl':_0x1abbcf=>{const _0x4daff8=_0x2b5968;return _0x4daff8(0x104)+_0x1abbcf;},'errorUrlMustBeImage':_0x4fdff0=>{return'URL\x20must\x20resolve\x20to\x20an\x20image/*\x20mime-type,\x20but\x20resolved\x20to\x20'+_0x4fdff0+'.';},'promptVersionCode':'Starting\x20version\x20code\x20for\x20the\x20new\x20app\x20version:','promptVersionName':_0x2b5968(0xdd),'messageSigningKeyInformation':(0x0,colors_1[_0x2b5968(0xd3)])(_0x2b5968(0xe2)+(0x0,colors_1[_0x2b5968(0x102)])('(5/5)')),'messageProjectGeneratedSuccess':_0x2b5968(0xd2),'messageSigningKeyCreation':(0x0,colors_1[_0x2b5968(0xd3)])(_0x2b5968(0xf4)),'messageSigningKeyNotFound':_0x163540=>{const _0x4c6d9c=_0x2b5968;return _0x4c6d9c(0xf1)+_0x163540+_0x4c6d9c(0xc7);},'promptCreateKey':_0x2b5968(0xc6),'promptKeyFullName':_0x2b5968(0xec),'promptKeyOrganizationalUnit':_0x2b5968(0xfe),'promptKeyOrganization':_0x2b5968(0xf2),'promptKeyCountry':_0x2b5968(0xe6),'promptKeystorePassword':'Password\x20for\x20the\x20Key\x20Store:','promptKeyPassword':_0x2b5968(0xfd),'messageBuildingApp':'\x0aBuilding\x20the\x20Android\x20App...','messageEnterPasswords':(_0x267e8f,_0x34bcfd)=>{const _0x82f42b=_0x2b5968;return _0x82f42b(0xf6)+(0x0,colors_1['cyan'])(_0x267e8f)+_0x82f42b(0xcf)+(0x0,colors_1[_0x82f42b(0xd8)])(_0x34bcfd)+'.\x0a';},'errorMinLength':(_0x38f5e5,_0x511353)=>{const _0x3e70fa=_0x2b5968;return _0x3e70fa(0xfb)+_0x38f5e5+_0x3e70fa(0x101)+_0x511353+'.';},'errorMaxLength':(_0x4ab8c4,_0x14cdec)=>{const _0x41a916=_0x2b5968;return _0x41a916(0xdf)+_0x4ab8c4+_0x41a916(0x101)+_0x14cdec+'.';},'errorInvalidInteger':_0x5e11dd=>{const _0x48b224=_0x2b5968;return _0x48b224(0xd1)+_0x5e11dd;},'messageApkSuccess':_0x3508b6=>{const _0x204861=_0x2b5968;return _0x204861(0xef)+(0x0,colors_1[_0x204861(0xd8)])(_0x3508b6);},'missingUrlToCheck':_0x2b5968(0xeb)+(''+(0x0,colors_1[_0x2b5968(0xd8)])(_0x2b5968(0xc3)))};
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';const _0x151f2e=_0x2348;function _0x2348(_0x5214ee,_0x21da61){const _0x28c4a1=_0x28c4();return _0x2348=function(_0x23481c,_0x5454f1){_0x23481c=_0x23481c-0x6f;let _0x17f5a7=_0x28c4a1[_0x23481c];return _0x17f5a7;},_0x2348(_0x5214ee,_0x21da61);}(function(_0x5d8026,_0x1ceccc){const _0x4e18e8=_0x2348,_0x31e4dc=_0x5d8026();while(!![]){try{const _0x5716d7=parseInt(_0x4e18e8(0x6f))/0x1+-parseInt(_0x4e18e8(0x7b))/0x2*(parseInt(_0x4e18e8(0x80))/0x3)+parseInt(_0x4e18e8(0x72))/0x4+parseInt(_0x4e18e8(0x7a))/0x5*(parseInt(_0x4e18e8(0x7c))/0x6)+-parseInt(_0x4e18e8(0x81))/0x7+-parseInt(_0x4e18e8(0x71))/0x8+parseInt(_0x4e18e8(0x7d))/0x9*(parseInt(_0x4e18e8(0x77))/0xa);if(_0x5716d7===_0x1ceccc)break;else _0x31e4dc['push'](_0x31e4dc['shift']());}catch(_0x399873){_0x31e4dc['push'](_0x31e4dc['shift']());}}}(_0x28c4,0x67523));function _0x28c4(){const _0x1b4790=['defineProperty','join','__esModule','4260jxwWIf','indexOf','webspatial-builder','5TXytWq','18686RAtcaO','4052364EALfav','234JUYQEO','./Log','pop','9iPPfIW','4484830RvsLGV','172001RNBlpl','ConsoleLog','108296GOYWsv','987952CFuzTW','CliLog'];_0x28c4=function(){return _0x1b4790;};return _0x28c4();}Object[_0x151f2e(0x74)](exports,_0x151f2e(0x76),{'value':!![]}),exports[_0x151f2e(0x73)]=void 0x0,exports['parseRouter']=parseRouter;const Log_1=require(_0x151f2e(0x7e));function parseRouter(_0x3e3f16){const _0x3a4b1b=_0x151f2e;let _0x5dd26d=_0x3e3f16['split']('/');_0x5dd26d[_0x3a4b1b(0x7f)]();let _0x26c243=_0x5dd26d[_0x3a4b1b(0x75)]();while(_0x26c243[_0x3a4b1b(0x78)](',')>=0x0){_0x26c243=_0x26c243['replace'](',','/');}return _0x26c243;}exports['CliLog']=new Log_1[(_0x151f2e(0x70))](_0x151f2e(0x79));
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';function _0x1569(){const _0x355a3b=['282280pqvIxd','583843qiMPTo','default','XcodeManager','./xcodebuild','846549MoDspU','path','80lnsiPm','/web-spatial.xcodeproj/project.pbxproj','10145KjpGIi','PROJECT_DIRECTORY','.ipa','defineProperty','join','30843790VxAylr','987312vPyguJ','./xcrun','9yzKOwx','uploadApp','parseProject','876211fqMMiR','log','../resource','archive','PROJECT_EXPORT_DIRECTORY','write\x20project.pbxproj:\x20ok','2172xCVMvp','runWithHistory','name','./xcodeproject'];_0x1569=function(){return _0x355a3b;};return _0x1569();}const _0x186f12=_0x4206;(function(_0x23bc37,_0x2b560a){const _0x448c2b=_0x4206,_0x3df371=_0x23bc37();while(!![]){try{const _0x1824f3=-parseInt(_0x448c2b(0x7d))/0x1+parseInt(_0x448c2b(0x8b))/0x2+-parseInt(_0x448c2b(0x81))/0x3+-parseInt(_0x448c2b(0x7c))/0x4+-parseInt(_0x448c2b(0x85))/0x5*(parseInt(_0x448c2b(0x96))/0x6)+parseInt(_0x448c2b(0x90))/0x7*(-parseInt(_0x448c2b(0x83))/0x8)+-parseInt(_0x448c2b(0x8d))/0x9*(-parseInt(_0x448c2b(0x8a))/0xa);if(_0x1824f3===_0x2b560a)break;else _0x3df371['push'](_0x3df371['shift']());}catch(_0x2565cb){_0x3df371['push'](_0x3df371['shift']());}}}(_0x1569,0x9ff6b));Object[_0x186f12(0x88)](exports,'__esModule',{'value':!![]}),exports['XcodeManager']=void 0x0;const resource_1=require(_0x186f12(0x92)),xcodeproject_1=require(_0x186f12(0x7b)),xcodebuild_1=require(_0x186f12(0x80)),xcrun_1=require(_0x186f12(0x8c)),path_1=require(_0x186f12(0x82));class XcodeManager{static async[_0x186f12(0x8f)](_0x19a54d,_0x109cb0=![]){const _0x1c2e95=_0x186f12,_0x4c361d=resource_1[_0x1c2e95(0x86)]+_0x1c2e95(0x84);await xcodeproject_1[_0x1c2e95(0x7e)]['modify'](_0x4c361d,_0x19a54d,_0x109cb0),console[_0x1c2e95(0x91)](_0x1c2e95(0x95));}static async['build'](_0x5c43e){const _0x148153=_0x186f12;await xcodebuild_1[_0x148153(0x7e)][_0x148153(0x93)](_0x5c43e);}static async['upload'](_0x5380bd,_0x38171f){const _0x44602d=_0x186f12;if(_0x5380bd['u']&&_0x5380bd['p'])xcrun_1[_0x44602d(0x7e)][_0x44602d(0x8e)]((0x0,path_1[_0x44602d(0x89)])(resource_1['PROJECT_EXPORT_DIRECTORY'],_0x38171f['name']+_0x44602d(0x87)),_0x5380bd['u'],_0x5380bd['p'],!![]);else _0x5380bd['k']&&_0x5380bd['i']&&xcrun_1[_0x44602d(0x7e)][_0x44602d(0x8e)]((0x0,path_1[_0x44602d(0x89)])(resource_1[_0x44602d(0x94)],_0x38171f[_0x44602d(0x7a)]+_0x44602d(0x87)),_0x5380bd['k'],_0x5380bd['i'],![]);}static async['runWithSimulator'](){const _0x4e46d3=_0x186f12;await xcrun_1[_0x4e46d3(0x7e)]['runWithSimulator']();}static async[_0x186f12(0x79)](){const _0x986cf9=_0x186f12;await xcrun_1['default'][_0x986cf9(0x79)]();}}function _0x4206(_0x10572c,_0x258eb2){const _0x15695f=_0x1569();return _0x4206=function(_0x4206bc,_0x420d95){_0x4206bc=_0x4206bc-0x79;let _0x3c1ad2=_0x15695f[_0x4206bc];return _0x3c1ad2;},_0x4206(_0x10572c,_0x258eb2);}exports[_0x186f12(0x7f)]=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 @@
1
- export declare const manifestSwiftTemplate = "\nimport Foundation\n\nvar pwaManager = PWAManager()\n\nstruct PWAManager: Codable {\n var isLocal: Bool = false\n var start_url: String = \"START_URL\"\n var scope: String = \"SCOPE\"\n var id: String = \"AppID\"\n\n var name: String = \"AppName\"\n var short_name: String = \"name\"\n var description: String = \"Description\"\n\n var display: PWADisplayMode = .minimal\n var display_override: [PWADisplayMode] = []\n var protocol_handlers: [PWAProtocol] = [PWAProtocol(protocolValue: \"\", url: \"\")]\n var mainScene: WindowContainerOptions = .init(\n defaultSize: .init(\n width: SceneWidth,\n height: SceneHeight\n ),\n resizability: SceneResizability\n )\n var useMainScene: Bool = USE_MAIN_SCENE\n\n mutating func _init() {\n let urlType = start_url.split(separator: \"://\").first\n if !(urlType == \"http\" || urlType == \"https\") {\n if scope == \"\" || scope == \"/\" {\n scope = \"./\"\n }\n let startUrl = Bundle.main.url(forResource: start_url, withExtension: \"\", subdirectory: \"\")\n start_url = startUrl!.absoluteString\n scope = URL(string: scope, relativeTo: startUrl)!.absoluteString\n isLocal = true\n }\n\n if display_override.count > 0 {\n display = display_override[0]\n }\n\n for i in 0 ... protocol_handlers.count - 1 {\n let item = protocol_handlers[i]\n protocol_handlers[i].updateUrl(scope + item.url)\n }\n }\n\n func checkInScope(url: String) -> Bool {\n return url.starts(with: scope)\n }\n\n // web+spatial://test\n func checkInDeeplink(url: String) -> String {\n var linkUrl: String = url\n for item in protocol_handlers {\n if linkUrl.starts(with: item.protocolValue) {\n let queryString: String = linkUrl.replacingOccurrences(of: item.protocolValue, with: \"\").addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!\n linkUrl = item.url.replacingOccurrences(of: \"%s\", with: item.protocolValue + queryString)\n }\n }\n logger.debug(linkUrl)\n return linkUrl\n }\n\n func getLocalResourceURL(url: String) -> String {\n let path = String(url.split(separator: \"file://\").first!.split(separator: \"?\").first!)\n let newUrl = URL(string: url)\n let fileManager = FileManager.default\n if fileManager.fileExists(atPath: newUrl!.path) {\n return url\n }\n var resource: String = Bundle.main.url(forResource: newUrl?.path, withExtension: \"\", subdirectory: \"\")?.absoluteString ?? \"\"\n if resource == \"\" {\n resource = Bundle.main.url(forResource: \"static-web\" + path, withExtension: \"\", subdirectory: \"\")?.absoluteString ?? \"\"\n }\n if resource == \"\" {\n return url\n }\n if newUrl?.query() != nil {\n resource += \"?\" + (newUrl?.query())!\n }\n if newUrl?.fragment() != nil {\n resource += \"#\" + (newUrl?.fragment())!\n }\n return resource\n }\n}\n\nenum PWADisplayMode: Codable {\n case minimal\n case standalone\n case fullscreen\n}\n\nstruct PWAProtocol: Codable {\n var protocolValue: String = \"\"\n var url: String = \"\"\n\n mutating func updateUrl(_ str: String) {\n url = str\n }\n}\n\n";
1
+ export declare const manifestSwiftTemplate = "\nimport Foundation\n\nvar pwaManager = PWAManager()\n\nstruct PWAManager: Codable {\n var isLocal: Bool = false\n var start_url: String = \"START_URL\"\n var scope: String = \"SCOPE\"\n var id: String = \"AppID\"\n\n var name: String = \"AppName\"\n var short_name: String = \"name\"\n var description: String = \"Description\"\n\n var display: PWADisplayMode = .minimal\n var display_override: [PWADisplayMode] = []\n var protocol_handlers: [PWAProtocol] = [PWAProtocol(protocolValue: \"\", url: \"\")]\n var mainScene: WindowContainerOptions = .init(\n defaultSize: .init(\n width: SceneWidth,\n height: SceneHeight\n ),\n resizability: SceneResizability\n )\n var useMainScene: Bool = USE_MAIN_SCENE\n\n mutating func _init() {\n let urlType = start_url.split(separator: \"://\").first\n if !(urlType == \"http\" || urlType == \"https\") {\n if scope == \"\" || scope == \"/\" {\n scope = \"./\"\n }\n let startUrl = Bundle.main.url(forResource: start_url, withExtension: \"\", subdirectory: \"\")\n start_url = startUrl!.absoluteString\n scope = URL(string: (scope.starts(with: \"/\") ? \"..\" : \"../\") + scope, relativeTo: startUrl)!.absoluteString\n isLocal = true\n }\n\n if display_override.count > 0 {\n display = display_override[0]\n }\n\n for i in 0 ... protocol_handlers.count - 1 {\n let item = protocol_handlers[i]\n protocol_handlers[i].updateUrl(scope + item.url)\n }\n }\n\n func checkInScope(url: String) -> Bool {\n return url.starts(with: scope)\n }\n\n // web+spatial://test\n func checkInDeeplink(url: String) -> String {\n var linkUrl: String = url\n for item in protocol_handlers {\n if linkUrl.starts(with: item.protocolValue) {\n let queryString: String = linkUrl.replacingOccurrences(of: item.protocolValue, with: \"\").addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!\n linkUrl = item.url.replacingOccurrences(of: \"%s\", with: item.protocolValue + queryString)\n }\n }\n logger.debug(linkUrl)\n return linkUrl\n }\n\n func getLocalResourceURL(url: String) -> String {\n let path = String(url.split(separator: \"file://\").first!.split(separator: \"?\").first!)\n let newUrl = URL(string: url)\n let fileManager = FileManager.default\n if fileManager.fileExists(atPath: newUrl!.path) {\n return url\n }\n var resource: String = Bundle.main.url(forResource: newUrl?.path, withExtension: \"\", subdirectory: \"\")?.absoluteString ?? \"\"\n if resource == \"\" {\n resource = Bundle.main.url(forResource: \"static-web\" + path, withExtension: \"\", subdirectory: \"\")?.absoluteString ?? \"\"\n }\n if resource == \"\" {\n return url\n }\n if newUrl?.query() != nil {\n resource += \"?\" + (newUrl?.query())!\n }\n if newUrl?.fragment() != nil {\n resource += \"#\" + (newUrl?.fragment())!\n }\n return resource\n }\n}\n\nenum PWADisplayMode: Codable {\n case minimal\n case standalone\n case fullscreen\n}\n\nstruct PWAProtocol: Codable {\n var protocolValue: String = \"\"\n var url: String = \"\"\n\n mutating func updateUrl(_ str: String) {\n url = str\n }\n}\n\n";
@@ -1 +1,109 @@
1
- 'use strict';var _0xb4672f=_0x4ea5;(function(_0x161de1,_0x333680){var _0x59c8dd=_0x4ea5,_0x2b9885=_0x161de1();while(!![]){try{var _0x47e3de=-parseInt(_0x59c8dd(0x15d))/0x1+parseInt(_0x59c8dd(0x15c))/0x2+parseInt(_0x59c8dd(0x162))/0x3*(parseInt(_0x59c8dd(0x159))/0x4)+parseInt(_0x59c8dd(0x15a))/0x5*(-parseInt(_0x59c8dd(0x15e))/0x6)+-parseInt(_0x59c8dd(0x161))/0x7+parseInt(_0x59c8dd(0x15b))/0x8+parseInt(_0x59c8dd(0x158))/0x9;if(_0x47e3de===_0x333680)break;else _0x2b9885['push'](_0x2b9885['shift']());}catch(_0x4114d2){_0x2b9885['push'](_0x2b9885['shift']());}}}(_0x51a0,0x4d785));function _0x4ea5(_0x2e557d,_0x388c14){var _0x51a009=_0x51a0();return _0x4ea5=function(_0x4ea522,_0x412c95){_0x4ea522=_0x4ea522-0x158;var _0x56e6f5=_0x51a009[_0x4ea522];return _0x56e6f5;},_0x4ea5(_0x2e557d,_0x388c14);}function _0x51a0(){var _0x187bdb=['1133248jALXnr','24006HdIBHh','6qcTJOQ','__esModule','manifestSwiftTemplate','2162342tfyYwQ','387PUbTZT','\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','3942756WUEwEl','1612XlmkxW','3172595fHgprN','1824424FfKrdT'];_0x51a0=function(){return _0x187bdb;};return _0x51a0();}Object['defineProperty'](exports,_0xb4672f(0x15f),{'value':!![]}),exports[_0xb4672f(0x160)]=void 0x0,exports[_0xb4672f(0x160)]=_0xb4672f(0x163);
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.starts(with: "/") ? ".." : "../") + 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 _0x5e929c=_0x3313;(function(_0x27d84c,_0x1959f7){const _0x3830f0=_0x3313,_0xf02fc1=_0x27d84c();while(!![]){try{const _0x527a36=-parseInt(_0x3830f0(0x111))/0x1+parseInt(_0x3830f0(0x110))/0x2+-parseInt(_0x3830f0(0x105))/0x3*(parseInt(_0x3830f0(0xed))/0x4)+-parseInt(_0x3830f0(0x101))/0x5+parseInt(_0x3830f0(0xf1))/0x6+parseInt(_0x3830f0(0xe5))/0x7+parseInt(_0x3830f0(0x108))/0x8*(parseInt(_0x3830f0(0xfa))/0x9);if(_0x527a36===_0x1959f7)break;else _0xf02fc1['push'](_0xf02fc1['shift']());}catch(_0x35f062){_0xf02fc1['push'](_0xf02fc1['shift']());}}}(_0x38c6,0xbc075));function _0x3313(_0x548025,_0x2792c1){const _0x38c600=_0x38c6();return _0x3313=function(_0x331378,_0x231f02){_0x331378=_0x331378-0xe5;let _0x48c1f5=_0x38c600[_0x331378];return _0x48c1f5;},_0x3313(_0x548025,_0x2792c1);}function _0x38c6(){const _0x41d25b=['66670nwiHwp','\x20-exportArchive\x20-archivePath\x20','default','copyDir','651Ttieth','log','clean','39048oCdemL','XcodebuildCMD','__esModule','toString','join','ARCHIVE\x20SUCCEEDED','../resource','../resource/file','8348aCPQwv','441403Jfwvua','start\x20export','defineProperty','./pack','\x20-exportOptionsPlist\x20','\x20-exportPath\x20','-------------------\x20ARCHIVE\x20SUCCEEDED\x20-------------------','2429637KGxMOe','output','web-spatial','scheme','PROJECT_DIRECTORY','existsSync','indexOf','line','28244petoPV','archive','\x20-list','PROJECT_EXPORT_DIRECTORY','8958762udxGGf','project','path','./build','\x20archive','\x20-archivePath\x20','ExportOptions.plist','mkdirSync','start\x20archive','1683XOxlKl','pack.xcarchive','list','\x20-project\x20','PROJECT_BUILD_DIRECTORY','/web-spatial.xcodeproj','\x20-allowProvisioningUpdates'];_0x38c6=function(){return _0x41d25b;};return _0x38c6();}Object[_0x5e929c(0x113)](exports,_0x5e929c(0x10a),{'value':!![]}),exports[_0x5e929c(0x109)]=void 0x0;const fs=require('fs'),path_1=require(_0x5e929c(0xf3)),resource_1=require(_0x5e929c(0x10e)),semver_1=require('semver'),file_1=require(_0x5e929c(0x10f)),{execSync,exec}=require('child_process');class Xcodebuild{static async['project'](){const _0x3ee6e5=_0x5e929c;try{await new Promise((_0x1944a5,_0x1f841c)=>{const _0x4f3c45=_0x3313,_0x88254a=resource_1[_0x4f3c45(0xe9)]+_0x4f3c45(0xff),_0x52a075=execSync(new XcodebuildCMD()[_0x4f3c45(0xf2)](_0x88254a)[_0x4f3c45(0xfc)]()['line']);console[_0x4f3c45(0x106)](_0x52a075['toString']()),_0x1944a5(_0x52a075);});}catch(_0xe741fe){console[_0x3ee6e5(0x106)](_0xe741fe);}}static async['list'](){try{await new Promise((_0x138d11,_0xd91a32)=>{const _0x19da9e=_0x3313,_0x172978=resource_1[_0x19da9e(0xe9)]+'/web-spatial.xcodeproj',_0x2e9d95=execSync(new XcodebuildCMD()[_0x19da9e(0xf2)](_0x172978)[_0x19da9e(0xfc)]()[_0x19da9e(0xec)]);console[_0x19da9e(0x106)](_0x2e9d95[_0x19da9e(0x10b)]()),_0x138d11(_0x2e9d95);});}catch(_0x22c2b7){console['log'](_0x22c2b7);}}static async['archive'](_0x3560ec){const _0x24aeb3=_0x5e929c;try{return console[_0x24aeb3(0x106)](_0x24aeb3(0xf9)),!fs[_0x24aeb3(0xea)](resource_1[_0x24aeb3(0xf0)])&&fs['mkdirSync'](resource_1[_0x24aeb3(0xf0)],{'recursive':!![]}),await new Promise((_0x217c78,_0x49aec3)=>{const _0x1bd5bc=_0x24aeb3,_0x35e7d9=resource_1[_0x1bd5bc(0xe9)]+_0x1bd5bc(0xff),_0x49a56a=execSync(new XcodebuildCMD()['project'](_0x35e7d9)[_0x1bd5bc(0xe8)](_0x1bd5bc(0xe7))[_0x1bd5bc(0xee)]((0x0,path_1[_0x1bd5bc(0x10c)])(resource_1['PROJECT_BUILD_DIRECTORY'],_0x1bd5bc(0x114)))[_0x1bd5bc(0x107)]()[_0x1bd5bc(0xec)]);let _0x295f2d=_0x49a56a[_0x1bd5bc(0x10b)]();if(_0x295f2d['indexOf'](_0x1bd5bc(0x10d))>0x0){console[_0x1bd5bc(0x106)](_0x1bd5bc(0x117)),console[_0x1bd5bc(0x106)](_0x1bd5bc(0x112));const _0x3ed2b4=execSync(new XcodebuildCMD()[_0x1bd5bc(0xe6)]((0x0,path_1[_0x1bd5bc(0x10c)])(resource_1[_0x1bd5bc(0xfe)],_0x1bd5bc(0xfb)),resource_1[_0x1bd5bc(0xf0)],(0x0,path_1[_0x1bd5bc(0x10c)])(resource_1['PROJECT_BUILD_DIRECTORY'],_0x1bd5bc(0xf7)))['allowProvisioningUpdates']()[_0x1bd5bc(0xec)]);_0x295f2d=_0x3ed2b4[_0x1bd5bc(0x10b)]();if(_0x295f2d[_0x1bd5bc(0xeb)]('EXPORT\x20SUCCEEDED')>0x0){const _0x360993=_0x3560ec!==null&&_0x3560ec!==void 0x0?_0x3560ec:_0x1bd5bc(0xf4),_0x2289a1=(0x0,path_1[_0x1bd5bc(0x10c)])(process['cwd'](),_0x360993);!fs[_0x1bd5bc(0xea)](_0x2289a1)&&fs[_0x1bd5bc(0xf8)](_0x2289a1,{'recursive':!![]}),(0x0,file_1[_0x1bd5bc(0x104)])(resource_1['PROJECT_EXPORT_DIRECTORY'],_0x2289a1),console[_0x1bd5bc(0x106)]('-------------------\x20EXPORT\x20SUCCEEDED\x20-------------------'),_0x217c78(!![]);}(0x0,semver_1[_0x1bd5bc(0x107)])(resource_1['PROJECT_BUILD_DIRECTORY']);}_0x217c78(![]);});}catch(_0x5d97){console[_0x24aeb3(0x106)](_0x5d97);}}}exports[_0x5e929c(0x103)]=Xcodebuild;class XcodebuildCMD{constructor(){const _0xd360f1=_0x5e929c;this[_0xd360f1(0xec)]='xcodebuild';}[_0x5e929c(0xf2)](_0x16f5b7){const _0x1e1c23=_0x5e929c;return this[_0x1e1c23(0xec)]+=_0x1e1c23(0xfd)+_0x16f5b7,this;}[_0x5e929c(0xfc)](){const _0x13fff7=_0x5e929c;return this['line']+=_0x13fff7(0xef),this;}['scheme'](_0x1ca750){const _0x57d7d9=_0x5e929c;return this[_0x57d7d9(0xec)]+='\x20-scheme\x20'+_0x1ca750,this;}[_0x5e929c(0xee)](_0x3d64da){const _0x5c769b=_0x5e929c;return this[_0x5c769b(0xec)]+=_0x5c769b(0xf6)+_0x3d64da+_0x5c769b(0xf5),this;}['allowProvisioningUpdates'](){const _0x1dd063=_0x5e929c;return this[_0x1dd063(0xec)]+=_0x1dd063(0x100),this;}['destination'](_0x5c6f0b){return this['line']+='\x20-destination\x20\x27'+_0x5c6f0b+'\x27',this;}[_0x5e929c(0xe6)](_0x36bbb8,_0x2b4963,_0x17e563){const _0x228848=_0x5e929c;return this[_0x228848(0xec)]+=_0x228848(0x102)+_0x36bbb8+_0x228848(0x116)+_0x2b4963+_0x228848(0x115)+_0x17e563,this;}['clean'](){const _0x57059c=_0x5e929c;return this[_0x57059c(0xec)]+='\x20clean',this;}}exports[_0x5e929c(0x109)]=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;