Skip to content

Commit

Permalink
Bugfix: Missing request headers for direct APK link apps (#1688)
Browse files Browse the repository at this point in the history
  • Loading branch information
Imran Remtulla committed Jun 29, 2024
1 parent bb45a15 commit d391c5c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 8 additions & 0 deletions lib/app_sources/directAPKLink.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ class DirectAPKLink extends AppSource {
];
}

@override
Future<Map<String, String>?> getRequestHeaders(
Map<String, dynamic> additionalSettings,
{bool forAPKDownload = false}) {
return html.getRequestHeaders(additionalSettings,
forAPKDownload: forAPKDownload);
}

@override
Future<APKDetails> getLatestAPKDetails(
String standardUrl,
Expand Down
11 changes: 7 additions & 4 deletions lib/app_sources/html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,13 @@ class HTML extends AppSource {
additionalSettings['versionExtractWholePage'] == true
? versionExtractionWholePageString
: relDecoded);
version ??=
additionalSettings['defaultPseudoVersioningMethod'] == 'APKLinkHash'
? rel.hashCode.toString()
: (await checkPartialDownloadHashDynamic(rel)).toString();
version ??= additionalSettings['defaultPseudoVersioningMethod'] ==
'APKLinkHash'
? rel.hashCode.toString()
: (await checkPartialDownloadHashDynamic(rel,
headers: await getRequestHeaders(additionalSettings,
forAPKDownload: true)))
.toString();
return APKDetails(version, [rel].map((e) => MapEntry(e, e)).toList(),
AppNames(uri.host, tr('app')));
}
Expand Down

0 comments on commit d391c5c

Please sign in to comment.