Skip to content

Commit 8c91404

Browse files
author
ComputerElite
committed
fix login and downgrading
1 parent f416d58 commit 8c91404

7 files changed

Lines changed: 111 additions & 69 deletions

File tree

Assets/html/index.html

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
</div>
6161
</div>
6262
<div class="contentItem hidden" id="downgrade" style="padding: 0px;">
63-
<iframe src="https://oculusdb.rui2015.me/search?query=Beat+Saber&headsets=MONTEREY%2CHOLLYWOOD" style="width: 100%; height: 100%; border: none; overflow-y: visible;"></iframe>
63+
<iframe src="https://oculusdb.rui2015.me/search?query=Beat+Saber&headsets=MONTEREY%2CHOLLYWOOD&isqavs=true" style="width: 100%; height: 100%; border: none; overflow-y: visible;"></iframe>
6464
</div>
6565
<div class="contentItem hidden" id="download">
6666
<div id="progressBarContainers" style="width: 95%;">
@@ -330,7 +330,7 @@
330330
}
331331

332332
document.getElementById("login").onclick = () => {
333-
location = "https://auth.oculus.com/login/?redirect_uri=https%3A%2F%2Fwww.oculus.com%2Fexperiences%2Fquest%2F"
333+
location = "https://auth.oculus.com/login/?redirect_uri=https%3A%2F%2Fsecure.oculus.com%2F&reason=page_require_login"
334334
}
335335

336336
setInterval(() => {
@@ -382,23 +382,15 @@
382382

383383
function ChangeApp(package) {
384384
console.log("Changing app to " + package)
385-
fetch("questappversionswitcher/changeapp", {
386-
method: "POST",
387-
body: package
388-
}).then(() => UpdateUI(true))
385+
fetch("questappversionswitcher/changeapp?body=" + package).then(() => UpdateUI(true))
389386
UpdateUI(true)
390387
}
391388

392389
document.getElementById("exit").onclick = () => {
393-
fetch("questappversionswitcher/kill", {
394-
method: "POST"
395-
})
390+
fetch("questappversionswitcher/kill")
396391
}
397392
document.getElementById("confirmPort").onclick = () => {
398-
fetch("questappversionswitcher/changeport", {
399-
method: "POST",
400-
body: document.getElementById("port").value
401-
}).then(res => {
393+
fetch("questappversionswitcher/changeport?body=" + document.getElementById("port").value).then(res => {
402394
res.text().then(text => {
403395
if(res.status == 200) {
404396
TextBoxGood("serverTextBox", text)
@@ -434,9 +426,7 @@
434426
var onlyAppData = document.getElementById("appdata").checked
435427
backupInProgress = true
436428
TextBoxText("backupTextBox", "Please wait while the Backup is being created. This can take a few minutes")
437-
fetch("backup?package=" + config.currentApp + "&backupname=" + document.getElementById("backupname").value + (onlyAppData ? "&onlyappdata=true" : "") , {
438-
method: "POST"
439-
}).then(res => {
429+
fetch("backup?package=" + config.currentApp + "&backupname=" + document.getElementById("backupname").value + (onlyAppData ? "&onlyappdata=true" : "")).then(res => {
440430
res.text().then(text => {
441431
if (res.status == 202) {
442432
TextBoxText("backupTextBox", text)
@@ -490,9 +480,7 @@
490480
}
491481

492482
document.getElementById("uninstall").onclick = () => {
493-
fetch(`android/uninstallpackage?package=${config.currentApp}`, {
494-
method: "POST"
495-
}).then(res => {
483+
fetch(`android/uninstallpackage?package=${config.currentApp}`).then(res => {
496484
if (res.status == 230) GotoStep(3)
497485
else GotoStep(2)
498486
})
@@ -504,9 +492,7 @@
504492
if(text == "true") {
505493
GotoStep(4)
506494
} else {
507-
fetch(`android/uninstallpackage?package=${config.currentApp}`, {
508-
method: "POST"
509-
}).then(res => {
495+
fetch(`android/uninstallpackage?package=${config.currentApp}`).then(res => {
510496
if (res.status == 230) GotoStep(3)
511497
else GotoStep(2)
512498
})
@@ -529,14 +515,10 @@
529515
}
530516

531517
document.getElementById("install").onclick = () => {
532-
fetch("restoreapp?package=" + config.currentApp + "&backupname=" + selectedBackup, {
533-
method: "POST"
534-
}).then(res => {
518+
fetch("restoreapp?package=" + config.currentApp + "&backupname=" + selectedBackup).then(res => {
535519
res.text().then(text => {
536520
if (res.status == 200) {
537-
fetch("containsgamedata?package=" + config.currentApp + "&backupname=" + selectedBackup, {
538-
method: "POST"
539-
}).then(res => {
521+
fetch("containsgamedata?package=" + config.currentApp + "&backupname=" + selectedBackup).then(res => {
540522
res.text().then(text => {
541523
if (text == "False") {
542524
GotoStep(5)
@@ -557,9 +539,7 @@
557539
res.text().then(text => {
558540
if (text == "True") {
559541
TextBoxText("step4box", "Restoring game data. Please wait")
560-
fetch("restoregamedata?package=" + config.currentApp + "&backupname=" + selectedBackup, {
561-
method: "POST"
562-
}).then(res => {
542+
fetch("restoregamedata?package=" + config.currentApp + "&backupname=" + selectedBackup).then(res => {
563543
res.text().then(text => {
564544
if (res.status == 200) GotoStep(5)
565545
else {
@@ -618,9 +598,10 @@
618598
document.getElementById("deleteContainer").className = "listContainer darken"
619599
}
620600

621-
function CloseTokenPasswordPopup() {
601+
function CloseTokenPasswordPopup(done = false) {
622602
document.getElementById("tokenPasswordContainer").className = "listContainer darken hidden"
623603
GotoStep(8)
604+
if (!done) CloseTokenPasswordPopup(true)
624605
}
625606

626607
function OpenTokenPasswordPopup() {
@@ -649,10 +630,7 @@
649630
document.getElementById("confirmPassword").onclick = () => {
650631
options.password = document.getElementById("passwordConfirm").value
651632
options.app = options.parentName
652-
fetch("/download", {
653-
method: "POST",
654-
body: JSON.stringify(options)
655-
}).then(res => {
633+
fetch("/download?body=" + JSON.stringify(options)).then(res => {
656634
res.text().then(text => {
657635
if (res.status == 403) {
658636
TextBoxError("step7box", text)
@@ -669,13 +647,10 @@
669647
document.getElementById("tokenPassword").onclick = () => {
670648
options.password = document.getElementById("passwordConfirm").value
671649
options.app = options.parentName
672-
fetch("/token", {
673-
method: "POST",
674-
body: JSON.stringify({
675-
token: params.get("token"),
676-
password: document.getElementById("passwordToken").value
677-
})
678-
}).then(res => {
650+
fetch("/token?body=" + JSON.stringify({
651+
token: params.get("token"),
652+
password: document.getElementById("passwordToken").value
653+
})).then(res => {
679654
res.text().then(text => {
680655
if (res.status == 403) {
681656
TextBoxError("step8box", text)

CoreService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ public void Start()
4141
browser.Focusable = true;
4242
browser.Settings.MediaPlaybackRequiresUserGesture = false;
4343
browser.Settings.DomStorageEnabled = true;
44-
browser.Settings.UserAgentString = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.47";
44+
browser.Settings.UserAgentString = "Mozilla/5.0 (X11; Linux x86_64; Quest) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/21.2.0.1.37.371181431 SamsungBrowser/4.0 Chrome/100.0.4896.160 VR Safari/537.36";
4545
browser.Settings.DatabaseEnabled = true;
4646
browser.Settings.DatabasePath = "/data/data/" + browser.Context.PackageName + "/databases/";
4747
browser.Settings.LoadWithOverviewMode = true;
4848
browser.Settings.UseWideViewPort = true;
49+
CookieManager.Instance.SetAcceptThirdPartyCookies(browser, true);
50+
4951
// Create all directories and files
5052
FileManager.CreateDirectoryIfNotExisting(coreVars.QAVSDir);
5153
FileManager.CreateDirectoryIfNotExisting(coreVars.QAVSBackupDir);

MainActivity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class MainActivity : AppCompatActivity
2020
WebView webView;
2121
protected override void OnCreate(Bundle savedInstanceState)
2222
{
23-
23+
Android.Webkit.WebView.SetWebContentsDebuggingEnabled(true);
2424
base.OnCreate(savedInstanceState);
2525
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
2626
// Set our view from the "main" layout resource

Properties/AndroidManifest.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.2" package="com.ComputerElite.questappversionswitcher" android:installLocation="preferExternal" android:versionCode="11">
3-
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="27" />
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.3" package="com.ComputerElite.questappversionswitcher" android:installLocation="preferExternal" android:versionCode="12">
3+
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="29" />
44
<uses-permission android:name="oculus.permission.handtracking" />
55
<uses-permission android:name="com.oculus.permission.HAND_TRACKING" />
66
<uses-feature android:name="oculus.software.handtracking" android:required="false" />
7-
<application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true" android:allowBackup="true" android:icon="@mipmap/ic_launcher_foreground" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
7+
<application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true" android:allowBackup="true" android:icon="@mipmap/ic_launcher_round" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
88
<provider android:authorities="com.ComputerElite.questappversionswitcher.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
99
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
1010
</provider>
1111
</application>
1212
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
13-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
14-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
1513
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
1614
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
1715
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
1816
<uses-permission android:name="android.permission.INTERNET" />
17+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
18+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
1919
</manifest>

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
// Minor Version
2323
// Build Number
2424
// Revision
25-
[assembly: AssemblyVersion("1.2.0.0")]
26-
[assembly: AssemblyFileVersion("1.2.0.0")]
25+
[assembly: AssemblyVersion("1.3.0.0")]
26+
[assembly: AssemblyFileVersion("1.3.0.0")]

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</SelectedDevice>
5-
<ActiveDebugProfile>Samsung SM-A202F</ActiveDebugProfile>
4+
<SelectedDevice>Oculus Quest</SelectedDevice>
5+
<ActiveDebugProfile>Oculus Quest</ActiveDebugProfile>
66
<DefaultDevice>q1</DefaultDevice>
77
<AndroidDesignerPreferredTheme>AppTheme</AndroidDesignerPreferredTheme>
88
<AndroidDesignerPreferredDevice>Nexus 4</AndroidDesignerPreferredDevice>

0 commit comments

Comments
 (0)