@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,239 @@
1
- 'use strict';function _0x1916(_0x18a5eb,_0x5e069c){const _0x198373=_0x1983();return _0x1916=function(_0x19167a,_0x400c65){_0x19167a=_0x19167a-0x10f;let _0x10d710=_0x198373[_0x19167a];return _0x10d710;},_0x1916(_0x18a5eb,_0x5e069c);}const _0x4ef98a=_0x1916;(function(_0x2d0c03,_0x421f5c){const _0x50de9f=_0x1916,_0x2aa97a=_0x2d0c03();while(!![]){try{const _0x4a792d=parseInt(_0x50de9f(0x13f))/0x1*(-parseInt(_0x50de9f(0x173))/0x2)+-parseInt(_0x50de9f(0x110))/0x3+parseInt(_0x50de9f(0x179))/0x4+-parseInt(_0x50de9f(0x153))/0x5*(parseInt(_0x50de9f(0x146))/0x6)+-parseInt(_0x50de9f(0x160))/0x7*(parseInt(_0x50de9f(0x13a))/0x8)+parseInt(_0x50de9f(0x158))/0x9+parseInt(_0x50de9f(0x119))/0xa;if(_0x4a792d===_0x421f5c)break;else _0x2aa97a['push'](_0x2aa97a['shift']());}catch(_0x528321){_0x2aa97a['push'](_0x2aa97a['shift']());}}}(_0x1983,0xd63a5));function _0x1983(){const _0x295b9b=['14mWTNSz','\x22,\x20url:\x20\x22','default','mainScene','../resource/load','split','updateBuildProperty','height','bindIcon','../resource','release-testing','MIDDLE_APPICON_DIRECTORY','PRODUCT_BUNDLE_IDENTIFIER','display','fixProjectFunction','version','SceneWidth','description','updateProductName','321228uRbUXq','minimal-ui','modify','PROJECT_BUILD_DIRECTORY','test','false','2403464tkUFAu','value','images','protocol_handlers','Description','loadJsonFromDisk','PROJECT_DIRECTORY','3709125aaawCC','image/','Contents.json','writeAsync','name','DEEPLINK','icon.','SceneHeight','app-store-connect','24412280bnwVQa','updateVersion','manifestSwiftTemplate','buildConfigurations','join','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<!DOCTYPE\x20plist\x20PUBLIC\x20\x22-//Apple//DTD\x20PLIST\x201.0//EN\x22\x20\x22http://www.apple.com/DTDs/PropertyList-1.0.dtd\x22>\x0a<plist\x20version=\x221.0\x22>\x0a<dict>\x0a\x09<key>destination</key>\x0a\x09<string>export</string>\x0a\x09<key>method</key>\x0a\x09<string>BUILDTYPE</string>\x0a\x09<key>signingStyle</key>\x0a\x09<string>automatic</string>\x0a\x09<key>stripSwiftSymbols</key>\x0a\x09<true/>\x0a\x09<key>teamID</key>\x0a\x09<string>YOURTEAMID</string>\x0a\x09<key>thinning</key>\x0a\x09<string>&lt;none&gt;</string>\x0a</dict>\x0a</plist>','createImg','getMIME','debugging','./manifestSwiftTemplate','replace','path','pbxGroupByName','buildType','updateDeeplink','writeFileSync','stringify','pbxXCConfigurationList','../resource/imageHelper','width','1280','__esModule','project','./web-spatial/Info.plist','modifySwift','icon.png','true','updateExportOptions','ExportOptions.plist','BACK_APPICON_DIRECTORY','start_url','objects','\x22automatic\x22','1711664TUGoDe','.minimal','defaultSize','filename','PWAProtocol(protocolValue:\x20\x22\x22,\x20url:\x20\x22\x22)','1mXhhIE','ImageHelper','defineProperty','teamId','protocol','hash','enterprise','4092qFpuOD','DEVELOPMENT_TEAM','USE_MAIN_SCENE','BUILDTYPE','CURRENT_PROJECT_VERSION','SCOPE','1.0','scope','START_URL','existsSync','SceneResizability','AppName','updateTeamId','2955iFMAEB','\x22),','manifestInfo','YOURTEAMID','</string>','570150mZpbiR','xcode','mkdirSync','length','PBXGroup','buildSettings','includes','parseSync'];_0x1983=function(){return _0x295b9b;};return _0x1983();}Object[_0x4ef98a(0x141)](exports,_0x4ef98a(0x12e),{'value':!![]});const fs=require('fs'),resource_1=require(_0x4ef98a(0x169)),path_1=require(_0x4ef98a(0x124)),load_1=require(_0x4ef98a(0x164)),imageHelper_1=require(_0x4ef98a(0x12b)),manifestSwiftTemplate_1=require(_0x4ef98a(0x122)),xcode=require(_0x4ef98a(0x159)),exportOptionsXML=_0x4ef98a(0x11e),infoPlistXML='<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<!DOCTYPE\x20plist\x20PUBLIC\x20\x22-//Apple//DTD\x20PLIST\x201.0//EN\x22\x20\x22http://www.apple.com/DTDs/PropertyList-1.0.dtd\x22>\x0a<plist\x20version=\x221.0\x22>\x0a<dict>\x0a\x09<key>ITSAppUsesNonExemptEncryption</key>\x0a\x09<false/>\x0a\x09<key>CFBundleURLTypes</key>\x0a\x09<array>\x0a\x09\x09<dict>\x0a\x09\x09\x09<key>CFBundleURLName</key>\x0a\x09\x09\x09<string>web-spatial</string>\x0a\x09\x09\x09<key>CFBundleURLSchemes</key>\x0a\x09\x09\x09<array>\x0a\x09\x09\x09\x09DEEPLINK\x0a\x09\x09\x09</array>\x0a\x09\x09</dict>\x0a\x09</array>\x0a\x09<key>NSAppTransportSecurity</key>\x0a\x09<dict>\x0a\x09\x09<key>NSAllowsArbitraryLoads</key>\x0a\x09\x09<true/>\x0a\x09</dict>\x0a\x09<key>UIApplicationSceneManifest</key>\x0a\x09<dict>\x0a\x09\x09<key>UIApplicationPreferredDefaultSceneSessionRole</key>\x0a\x09\x09<string>UIWindowSceneSessionRoleApplication</string>\x0a\x09\x09<key>UIApplicationSupportsMultipleScenes</key>\x0a\x09\x09<true/>\x0a\x09\x09<key>UISceneConfigurations</key>\x0a\x09\x09<dict/>\x0a\x09</dict>\x0a</dict>\x0a</plist>\x0a';let useExportOptionsXML='';class XcodeProject{static async[_0x4ef98a(0x175)](_0x4b009c,_0x186d09,_0x35f587=![]){const _0xe98e72=_0x4ef98a;let _0x3c6cb3=xcode[_0xe98e72(0x12f)](_0x4b009c);this[_0xe98e72(0x16e)](_0x3c6cb3),_0x3c6cb3[_0xe98e72(0x15f)]();let _0x34227f=_0x186d09[_0xe98e72(0x126)];const _0x54f1da=[_0xe98e72(0x16a),_0xe98e72(0x118),_0xe98e72(0x121),_0xe98e72(0x145)];useExportOptionsXML=exportOptionsXML['replace'](_0xe98e72(0x149),_0x54f1da[_0xe98e72(0x15e)](_0x34227f)?_0x34227f:_0xe98e72(0x16a));_0x186d09[_0xe98e72(0x142)]&&this[_0xe98e72(0x152)](_0x3c6cb3,_0x186d09[_0xe98e72(0x142)]);this[_0xe98e72(0x134)]();if(_0x186d09['icon'])await this[_0xe98e72(0x168)](_0x186d09['icon']);this['bindManifestInfo'](_0x3c6cb3,_0x186d09[_0xe98e72(0x155)]['json'],_0x35f587);_0x186d09[_0xe98e72(0x16f)]?this[_0xe98e72(0x11a)](_0x3c6cb3,_0x186d09[_0xe98e72(0x16f)]):this[_0xe98e72(0x11a)](_0x3c6cb3,_0xe98e72(0x14c));try{fs[_0xe98e72(0x128)](_0x4b009c,_0x3c6cb3['writeSync']());}catch(_0x1b847f){console['log'](_0x1b847f);}}static[_0x4ef98a(0x16e)](_0xd1f8df){const _0x578029=_0x4ef98a;_0xd1f8df[_0x578029(0x125)]=function(_0x2066da){const _0x4c0bd5=_0x578029;var _0x3d5d19=this[_0x4c0bd5(0x144)][_0x4c0bd5(0x12f)][_0x4c0bd5(0x138)][_0x4c0bd5(0x15c)],_0x89bcab,_0x5073d7;for(_0x89bcab in _0x3d5d19){if(!/_comment$/[_0x4c0bd5(0x177)](_0x89bcab))continue;if(_0x3d5d19[_0x89bcab]==_0x2066da)return _0x5073d7=_0x89bcab[_0x4c0bd5(0x165)](/_comment$/)[0x0],_0x3d5d19[_0x5073d7];}return![];},_0xd1f8df['updateBuildProperty']=function(_0x1be9d9,_0x2f54c0,_0x1499b9,_0x2a6c87){const _0x32cf7b=_0x578029;let _0x49362c=[];const _0x42a34e=/_comment$/;if(_0x2a6c87){const _0x11b991=this['pbxTargetByName'](_0x2a6c87),_0x4eae1d=_0x11b991&&_0x11b991['buildConfigurationList'],_0x364303=this[_0x32cf7b(0x12a)]();for(const _0x26b091 in _0x364303){if(!_0x42a34e['test'](_0x26b091)&&_0x4eae1d===_0x26b091){const _0x4fe99d=_0x364303[_0x26b091][_0x32cf7b(0x11c)];for(const _0x43d9 of _0x4fe99d){_0x49362c['push'](_0x43d9[_0x32cf7b(0x17a)]);}break;}}}var _0x186539=this['pbxXCBuildConfigurationSection']();for(var _0x1dbe43 in _0x186539){if(!_0x42a34e[_0x32cf7b(0x177)](_0x1dbe43)){if(_0x2a6c87&&!_0x49362c[_0x32cf7b(0x15e)](_0x1dbe43))continue;var _0x49e4e5=_0x186539[_0x1dbe43];(_0x1499b9&&_0x49e4e5[_0x32cf7b(0x114)]===_0x1499b9||!_0x1499b9)&&_0x49e4e5[_0x32cf7b(0x15d)][_0x1be9d9]&&(_0x49e4e5[_0x32cf7b(0x15d)][_0x1be9d9]=_0x2f54c0);}}};}static async[_0x4ef98a(0x168)](_0x2bd54c){const _0x4b632d=_0x4ef98a;if(_0x2bd54c){const _0xa8621c=(0x0,path_1[_0x4b632d(0x11d)])(resource_1[_0x4b632d(0x10f)],resource_1[_0x4b632d(0x136)]),_0x3b3472=(0x0,path_1[_0x4b632d(0x11d)])(_0xa8621c,_0x4b632d(0x112)),_0xcac5d7=_0x4b632d(0x116)+_0x2bd54c[_0x4b632d(0x120)]()[_0x4b632d(0x123)](_0x4b632d(0x111),''),_0x3afe0e=(0x0,path_1[_0x4b632d(0x11d)])(_0xa8621c,_0xcac5d7);let _0x4e0b6e=await(0x0,load_1[_0x4b632d(0x17e)])(_0x3b3472);_0x4e0b6e[_0x4b632d(0x17b)][0x0]['filename']=_0xcac5d7,await _0x2bd54c['writeAsync'](_0x3afe0e),await fs[_0x4b632d(0x128)](_0x3b3472,JSON[_0x4b632d(0x129)](_0x4e0b6e));const _0x1d0f95=(0x0,path_1[_0x4b632d(0x11d)])(resource_1[_0x4b632d(0x10f)],resource_1[_0x4b632d(0x16b)]),_0x4704e6=(0x0,path_1[_0x4b632d(0x11d)])(_0x1d0f95,_0x4b632d(0x112)),_0x727afe=_0x4b632d(0x132),_0x13c5f0=(0x0,path_1['join'])(_0x1d0f95,_0x727afe);let _0xd9613a=await(0x0,load_1[_0x4b632d(0x17e)])(_0x4704e6),_0x425ab0=imageHelper_1[_0x4b632d(0x140)][_0x4b632d(0x11f)](0x200);_0xd9613a[_0x4b632d(0x17b)][0x0][_0x4b632d(0x13d)]=_0x727afe,await _0x425ab0[_0x4b632d(0x113)](_0x13c5f0),await fs[_0x4b632d(0x128)](_0x4704e6,JSON[_0x4b632d(0x129)](_0xd9613a));}}static['updateTeamId'](_0x475fe2,_0x45ebeb){const _0x6cd130=_0x4ef98a;_0x475fe2['updateBuildProperty'](_0x6cd130(0x147),_0x45ebeb),useExportOptionsXML=useExportOptionsXML[_0x6cd130(0x123)](_0x6cd130(0x156),_0x45ebeb);}static[_0x4ef98a(0x134)](){const _0x38cc09=_0x4ef98a;!fs[_0x38cc09(0x14f)](resource_1[_0x38cc09(0x176)])&&fs[_0x38cc09(0x15a)](resource_1[_0x38cc09(0x176)],{'recursive':!![]}),fs[_0x38cc09(0x128)]((0x0,path_1[_0x38cc09(0x11d)])(resource_1[_0x38cc09(0x176)],_0x38cc09(0x135)),useExportOptionsXML);}static['bindManifestInfo'](_0x172af3,_0x5dfb8f,_0x4c562e=![]){const _0x26c333=_0x4ef98a;var _0x4c73bd;_0x172af3[_0x26c333(0x172)](_0x5dfb8f[_0x26c333(0x114)]),_0x5dfb8f['id']&&!_0x4c562e&&_0x172af3[_0x26c333(0x166)](_0x26c333(0x16c),'\x22'+_0x5dfb8f['id']+'\x22'),this[_0x26c333(0x127)]((_0x4c73bd=_0x5dfb8f[_0x26c333(0x17c)])!==null&&_0x4c73bd!==void 0x0?_0x4c73bd:[]),this[_0x26c333(0x131)](_0x5dfb8f);}static['updateVersion'](_0x3b4beb,_0x53e4f9){const _0x3d8adb=_0x4ef98a;_0x3b4beb['updateBuildProperty'](_0x3d8adb(0x14a),_0x53e4f9);}static['updateDeeplink'](_0x144c3c){const _0x2c3e78=_0x4ef98a;let _0x3b21b7=(0x0,path_1['join'])(resource_1['PROJECT_DIRECTORY'],_0x2c3e78(0x130)),_0x3e8ad5='';for(let _0x10b713=0x0;_0x10b713<_0x144c3c[_0x2c3e78(0x15b)];_0x10b713++){_0x3e8ad5+='<string>'+_0x144c3c[_0x10b713][_0x2c3e78(0x143)]+_0x2c3e78(0x157);}const _0x45ccb5=infoPlistXML[_0x2c3e78(0x123)](_0x2c3e78(0x115),_0x3e8ad5);fs['writeFileSync'](_0x3b21b7,_0x45ccb5);}static[_0x4ef98a(0x131)](_0xbe4613){const _0x85c92f=_0x4ef98a,_0x189e2a=(0x0,path_1['join'])(resource_1[_0x85c92f(0x10f)],'./web-spatial/libs/webView/manifest.swift');let _0x37354a=manifestSwiftTemplate_1[_0x85c92f(0x11b)];_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x14e),_0xbe4613[_0x85c92f(0x137)]),_0x37354a=_0x37354a['replace'](_0x85c92f(0x14b),_0xbe4613[_0x85c92f(0x14d)]),_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x151),_0xbe4613[_0x85c92f(0x114)]),_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x17d),_0xbe4613[_0x85c92f(0x171)]),_0x37354a=_0x37354a[_0x85c92f(0x123)]('AppID',_0xbe4613['id']),_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x13b),_0xbe4613[_0x85c92f(0x16d)]==_0x85c92f(0x174)?_0x85c92f(0x13b):'.'+_0xbe4613[_0x85c92f(0x16d)]);if(_0xbe4613['protocol_handlers']){let _0x1a580d='';for(let _0xd1d6b8=0x0;_0xd1d6b8<_0xbe4613[_0x85c92f(0x17c)]['length'];_0xd1d6b8++){_0x1a580d+='PWAProtocol(protocolValue:\x20\x22'+_0xbe4613[_0x85c92f(0x17c)][_0xd1d6b8][_0x85c92f(0x143)]+_0x85c92f(0x161)+_0xbe4613['protocol_handlers'][_0xd1d6b8]['url']+_0x85c92f(0x154);}_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x13e),_0x1a580d);}typeof _0xbe4613['mainScene']==='object'?(_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x170),_0xbe4613[_0x85c92f(0x163)]['defaultSize'][_0x85c92f(0x12c)]),_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x117),_0xbe4613[_0x85c92f(0x163)][_0x85c92f(0x13c)][_0x85c92f(0x167)]),_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x150),'\x22'+_0xbe4613['mainScene']['resizability']+'\x22'),_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x148),_0x85c92f(0x133))):(_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x170),_0x85c92f(0x12d)),_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x117),'1280'),_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x150),_0x85c92f(0x139)),_0x37354a=_0x37354a[_0x85c92f(0x123)](_0x85c92f(0x148),_0x85c92f(0x178))),fs[_0x85c92f(0x128)](_0x189e2a,_0x37354a,'utf-8');}}exports[_0x4ef98a(0x162)]=XcodeProject;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fs = require("fs");
4
+ const resource_1 = require("../resource");
5
+ const path_1 = require("path");
6
+ const load_1 = require("../resource/load");
7
+ const imageHelper_1 = require("../resource/imageHelper");
8
+ const manifestSwiftTemplate_1 = require("./manifestSwiftTemplate");
9
+ const xcode = require('xcode');
10
+ const exportOptionsXML = `<?xml version="1.0" encoding="UTF-8"?>
11
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
12
+ <plist version="1.0">
13
+ <dict>
14
+ <key>destination</key>
15
+ <string>export</string>
16
+ <key>method</key>
17
+ <string>BUILDTYPE</string>
18
+ <key>signingStyle</key>
19
+ <string>automatic</string>
20
+ <key>stripSwiftSymbols</key>
21
+ <true/>
22
+ <key>teamID</key>
23
+ <string>YOURTEAMID</string>
24
+ <key>thinning</key>
25
+ <string>&lt;none&gt;</string>
26
+ </dict>
27
+ </plist>`;
28
+ const infoPlistXML = `<?xml version="1.0" encoding="UTF-8"?>
29
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
30
+ <plist version="1.0">
31
+ <dict>
32
+ <key>ITSAppUsesNonExemptEncryption</key>
33
+ <false/>
34
+ <key>CFBundleURLTypes</key>
35
+ <array>
36
+ <dict>
37
+ <key>CFBundleURLName</key>
38
+ <string>web-spatial</string>
39
+ <key>CFBundleURLSchemes</key>
40
+ <array>
41
+ DEEPLINK
42
+ </array>
43
+ </dict>
44
+ </array>
45
+ <key>NSAppTransportSecurity</key>
46
+ <dict>
47
+ <key>NSAllowsArbitraryLoads</key>
48
+ <true/>
49
+ </dict>
50
+ <key>UIApplicationSceneManifest</key>
51
+ <dict>
52
+ <key>UIApplicationPreferredDefaultSceneSessionRole</key>
53
+ <string>UIWindowSceneSessionRoleApplication</string>
54
+ <key>UIApplicationSupportsMultipleScenes</key>
55
+ <true/>
56
+ <key>UISceneConfigurations</key>
57
+ <dict/>
58
+ </dict>
59
+ </dict>
60
+ </plist>
61
+ `;
62
+ let useExportOptionsXML = '';
63
+ class XcodeProject {
64
+ static async modify(projectPath, option, isDev = false) {
65
+ let project = xcode.project(projectPath);
66
+ this.fixProjectFunction(project);
67
+ project.parseSync();
68
+ let buildType = option['buildType'];
69
+ const buildTypeOptions = [
70
+ 'release-testing',
71
+ 'app-store-connect',
72
+ 'debugging',
73
+ 'enterprise',
74
+ ];
75
+ useExportOptionsXML = exportOptionsXML.replace('BUILDTYPE', buildTypeOptions.includes(buildType) ? buildType : 'release-testing');
76
+ if (option['teamId']) {
77
+ this.updateTeamId(project, option['teamId']);
78
+ }
79
+ this.updateExportOptions();
80
+ if (option.icon)
81
+ await this.bindIcon(option.icon);
82
+ this.bindManifestInfo(project, option.manifestInfo.json, isDev);
83
+ if (option['version']) {
84
+ this.updateVersion(project, option['version']);
85
+ }
86
+ else {
87
+ this.updateVersion(project, '1.0');
88
+ }
89
+ try {
90
+ fs.writeFileSync(projectPath, project.writeSync());
91
+ }
92
+ catch (error) {
93
+ console.log(error);
94
+ }
95
+ }
96
+ static fixProjectFunction(project) {
97
+ // The original pbxGroupByName method has a bug where the return is null, causing other methods to call. xx directly and report an error
98
+ project.pbxGroupByName = function (name) {
99
+ var groups = this.hash.project.objects['PBXGroup'], key, groupKey;
100
+ for (key in groups) {
101
+ // only look for comments
102
+ if (!/_comment$/.test(key))
103
+ continue;
104
+ if (groups[key] == name) {
105
+ groupKey = key.split(/_comment$/)[0];
106
+ return groups[groupKey];
107
+ }
108
+ }
109
+ // The original method returns null here, causing errors when calling project.pbxGroupByName ("xxx"). xx elsewhere
110
+ return false;
111
+ };
112
+ project.updateBuildProperty = function (prop, value, build, targetName) {
113
+ let validConfigs = [];
114
+ const COMMENT_KEY = /_comment$/;
115
+ if (targetName) {
116
+ const target = this.pbxTargetByName(targetName);
117
+ const targetBuildConfigs = target && target.buildConfigurationList;
118
+ const xcConfigList = this.pbxXCConfigurationList();
119
+ // Collect the UUID's from the configuration of our target
120
+ for (const configName in xcConfigList) {
121
+ if (!COMMENT_KEY.test(configName) &&
122
+ targetBuildConfigs === configName) {
123
+ const buildVariants = xcConfigList[configName].buildConfigurations;
124
+ for (const item of buildVariants) {
125
+ validConfigs.push(item.value);
126
+ }
127
+ break;
128
+ }
129
+ }
130
+ }
131
+ var configs = this.pbxXCBuildConfigurationSection();
132
+ for (var configName in configs) {
133
+ if (!COMMENT_KEY.test(configName)) {
134
+ if (targetName && !validConfigs.includes(configName))
135
+ continue;
136
+ var config = configs[configName];
137
+ if (((build && config.name === build) || !build) &&
138
+ config.buildSettings[prop]) {
139
+ config.buildSettings[prop] = value;
140
+ }
141
+ }
142
+ }
143
+ };
144
+ }
145
+ static async bindIcon(icon) {
146
+ if (icon) {
147
+ // The application icon of Apple Vision Pro requires at least 2 images, one of which is a completely opaque base image. Therefore, Spatial Web is required to provide the base image, and CLI will generate an additional completely transparent image as the middle layer.
148
+ const iconConfigDirectory = (0, path_1.join)(resource_1.PROJECT_DIRECTORY, resource_1.BACK_APPICON_DIRECTORY);
149
+ const iconConfigPath = (0, path_1.join)(iconConfigDirectory, 'Contents.json');
150
+ const iconFileName = 'icon.' + icon.getMIME().replace('image/', '');
151
+ const iconFullPath = (0, path_1.join)(iconConfigDirectory, iconFileName);
152
+ let iconConfig = await (0, load_1.loadJsonFromDisk)(iconConfigPath);
153
+ /*
154
+ JSON format for icon configuration in Xcode
155
+ {
156
+ images: [ { filename: 'icon.jpeg', idiom: 'vision', scale: '2x' } ],
157
+ info: { author: 'xcode', version: 1 }
158
+ }
159
+ */
160
+ iconConfig.images[0]['filename'] = iconFileName;
161
+ await icon.writeAsync(iconFullPath);
162
+ await fs.writeFileSync(iconConfigPath, JSON.stringify(iconConfig));
163
+ const middleIconConfigDirectory = (0, path_1.join)(resource_1.PROJECT_DIRECTORY, resource_1.MIDDLE_APPICON_DIRECTORY);
164
+ const middleIconConfigPath = (0, path_1.join)(middleIconConfigDirectory, 'Contents.json');
165
+ const middleIconFileName = 'icon.png';
166
+ const middleIconFullPath = (0, path_1.join)(middleIconConfigDirectory, middleIconFileName);
167
+ let middleConfig = await (0, load_1.loadJsonFromDisk)(middleIconConfigPath);
168
+ let middleIcon = imageHelper_1.ImageHelper.createImg(512);
169
+ middleConfig.images[0]['filename'] = middleIconFileName;
170
+ await middleIcon.writeAsync(middleIconFullPath);
171
+ await fs.writeFileSync(middleIconConfigPath, JSON.stringify(middleConfig));
172
+ }
173
+ }
174
+ static updateTeamId(xcodeProject, teamId) {
175
+ xcodeProject.updateBuildProperty('DEVELOPMENT_TEAM', teamId);
176
+ useExportOptionsXML = useExportOptionsXML.replace('YOURTEAMID', teamId);
177
+ }
178
+ static updateExportOptions() {
179
+ if (!fs.existsSync(resource_1.PROJECT_BUILD_DIRECTORY)) {
180
+ fs.mkdirSync(resource_1.PROJECT_BUILD_DIRECTORY, { recursive: true });
181
+ }
182
+ fs.writeFileSync((0, path_1.join)(resource_1.PROJECT_BUILD_DIRECTORY, 'ExportOptions.plist'), useExportOptionsXML);
183
+ }
184
+ static bindManifestInfo(xcodeProject, manifest, isDev = false) {
185
+ var _a;
186
+ xcodeProject.updateProductName(manifest.name);
187
+ // set PRODUCT_BUNDLE_IDENTIFIER need ""
188
+ if (manifest.id && !isDev) {
189
+ xcodeProject.updateBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', `"${manifest.id}"`);
190
+ }
191
+ this.updateDeeplink((_a = manifest.protocol_handlers) !== null && _a !== void 0 ? _a : []);
192
+ this.modifySwift(manifest);
193
+ }
194
+ static updateVersion(xcodeProject, version) {
195
+ xcodeProject.updateBuildProperty('CURRENT_PROJECT_VERSION', version);
196
+ }
197
+ static updateDeeplink(deeplinks) {
198
+ let infoPlistPath = (0, path_1.join)(resource_1.PROJECT_DIRECTORY, './web-spatial/Info.plist');
199
+ let deeplinkString = '';
200
+ for (let i = 0; i < deeplinks.length; i++) {
201
+ deeplinkString += `<string>${deeplinks[i].protocol}</string>`;
202
+ }
203
+ const newInfoPlist = infoPlistXML.replace('DEEPLINK', deeplinkString);
204
+ fs.writeFileSync(infoPlistPath, newInfoPlist);
205
+ }
206
+ static modifySwift(manifest) {
207
+ const manifestSwiftPath = (0, path_1.join)(resource_1.PROJECT_DIRECTORY, './web-spatial/libs/webView/manifest.swift');
208
+ let manifestSwift = manifestSwiftTemplate_1.manifestSwiftTemplate;
209
+ manifestSwift = manifestSwift.replace('START_URL', manifest.start_url);
210
+ manifestSwift = manifestSwift.replace('SCOPE', manifest.scope);
211
+ manifestSwift = manifestSwift.replace('AppName', manifest.name);
212
+ manifestSwift = manifestSwift.replace('Description', manifest.description);
213
+ manifestSwift = manifestSwift.replace('AppID', manifest.id);
214
+ manifestSwift = manifestSwift.replace('.minimal', manifest.display == 'minimal-ui' ? '.minimal' : `.${manifest.display}`);
215
+ if (manifest.protocol_handlers) {
216
+ let deeplinkString = '';
217
+ for (let i = 0; i < manifest.protocol_handlers.length; i++) {
218
+ deeplinkString += `PWAProtocol(protocolValue: "${manifest.protocol_handlers[i].protocol}", url: "${manifest.protocol_handlers[i].url}"),`;
219
+ }
220
+ manifestSwift = manifestSwift.replace('PWAProtocol(protocolValue: "", url: "")', deeplinkString);
221
+ }
222
+ if (typeof manifest.mainScene === 'object') {
223
+ manifestSwift = manifestSwift.replace('SceneWidth', manifest.mainScene.defaultSize.width);
224
+ manifestSwift = manifestSwift.replace('SceneHeight', manifest.mainScene.defaultSize.height);
225
+ manifestSwift = manifestSwift.replace('SceneResizability', `"${manifest.mainScene.resizability}"`);
226
+ manifestSwift = manifestSwift.replace('USE_MAIN_SCENE', 'true');
227
+ }
228
+ else {
229
+ // string or other type
230
+ // set these to bypass lint
231
+ manifestSwift = manifestSwift.replace('SceneWidth', '1280');
232
+ manifestSwift = manifestSwift.replace('SceneHeight', '1280');
233
+ manifestSwift = manifestSwift.replace('SceneResizability', `"automatic"`);
234
+ manifestSwift = manifestSwift.replace('USE_MAIN_SCENE', 'false');
235
+ }
236
+ fs.writeFileSync(manifestSwiftPath, manifestSwift, 'utf-8');
237
+ }
238
+ }
239
+ exports.default = XcodeProject;
@@ -26,7 +26,7 @@ export default class Xcrun {
26
26
  * appInfo.id is used to launch the application
27
27
  * @returns The simulator device uuid
28
28
  */
29
- static launchWithSimulator(appInfo: BasicAppInfo, deviceId?: string, needInstall?: boolean, needFind?: boolean): string;
29
+ static launchWithSimulator(appInfo: BasicAppInfo, deviceId?: string, needFind?: boolean): string;
30
30
  static shutdownSimulator(): Promise<void>;
31
31
  private static launchSimulator;
32
32
  private static buildTestApp;