Skip to content

Commit

Permalink
Merge pull request #1631 from ImranR98/dev
Browse files Browse the repository at this point in the history
- Don't use partial downloads for BG tasks (more reliable)
- More accurate error reports for Huawei AppGallery fails
- Various bugfixes
- Update Flutter
  • Loading branch information
ImranR98 authored May 18, 2024
2 parents cbe41de + 0e2fa96 commit 1e3815c
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 150 deletions.
2 changes: 1 addition & 1 deletion .flutter
Submodule .flutter updated 2061 files
20 changes: 11 additions & 9 deletions lib/app_sources/huaweiappgallery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,23 @@ class HuaweiAppGallery extends AppSource {
throw NoReleasesError();
}
String appId = appIdFromRedirectDlUrl(res.headers['location']!);
if (appId.isEmpty) {
throw NoReleasesError();
}
var relDateStr =
res.headers['location']?.split('?')[0].split('.').reversed.toList()[1];
var relDateStrAdj = relDateStr?.split('');
var tempLen = relDateStrAdj?.length ?? 0;
if (relDateStr == null || relDateStr.length != 10) {
throw NoVersionError();
}
var relDateStrAdj = relDateStr.split('');
var tempLen = relDateStrAdj.length;
var i = 2;
while (i < tempLen) {
relDateStrAdj?.insert((i + i ~/ 2 - 1), '-');
relDateStrAdj.insert((i + i ~/ 2 - 1), '-');
i += 2;
}
var relDate = relDateStrAdj == null
? null
: DateFormat('yy-MM-dd-HH-mm', 'en_US').parse(relDateStrAdj.join(''));
if (relDateStr == null) {
throw NoVersionError();
}
var relDate =
DateFormat('yy-MM-dd-HH-mm', 'en_US').parse(relDateStrAdj.join(''));
return APKDetails(
relDateStr, [MapEntry('$appId.apk', dlUrl)], AppNames(name, appId),
releaseDate: relDate);
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class _ObtainiumState extends State<Obtainium> {
// set the background and surface colors to pure black in the amoled theme
if (settingsProvider.useBlackTheme) {
darkColorScheme = darkColorScheme
.copyWith(background: Colors.black, surface: Colors.black)
.copyWith(surface: Colors.black)
.harmonized();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/pages/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class _AppPageState extends State<AppPage> {
? WebViewWidget(
controller: WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(Theme.of(context).colorScheme.background)
..setBackgroundColor(Theme.of(context).colorScheme.surface)
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate(
NavigationDelegate(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/apps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ class AppsPageState extends State<AppsPage> {
);

var transparent =
Theme.of(context).colorScheme.background.withAlpha(0).value;
Theme.of(context).colorScheme.surface.withAlpha(0).value;
List<double> stops = [
...listedApps[index].app.categories.asMap().entries.map(
(e) => ((e.key / (listedApps[index].app.categories.length - 1)))),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class _HomePageState extends State<HomePage> {
}) !=
null) {
// ignore: use_build_context_synchronously
var appsProvider = await context.read<AppsProvider>();
var appsProvider = context.read<AppsProvider>();
var result = await appsProvider.import(action == 'app'
? '{ "apps": [$dataStr] }'
: '{ "apps": $dataStr }');
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/import_export.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class _ImportExportPageState extends State<ImportExportPage> {
var settingsProvider = context.watch<SettingsProvider>();

var outlineButtonStyle = ButtonStyle(
shape: MaterialStateProperty.all(
shape: WidgetStateProperty.all(
StadiumBorder(
side: BorderSide(
width: 1,
Expand Down
Loading

0 comments on commit 1e3815c

Please sign in to comment.