3030using QuestPatcher . Axml ;
3131using OculusGraphQLApiLib . Folders ;
3232using OculusDB . Database ;
33+ using OculusGraphQLApiLib . GraphQL ;
34+ using OpenQA . Selenium ;
35+ using OpenQA . Selenium . Chrome ;
3336
3437namespace RIFT_Downgrader
3538{
@@ -1199,9 +1202,9 @@ public void StoreSearch(string autoterm = "")
11991202
12001203 Logger . Log ( "Requesting results from OculusDB" ) ;
12011204 Console . WriteLine ( "Requesting results from OculusDB" ) ;
1202- SearchResultWithType < DBApplication > applications = JsonSerializer . Deserialize < SearchResultWithType < DBApplication > > (
1203- new WebClient ( ) . DownloadString ( "https://oculusdb-rewrite .rui2015.me/api/v2 /search?q= " + term ) ) ;
1204- foreach ( DBApplication application in applications . results )
1205+ List < DBApplication > applications = JsonSerializer . Deserialize < List < DBApplication > > (
1206+ new WebClient ( ) . DownloadString ( "https://oculusdb.rui2015.me/api/v1 /search/ " + term ) ) ;
1207+ foreach ( DBApplication application in applications )
12051208 {
12061209 if ( ! nameIdRaw . ContainsKey ( application . id ) )
12071210 nameIdRaw . Add ( application . id , application . displayName ) ;
@@ -1318,7 +1321,7 @@ public void ShowVersions(string appId)
13181321 undefinedEndProgressBar . UpdateProgress ( "Requesting version from Oculus due to version id existing" ) ;
13191322 try
13201323 {
1321- Data < AndroidBinary > hiddenApp = GraphQLClient . GetBinaryDetails ( commands . GetValue ( "--versionid" ) ) ;
1324+ Data < OculusBinary > hiddenApp = GraphQLClient . GetBinaryDetails ( commands . GetValue ( "--versionid" ) ) ;
13221325 undefinedEndProgressBar . StopSpinningWheel ( ) ;
13231326 Download ( hiddenApp . data . node , appId , hiddenApp . data . node . binary_application . displayName ) ;
13241327 }
@@ -1331,7 +1334,7 @@ public void ShowVersions(string appId)
13311334 DBVersion version = JsonSerializer . Deserialize < DBVersion > ( new WebClient ( ) . DownloadString ( "https://oculusdb.rui2015.me/api/v1/id/" + commands . GetValue ( "--versionid" ) ) ) ;
13321335
13331336 undefinedEndProgressBar . StopSpinningWheel ( ) ;
1334- AndroidBinary b = new AndroidBinary
1337+ OculusBinary b = new OculusBinary
13351338 { version = version . version , versionCode = version . versionCode , id = version . id , change_log = version . changeLog } ;
13361339 Download ( b , appId , version . parentApplication . displayName ) ;
13371340 }
@@ -1366,12 +1369,12 @@ public void ShowVersions(string appId)
13661369 id = b . id ,
13671370 version = b . version ,
13681371 version_code = b . versionCode ,
1369- created_date = ( long ) ( b . uploadedDate - new DateTime ( 1090 , 1 , 1 , 0 , 0 , 0 ) ) . TotalSeconds ,
1372+ created_date = b . created_date ,
13701373 binary_release_channels = new Nodes < ReleaseChannel > ( )
13711374 } ;
1372- for ( int i = 0 ; i < b . releaseChannels . Count ; i ++ )
1375+ for ( int i = 0 ; i < b . binary_release_channels . nodes . Count ; i ++ )
13731376 {
1374- bin . binary_release_channels . nodes . Add ( new ReleaseChannel { channel_name = b . releaseChannels [ i ] . name , id = b . releaseChannels [ i ] . id } ) ;
1377+ bin . binary_release_channels . nodes . Add ( new ReleaseChannel { channel_name = b . binary_release_channels . nodes [ i ] . channel_name , id = b . binary_release_channels . nodes [ i ] . id } ) ;
13751378 }
13761379 versions . Add ( bin ) ;
13771380 }
@@ -1441,7 +1444,7 @@ public void ShowVersions(string appId)
14411444 ver = ConsoleUiController . QuestionString ( "Which version do you want?: " ) ;
14421445 foreach ( OculusBinary v in versions )
14431446 {
1444- if ( ( ver . ToLower ( ) . StartsWith ( v . version . ToLower ( ) ) && ( s . versions . FirstOrDefault ( x => ver . ToLower ( ) . StartsWith ( x . version . ToLower ( ) ) && x . id != v . id && x . releaseChannels . Count > 0 ) == null || ( ver . Trim ( ) . Length <= v . versionCode . ToString ( ) . Length || v . versionCode . ToString ( ) == ver . Trim ( ) . Substring ( ver . Trim ( ) . Length - v . versionCode . ToString ( ) . Length ) ) ) || v . id == ver ) && v . binary_release_channels . nodes . Count > 0 )
1447+ if ( ( ver . ToLower ( ) . StartsWith ( v . version . ToLower ( ) ) && ( s . versions . FirstOrDefault ( x => ver . ToLower ( ) . StartsWith ( x . version . ToLower ( ) ) && x . id != v . id && x . binary_release_channels . nodes . Count > 0 ) == null || ( ver . Trim ( ) . Length <= v . versionCode . ToString ( ) . Length || v . versionCode . ToString ( ) == ver . Trim ( ) . Substring ( ver . Trim ( ) . Length - v . versionCode . ToString ( ) . Length ) ) ) || v . id == ver ) && v . binary_release_channels . nodes . Count > 0 )
14451448 {
14461449 selected = v ;
14471450 choosen = true ;
@@ -1457,7 +1460,7 @@ public void ShowVersions(string appId)
14571460 {
14581461 foreach ( OculusBinary v in versions )
14591462 {
1460- if ( ( ver . ToLower ( ) . StartsWith ( v . version . ToLower ( ) ) && ( s . versions . FirstOrDefault ( x => ver . ToLower ( ) . StartsWith ( x . version . ToLower ( ) ) && x . id != v . id && x . releaseChannels . Count > 0 ) == null || v . versionCode . ToString ( ) == ver . Trim ( ) . Substring ( ver . Trim ( ) . Length - v . versionCode . ToString ( ) . Length ) ) || v . id == ver ) && v . binary_release_channels . nodes . Count > 0 )
1463+ if ( ( ver . ToLower ( ) . StartsWith ( v . version . ToLower ( ) ) && ( s . versions . FirstOrDefault ( x => ver . ToLower ( ) . StartsWith ( x . version . ToLower ( ) ) && x . id != v . id && x . binary_release_channels . nodes . Count > 0 ) == null || v . versionCode . ToString ( ) == ver . Trim ( ) . Substring ( ver . Trim ( ) . Length - v . versionCode . ToString ( ) . Length ) ) || v . id == ver ) && v . binary_release_channels . nodes . Count > 0 )
14611464 {
14621465 selected = v ;
14631466 choosen = true ;
@@ -1611,13 +1614,18 @@ public void StartDownload(OculusBinary binary, string appId, string appName, boo
16111614 Console . WriteLine ( "Couldn't get obbs from Oculus. Unknown error. Trying with OculusDB now" ) ;
16121615 try
16131616 {
1614- DBVersion version = JsonSerializer . Deserialize < DBVersion > ( new WebClient ( ) . DownloadString ( "https://oculusdb-rewrite.rui2015.me/api/v2/id/" + binary . id ) ) ;
1615-
1616- if ( version . obbBinary != null )
1617+ DBVersion version = JsonSerializer . Deserialize < DBVersion > ( new WebClient ( ) . DownloadString ( "https://oculusdb.rui2015.me/api/v1/id/" + binary . id ) ) ;
1618+
1619+
1620+
1621+ if ( version . obbList != null )
16171622 {
16181623 List < Obb > obbs = new List < Obb > ( ) ;
1619- obbs . Add ( new Obb { filename = version . obbBinary . filename , bytes = version . obbBinary . size , id = version . obbBinary . id } ) ;
1620- GameDownloader . DownloadObbFiles ( baseDirectory + "obbs" + Path . DirectorySeparatorChar , DecryptToken ( ) , obbs ) ;
1624+ foreach ( OBBBinary obbBinary in version . obbList )
1625+ {
1626+ obbs . Add ( new Obb { filename = obbBinary . file_name , bytes = obbBinary . sizeNumerical , id = obbBinary . id } ) ;
1627+ }
1628+ GameDownloader . DownloadObbFiles ( baseDirectory + "obbs" + Path . DirectorySeparatorChar , DecryptToken ( ) , obbs ) ;
16211629 }
16221630 else
16231631 {
0 commit comments