Skip to content

Commit 89bb98c

Browse files
committed
Fix QAVS crashing on startup if adb output getting fails, add installation of Lightning Launcher as well as updating guide
1 parent a7e38eb commit 89bb98c

13 files changed

Lines changed: 125 additions & 18 deletions

File tree

DiffCreator/obj/Debug/net6.0/DiffCreator.AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[assembly: System.Reflection.AssemblyCompanyAttribute("DiffCreator")]
1515
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
1616
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
17-
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3b28523e168e9e3b15a94c4c931f06f5cf6ae759")]
17+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a7e38eb39f068612272f220c93ff04601cfeb33e")]
1818
[assembly: System.Reflection.AssemblyProductAttribute("DiffCreator")]
1919
[assembly: System.Reflection.AssemblyTitleAttribute("DiffCreator")]
2020
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
219524a90bc32984e269bcf9b4381ac3771d7df8ad2c08fb560ea781f7ced5b2
1+
526d2a99f82c4553c0a172349039e834d0d9945e8d579c1ebd5285a6db2a5e31

DiffCreator/obj/Release/net6.0/DiffCreator.AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[assembly: System.Reflection.AssemblyCompanyAttribute("DiffCreator")]
1515
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
1616
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
17-
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2f7b7155cadcbcfbb5b89a24c52b474aea4dfdc5")]
17+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a7e38eb39f068612272f220c93ff04601cfeb33e")]
1818
[assembly: System.Reflection.AssemblyProductAttribute("DiffCreator")]
1919
[assembly: System.Reflection.AssemblyTitleAttribute("DiffCreator")]
2020
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b8fbbfcde5e59c97714e0dd5db41650a72cb80f4512222f3d41bf98e5aa67520
1+
a0f28e8274c2ffadbf476424324d476fdc6c89d144099da1aee85cbadcadff50

QuestAppVersionSwitcher/Adb/AdbWrapper.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,29 @@ public static ExitInfo RunAdbCommand(string arguments)
8484
}
8585

8686
proc.WaitForExit();
87+
string error = "";
88+
try
89+
{
90+
error = proc.StandardError.ReadToEnd();
91+
}
92+
catch (Exception e)
93+
{
94+
error = "Internal QAVS error getting standard error: " + e;
95+
}
96+
string output = "";
97+
try
98+
{
99+
output = proc.StandardOutput.ReadToEnd();
100+
}
101+
catch (Exception e)
102+
{
103+
output = "Internal QAVS error getting standard output: " + e;
104+
}
87105
ExitInfo i = new ExitInfo()
88106
{
89107
ExitCode = proc.ExitCode,
90-
Error = proc.StandardError.ReadToEnd(),
91-
Output = proc.StandardOutput.ReadToEnd()
108+
Error = error,
109+
Output = output
92110
};
93111
Logger.Log("Exit code: " + i.ExitCode + "\n Error: " + i.Error + "\n\n Output: " + i.Output, "AdbWrapper");
94112

QuestAppVersionSwitcher/Assets/html/adb.html

Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,19 @@ <h1>Quest connected!</h1>
2626
<p>Your quest is connected via adb. You can return now</p>
2727
<button onclick="AdbConnected()">Continue</button>
2828
</div>
29+
<div class="content hidden" id="launcher">
30+
<h1>Prerequisites</h1>
31+
<p>Before pairing you have to install Lightning Launcher. For that use the button below. It'll start the download and then initiate the install.</p>
32+
<button onclick="Launcher()">Download and install Lightning Launcher</button>
33+
<div id="launcherInstall" class="hidden">
34+
<h2>Installing Lightning Launcher</h2>
35+
Please wait a few seconds until the download completes. If you have any issues, please press the download button again.
36+
</div>
37+
</div>
2938
<div class="content hidden" id="pair">
3039
<h1>Pairing</h1>
3140
<p>Your quest is not connected via adb yet. Input the port and code shown in the wireless adb pairing page.</p>
3241

33-
<button onclick="settings()">Open android settings</button>
3442
<input type="number" placeholder="port" id="port">
3543
<input type="number" placeholder="code" id="code">
3644
<button onclick="pair()">Pair</button>
@@ -39,22 +47,25 @@ <h2>Guide</h2>
3947
<img id="guideImage">
4048
<p id="guideText"></p>
4149

42-
<button onclick="UpdateGuide(-1)">&lt;</button>
43-
<button onclick="UpdateGuide(1)">&gt;</button>
50+
<button class="navigationButton" onclick="UpdateGuide(-1)">&lt;</button>
51+
<button class="navigationButton" onclick="UpdateGuide(1)">&gt;</button>
4452
</div>
4553
</div>
4654
<div class="content hidden" id="remember">
4755
<h1>Connect</h1>
4856
<p>QAVS has successfully paired with your Quest. We will now connect QAVS with your Quest. For that, input the wireless port from the adb wireless settings page.</p>
4957

5058

51-
<button onclick="settings()">Open android settings</button>
5259
<input type="number" placeholder="wireless port" id="adbport">
5360
<button onclick="connect()">Connect</button>
61+
<br>
62+
<b>QAVS may crash while connecting to your Quest. If this happens just restart QAVS. It should be connected afterwards</b>
63+
<p>If this happens repeatedly reboot your Quest</p>
5464
<h2>Guide</h2>
5565
<div>
5666
<img src="/images/adb/11.jpg">
5767
<p>You will find the port in the wireless debugging settings.In this screenshot the port is 46137. Input the one from your settings into the wireless port above and hit connect.</p>
68+
5869
</div>
5970
</div>
6071
<div class="content hidden" id="connecting">
@@ -84,6 +95,9 @@ <h1>Making connecting persistent, please wait a bit</h1>
8495
<div class="loaderSquare"></div>
8596
</div>
8697
</div>
98+
<br>
99+
<br>
100+
<br>
87101
<a href="/pair">Advanced ui</a>
88102
<script>
89103
FirstOpen()
@@ -103,8 +117,11 @@ <h1>Making connecting persistent, please wait a bit</h1>
103117
img: "/images/adb/0.jpg",
104118
txt: "Place the window on the left side like in the picture"
105119
},{
106-
img: "/images/adb/1.jpg",
107-
txt: "Open the settings on your Quest with the button above"
120+
img: "/images/adb/0.1.jpg",
121+
txt: "Open Lightning Launcher by opening your Library (1), going to 'Unknown sources' (2) and then opening 'Lightning Launcher' (3)"
122+
},{
123+
img: "/images/adb/0.2.jpg",
124+
txt: "In Lightning Launcher press on 'Apps' (1) and then on 'Android Settings' (2)"
108125
},{
109126
img: "/images/adb/2.jpg",
110127
txt: "Scroll down and press on 'About headset'"
@@ -125,7 +142,7 @@ <h1>Making connecting persistent, please wait a bit</h1>
125142
txt: "Click on 'Wireless debugging'. Make sure to click into the blank space"
126143
},{
127144
img: "/images/adb/8.jpg",
128-
txt: "Enable wireless debugging"
145+
txt: "Enable wireless debugging and always allow it in your network when prompted"
129146
},{
130147
img: "/images/adb/9.jpg",
131148
txt: "Click on 'Pair device with pairing code'"
@@ -168,10 +185,64 @@ <h1>Making connecting persistent, please wait a bit</h1>
168185
// Found devices
169186
OpenTab("connected")
170187
} else {
188+
InitiatePair()
189+
}
190+
})
191+
}
192+
193+
function Launcher() {
194+
document.getElementById('launcherInstall').className = ""
195+
fetch("/api/adb/downloadlauncher", {method: "POST"}).then(res => {
196+
if(res.ok) {
197+
InstallationMonitor()
198+
} else {
199+
alert("Failed to start download. Please try again.")
200+
document.getElementById('launcherInstall').className = "hidden"
201+
}
202+
})
203+
}
204+
205+
function InstallationMonitor() {
206+
let install = setInterval(() => {
207+
IsLauncherInstalled().then(isInstalled => {
208+
if(isInstalled) {
209+
document.getElementById('launcherInstall').className = "hidden"
210+
clearInterval(install)
171211
OpenTab("pair")
172212
}
213+
}).catch(err => {
214+
document.getElementById('launcherInstall').className = "hidden"
215+
clearInterval(install)
216+
alert("Failed to check if Lightning Launcher is installed. I will assume that it is. If it isn't, install Lightning Launcher manually via SideQuest")
217+
OpenTab("pair")
218+
})
219+
}, 1000)
220+
}
221+
222+
function IsLauncherInstalled() {
223+
return new Promise((resolve, reject) => {
224+
fetch("/api/android/installedapps").then(res => res.json()).then(res => {
225+
resolve(res.some(app => app.PackageName == "com.threethan.launcher"))
226+
}).catch(err => {
227+
reject(err)
173228
})
229+
})
174230
}
231+
232+
function InitiatePair() {
233+
// Check if lightning launcher is installed
234+
IsLauncherInstalled().then(isInstalled => {
235+
if(isInstalled) {
236+
OpenTab("pair")
237+
} else {
238+
OpenTab("launcher")
239+
}
240+
}).catch(err => {
241+
alert("Failed to check if Lightning Launcher is installed. I will assume that it is not.")
242+
OpenTab("launcher")
243+
})
244+
}
245+
175246
function wireless() {
176247
fetch(`/api/adb/togglewireless`, {
177248
method: "POST"
156 KB
Loading
229 KB
Loading
-325 Bytes
Loading
-4.23 KB
Loading

0 commit comments

Comments
 (0)