Compare commits

...

6 Commits

8 changed files with 38 additions and 14 deletions

View File

@ -69,9 +69,10 @@ class GitHub implements AppSource {
if (!includePrereleases && releases[i]['prerelease'] == true) {
continue;
}
if (regexFilter != null &&
!RegExp(regexFilter)
.hasMatch((releases[i]['name'] as String).trim())) {
.hasMatch((releases[i]['tag_name'] as String).trim())) {
continue;
}
var apkUrls = getReleaseAPKUrls(releases[i]);

View File

@ -14,7 +14,7 @@ import 'package:workmanager/workmanager.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:device_info_plus/device_info_plus.dart';
const String currentVersion = '0.6.2';
const String currentVersion = '0.6.4';
const String currentReleaseTag =
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES

View File

@ -121,8 +121,10 @@ class _AddAppPageState extends State<AddAppPage> {
app.preferredApkIndex =
app.apkUrls.indexOf(apkUrl);
var downloadedApk =
await appsProvider
.downloadApp(app);
await appsProvider.downloadApp(
app,
showOccasionalProgressToast:
true);
app.id = downloadedApk.appId;
if (appsProvider.apps
.containsKey(app.id)) {

View File

@ -62,10 +62,13 @@ class _AppPageState extends State<AppPage> {
children: [
Image.memory(
app!.installedInfo!.icon!,
scale: 1.5,
height: 150,
)
])
: Container(),
const SizedBox(
height: 25,
),
Text(
app?.installedInfo?.name ?? app?.app.name ?? 'App',
textAlign: TextAlign.center,

View File

@ -212,8 +212,15 @@ class AppsPageState extends State<AppsPage> {
)),
],
)
: Text(sortedApps[index].app.installedVersion ??
'Not Installed')),
: SingleChildScrollView(
child: SizedBox(
width: 80,
child: Text(
sortedApps[index].app.installedVersion ??
'Not Installed',
overflow: TextOverflow.fade,
textAlign: TextAlign.end,
)))),
onTap: () {
if (selectedIds.isNotEmpty) {
toggleAppSelected(sortedApps[index].app.id);

View File

@ -8,6 +8,7 @@ import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:install_plugin_v2/install_plugin_v2.dart';
import 'package:installed_apps/app_info.dart';
import 'package:installed_apps/installed_apps.dart';
@ -115,7 +116,9 @@ class AppsProvider with ChangeNotifier {
// Downloads the App (preferred URL) and returns an ApkFile object
// If the app was already saved, updates it's download progress % in memory
// But also works for Apps that are not saved
Future<DownloadedApp> downloadApp(App app) async {
Future<DownloadedApp> downloadApp(App app,
{bool showOccasionalProgressToast = false}) async {
int? prevProg;
var fileName = '${app.id}-${app.latestVersion}-${app.preferredApkIndex}';
File downloadFile = await downloadApk(app.apkUrls[app.preferredApkIndex],
'${app.id}-${app.latestVersion}-${app.preferredApkIndex}',
@ -123,6 +126,14 @@ class AppsProvider with ChangeNotifier {
if (apps[app.id] != null) {
apps[app.id]!.downloadProgress = progress;
}
int? prog = progress?.ceil();
if (showOccasionalProgressToast &&
(prog == 25 || prog == 50 || prog == 75) &&
prevProg != prog) {
Fluttertoast.showToast(
msg: 'Progress: $prog%', toastLength: Toast.LENGTH_SHORT);
}
prevProg = prog;
notifyListeners();
}, SourceProvider().getSource(app.url).apkUrlPrefetchModifier);
// Delete older versions of the APK if any
@ -291,7 +302,7 @@ class AppsProvider with ChangeNotifier {
}
// If Obtainium is being installed, it should be the last one
List<DownloadedApp> moveObtainiumToEnd(List<DownloadedApp> items) {
List<DownloadedApp> moveObtainiumToStart(List<DownloadedApp> items) {
String obtainiumId = 'imranr98_obtainium_${GitHub().host}';
DownloadedApp? temp;
items.removeWhere((element) {
@ -302,7 +313,7 @@ class AppsProvider with ChangeNotifier {
return res;
});
if (temp != null) {
items.add(temp!);
items = [temp!, ...items];
}
return items;
}
@ -310,8 +321,8 @@ class AppsProvider with ChangeNotifier {
// TODO: Remove below line if silentupdates are ever figured out
regularInstalls.addAll(silentUpdates);
silentUpdates = moveObtainiumToEnd(silentUpdates);
regularInstalls = moveObtainiumToEnd(regularInstalls);
silentUpdates = moveObtainiumToStart(silentUpdates);
regularInstalls = moveObtainiumToStart(regularInstalls);
// TODO: Uncomment below if silentupdates are ever figured out
// for (var u in silentUpdates) {

View File

@ -210,7 +210,7 @@ class SourceProvider {
? name
: names.name[0].toUpperCase() + names.name.substring(1),
null,
apk.version,
apk.version.replaceAll('/', '-'),
apk.apkUrls,
apk.apkUrls.length - 1,
additionalData,

View File

@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.6.2+46 # When changing this, update the tag in main() accordingly
version: 0.6.4+48 # When changing this, update the tag in main() accordingly
environment:
sdk: '>=2.18.2 <3.0.0'