text: "use strict";const i=require("path"),o=require("../../untils/fs"),t=require("../../untils/logs"),n=require("../../untils/common"),r=(t,n)=>{var r="";const e="android"===t;return o.existsSync(i.join(n,t,e?"":"App"))?r=i.join(n,t,e?"":"App"):o.existsSync(i.join(n,"platforms",t))&&(r=i.join(n,"platforms",t)),r};async function e(t,n){try{const e=r(t,n);if(e){const t=await o.readdirAsync(e),n=t.find((i=>i.endsWith(".xcworkspace")));if(n||(n=t.find((i=>i.endsWith(".xcodeproj")))),n)return i.join(e,n)}return null}catch(i){return null}}function s(i,e,s,a){const d=r(i,e);if(!d)throw new Error("Android project does not exist. Please add first.");return t.logInfo(`Opening Android project at ${d}`),new Map([["darwin",async()=>{const i=await Promise.resolve().then((()=>require("open")));await i(d,{app:{name:"android studio"},wait:!1}),s("opened"),await n.wait(3e3)}],["win32",async()=>{const i=await Promise.resolve().then((()=>require("open")));a||(a="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe");try{if(!o.existsSync(a)){let i=await runCommand('REG QUERY "HKEY_LOCAL_MACHINE\\SOFTWARE\\Android Studio" /v Path');i=i.replace(/(\r\n|\n|\r)/gm,"");const o=i.indexOf("REG_SZ");a=o>0?i.substring(o+6).trim()+"\\bin\\studio64.exe":""}}catch(i){a=""}a?await i(d,{app:{name:a},wait:!1}):t.logError('Unable to launch Android Studio. You must configure "androidStudioPath" in -studio xxxxxx to point to the location of studio.sh, using JavaScript-escaped paths:\nExample: -studio C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe')}],["linux",async()=>{const i=await Promise.resolve().then((()=>require("open"))),n=()=>{t.logError('Unable to launch Android Studio. You must configure "androidStudioPath" in -studio xxxxxx to point to the location of studio.sh, using JavaScript-escaped paths:\nExample: -studio /usr/local/android-studio/bin/studio.sh')};a||(a="/usr/local/android-studio/bin/studio.sh");try{o.existsSync(a)?await i(d,{app:{name:a},wait:!1}):n()}catch(i){n()}}]])}exports.findPath=r,exports.findXcodePath=e,exports.getAndroidActions=s;