Skip to content

Commit 8bbd4d5

Browse files
author
ComputerElite
committed
fix starting
1 parent 59f44eb commit 8bbd4d5

4 files changed

Lines changed: 51 additions & 2 deletions

File tree

Assets/html/downgrade.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
</td>
5656
</tr>
5757
</table>
58+
<div style="position: fixed; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; background-color: #00000099; visibility: hidden; top: 0; left: 0" id="popupContainer" onclick="if(event.target.id == 'popupContainer') document.getElementById('popupContainer').style.visibility = 'hidden'">
59+
<div style="background-color: #222222; padding: 10px;">
60+
<div style="display: flex; justify-content: center; flex-direction: column; align-items: center;" id="popup">
61+
62+
</div>
63+
</div>
64+
</div>
5865
<div id="notesContainer" style="margin-bottom: 50px;">
5966

6067
</div>
@@ -143,6 +150,9 @@
143150

144151
var url = new URL(window.location.href);
145152
var id = url.searchParams.get("id");
153+
var query = url.searchParams.get("query");
154+
var downloadId = url.searchParams.get("downloadid");
155+
var downloadVersion = url.searchParams.get("downloadversion");
146156

147157
if(id != undefined && id != "") {
148158
SearchVersions(id)
@@ -154,6 +164,23 @@
154164
document.getElementById("searchTerm").value = query
155165
Search()
156166
}
167+
if(downloadId) {
168+
setTimeout(() => {
169+
var a = document.createElement("a")
170+
a.href = GetDownloadLink(downloadId)
171+
a.target = "_blank"
172+
a.click()
173+
}, 100)
174+
}
175+
if(downloadVersion) {
176+
if(!id)
177+
{
178+
downloadVersion = ""
179+
alert("id query parameter must be set to an app")
180+
} else {
181+
SearchVersions(id)
182+
}
183+
}
157184

158185
var menuOpen = false;
159186

@@ -419,6 +446,12 @@
419446
if(res.includes(id)) {
420447
MakeTextGetRequestAsync(`https://computerelite.github.io/tools/Oculus/AppNotes/${id}.html`).then(res => {
421448
document.getElementById("notesContainer").innerHTML = res
449+
Array.prototype.forEach.call(document.getElementById("notesContainer").getElementsByTagName("script"), e => {
450+
console.log(e)
451+
s = document.createElement("script")
452+
s.innerHTML = e.innerHTML
453+
document.head.appendChild(s)
454+
})
422455
})
423456
}
424457
})
@@ -452,6 +485,20 @@
452485
document.getElementById("versions").innerHTML = finished < required ? loader : ""
453486
versions.forEach(e => {
454487
document.getElementById("versions").innerHTML += GetFormatted(e, HeadsetName == "RIFT")
488+
if(finished >= required && downloadVersion && e.version == downloadVersion) {
489+
name = document.getElementById("versionHeader").innerHTML.replace("Versions for ", "")
490+
document.getElementById("popupContainer").style.visibility = "visible"
491+
document.getElementById("popup").innerHTML = `
492+
<div style="font-size: 1.3em;">
493+
<div>Do you want to Download ${name} version ${downloadVersion}. If the download doesn't start log in on oculus.com</div>
494+
<div style="display: flex;">
495+
<div class="customButton" onclick="Download(${e.id}, false, ${e.appid}, ${e.code})">Yes</div>
496+
<div class="customButton" style="margin-left: 10px;" onclick="document.getElementById('popupContainer').style.visibility = 'hidden'">No</div>
497+
</div>
498+
</div>
499+
`
500+
downloadVersion = ""
501+
}
455502
})
456503
document.getElementById("versions").innerHTML += finished < required ? "" : (failed ? "<div style='font-size: 24px; text-align: center; flex: 1;'>Request to Oculus failed cached data is being shown.</div>" + RequestFailedError : "")
457504
if(document.getElementById("versions").innerHTML == "") {

CoreService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class CoreService
2323
public static Version version = Assembly.GetExecutingAssembly().GetName().Version;
2424
public void Start()
2525
{
26+
2627
// Check permissions and request if needed
2728
if (Permissions.CheckStatusAsync<Permissions.StorageWrite>().Result != PermissionStatus.Granted)
2829
{

MainActivity.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class MainActivity : AppCompatActivity
2020
WebView webView;
2121
protected override void OnCreate(Bundle savedInstanceState)
2222
{
23+
2324
base.OnCreate(savedInstanceState);
2425
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
2526
// Set our view from the "main" layout resource

QuestAppVersionSwitcher.csproj.user

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<SelectedDevice>Samsung SM-A202F %28192.168.178.63:5555%29</SelectedDevice>
5-
<ActiveDebugProfile>Samsung SM-A202F %28192.168.178.63:5555%29</ActiveDebugProfile>
4+
<SelectedDevice>Oculus Quest</SelectedDevice>
5+
<ActiveDebugProfile>Oculus Quest</ActiveDebugProfile>
66
<DefaultDevice>pixel_5_q_10_0_-_api_29</DefaultDevice>
77
<AndroidDesignerPreferredTheme>AppTheme</AndroidDesignerPreferredTheme>
88
<AndroidDesignerPreferredDevice>Nexus 4</AndroidDesignerPreferredDevice>

0 commit comments

Comments
 (0)