Restore RuStore support through replace URL of API.

If the application is published as an AAB,
then the old one produced an unusable file (one of split files).
The new one provide a monolithic file.
This commit is contained in:
kvak54
2025-09-14 21:07:32 +07:00
parent a56069e881
commit 123cd5b130

View File

@@ -80,20 +80,20 @@ class RuStore extends AppSource {
}
Response res1 = await sourceRequest(
'https://backapi.rustore.ru/applicationData/download-link',
'https://backapi.rustore.ru/applicationData/v2/download-link',
additionalSettings,
followRedirects: false,
postBody: {"appId": appDetails['appId'], "firstInstall": true},
);
var downloadDetails = (await decodeJsonBody(res1.bodyBytes))['body'];
if (res1.statusCode != 200 || downloadDetails['apkUrl'] == null) {
if (res1.statusCode != 200 || downloadDetails['downloadUrls'][0]['url'] == null) {
throw NoAPKError();
}
return APKDetails(
version,
getApkUrlsFromUrls([
(downloadDetails['apkUrl'] as String).replaceAll(
(downloadDetails['downloadUrls'][0]['url'] as String).replaceAll(
RegExp('\\.zip\$'),
'.apk',
),