99using System . Text . Json ;
1010using System . Net ;
1111using System . IO . Compression ;
12- using System . IO . Pipes ;
13- using System . Net . Sockets ;
1412using System . Threading ;
1513using System . Security . Cryptography ;
1614using ComputerUtils . ADB ;
2927using OculusGraphQLApiLib . Results ;
3028using ComputerUtils . VarUtils ;
3129using ComputerUtils . CommandLine ;
32- using OculusDB ;
3330using QuestPatcher . Axml ;
3431using OculusGraphQLApiLib . Folders ;
3532using OculusDB . Database ;
36- using OculusDB . Search ;
37- using OculusGraphQLApiLib . GraphQL ;
38- using OpenQA . Selenium ;
39- using OpenQA . Selenium . Chrome ;
40- using OpenQA . Selenium . DevTools ;
4133
4234namespace RIFT_Downgrader
4335{
@@ -46,7 +38,6 @@ class Program
4638 [ STAThread ]
4739 static void Main ( string [ ] args )
4840 {
49- // Handle oculus uri scheme
5041 Logger . SetLogFile ( AppDomain . CurrentDomain . BaseDirectory + "Log.log" ) ;
5142 SetupExceptionHandlers ( ) ;
5243 DowngradeManager . updater = new Updater ( "1.11.47" , "https://github.com/ComputerElite/Oculus-downgrader" , "Oculus Downgrader" , Assembly . GetExecutingAssembly ( ) . Location ) ;
@@ -84,19 +75,6 @@ static void Main(string[] args)
8475 DowngradeManager . commands . AddCommandLineArgument ( new List < string > { "--versionstring" } , false , "VersionString of the game version to download/launch. Less precise than other version selecting" , "versionstring" ) ; // Done
8576 DowngradeManager . commands . AddCommandLineArgument ( new List < string > { "--copyold" } , true , "If you want to backup your current install" ) ; // Done
8677
87-
88- if ( args . Length == 1 && args [ 0 ] . StartsWith ( "oculus://" ) )
89- {
90- string path = args [ 0 ] . Replace ( "oculus://" , "" ) ;
91- Console . WriteLine ( path ) ;
92- string [ ] parameters = path . Split ( '?' ) [ 1 ] . Split ( '&' ) ;
93- string token = parameters [ 0 ] . Split ( '=' ) [ 1 ] ;
94- string blob = parameters [ 1 ] . Split ( '=' ) [ 1 ] ;
95- File . WriteAllText ( AppDomain . CurrentDomain . BaseDirectory + "etoken_tmp.txt" , blob + "|" + token ) ;
96- Console . ReadLine ( ) ;
97- return ;
98- }
99-
10078 if ( DowngradeManager . commands . HasArgument ( "imconfused" ) )
10179 {
10280 Console . WriteLine ( "How DARE you be confused. Get unconfused! https://youtu.be/TMrtLsQbaok?t=188" ) ;
@@ -1340,7 +1318,7 @@ public void ShowVersions(string appId)
13401318 undefinedEndProgressBar . UpdateProgress ( "Requesting version from Oculus due to version id existing" ) ;
13411319 try
13421320 {
1343- Data < OculusBinary > hiddenApp = GraphQLClient . GetBinaryDetails ( commands . GetValue ( "--versionid" ) ) ;
1321+ Data < AndroidBinary > hiddenApp = GraphQLClient . GetBinaryDetails ( commands . GetValue ( "--versionid" ) ) ;
13441322 undefinedEndProgressBar . StopSpinningWheel ( ) ;
13451323 Download ( hiddenApp . data . node , appId , hiddenApp . data . node . binary_application . displayName ) ;
13461324 }
@@ -1350,10 +1328,11 @@ public void ShowVersions(string appId)
13501328 Logger . Log ( "Request to Oculus failed. Requesting from OculusDB instead. OculusBB may not have every version: " + e ) ;
13511329 try
13521330 {
1331+ DBVersion version = JsonSerializer . Deserialize < DBVersion > ( new WebClient ( ) . DownloadString ( "https://oculusdb.rui2015.me/api/v1/id/" + commands . GetValue ( "--versionid" ) ) ) ;
1332+
13531333 undefinedEndProgressBar . StopSpinningWheel ( ) ;
1354- DBVersion version = JsonSerializer . Deserialize < DBVersion > ( new WebClient ( ) . DownloadString ( "https://oculusdb-rewrite.rui2015.me/api/v2/id/" + commands . GetValue ( "--versionid" ) ) ) ;
1355- OculusBinary b = new OculusBinary
1356- { version = version . version , versionCode = version . versionCode , id = version . id , change_log = version . changelog } ;
1334+ AndroidBinary b = new AndroidBinary
1335+ { version = version . version , versionCode = version . versionCode , id = version . id , change_log = version . changeLog } ;
13571336 Download ( b , appId , version . parentApplication . displayName ) ;
13581337 }
13591338 catch ( Exception ex )
@@ -1376,8 +1355,8 @@ public void ShowVersions(string appId)
13761355 {
13771356 if ( config . requestVersionsFromOculus ) throw new Exception ( "Forced request from Oculus" ) ;
13781357
1379- Logger . Log ( "Requesting versions from https://oculusdb-rewrite .rui2015.me/api/v2 /connected/" + appId + " and adding." ) ;
1380- s = JsonSerializer . Deserialize < ConnectedList > ( webClient . DownloadString ( "https://oculusdb-rewrite .rui2015.me/api/v2 /connected/" + appId ) ) ;
1358+ Logger . Log ( "Requesting versions from https://oculusdb.rui2015.me/api/v1 /connected/" + appId + " and adding." ) ;
1359+ s = JsonSerializer . Deserialize < ConnectedList > ( webClient . DownloadString ( "https://oculusdb.rui2015.me/api/v1 /connected/" + appId ) ) ;
13811360
13821361 appName = s . applications [ 0 ] . displayName ;
13831362 foreach ( DBVersion b in s . versions )
0 commit comments