Compare commits

...

8 Commits

Author SHA1 Message Date
oSumAtrIX
4505f10e50 build: bump version number 2022-12-14 06:04:42 +01:00
oSumAtrIX
3ce3df5e19 build: bump patcher version 2022-12-14 06:04:10 +01:00
Ushie
8d4e4ba6c9 feat: display app's patch count in appcard 2022-12-14 02:12:57 +03:00
Ushie
d78868b462 feat: filter apps by patch count 2022-12-14 01:52:06 +03:00
Canny
01a681ad00 build: bump version to v0.0.48 2022-12-12 22:34:39 +03:00
Canny
adfeb61eab fix: print patch fail cause if message is null 2022-12-12 22:32:11 +03:00
Ushie
8c3faac343 build: bump version to v0.0.47 2022-12-12 17:09:32 +03:00
Ushie
c81acce31c feat: improve patch fail logging 2022-12-12 17:09:32 +03:00
7 changed files with 38 additions and 16 deletions

View File

@@ -71,7 +71,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// ReVanced // ReVanced
implementation "app.revanced:revanced-patcher:6.3.0" implementation "app.revanced:revanced-patcher:6.3.1"
// Signing & aligning // Signing & aligning
implementation("org.bouncycastle:bcpkix-jdk15on:1.70") implementation("org.bouncycastle:bcpkix-jdk15on:1.70")

View File

@@ -196,7 +196,7 @@ class MainActivity : FlutterActivity() {
} }
return@forEach return@forEach
} }
val msg = "$patch failed.\nError:\n" + res.exceptionOrNull()!!.printStackTrace() val msg = "Failed to apply $patch: " + "${res.exceptionOrNull()!!.message ?: res.exceptionOrNull()!!.cause!!::class.simpleName}"
handler.post { handler.post {
installerChannel.invokeMethod( installerChannel.invokeMethod(
"update", "update",

View File

@@ -94,15 +94,14 @@ class PatcherAPI {
return filteredApps; return filteredApps;
} }
Future<List<Patch>> getFilteredPatches(String packageName) async { List<Patch> getFilteredPatches(String packageName) {
List<Patch> filteredPatches = []; List<Patch> filteredPatches = [];
_patches.forEach((patch) { _patches.forEach((patch) {
if (patch.compatiblePackages.isEmpty) { if (patch.compatiblePackages.isEmpty) {
filteredPatches.add(patch); filteredPatches.add(patch);
} else { } else {
if (!patch.name.contains('settings') && if (!patch.name.contains('settings') &&
patch.compatiblePackages.any((pack) => pack.name == packageName) patch.compatiblePackages.any((pack) => pack.name == packageName)) {
) {
filteredPatches.add(patch); filteredPatches.add(patch);
} }
} }

View File

@@ -92,6 +92,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
name: app.appName, name: app.appName,
pkgName: app.packageName, pkgName: app.packageName,
icon: app.icon, icon: app.icon,
patchesCount: model.patchesCount(app.packageName),
onTap: () { onTap: () {
model.selectApp(app); model.selectApp(app);
Navigator.of(context).pop(); Navigator.of(context).pop();

View File

@@ -2,7 +2,6 @@ import 'dart:io';
import 'package:device_apps/device_apps.dart'; import 'package:device_apps/device_apps.dart';
import 'package:file_picker/file_picker.dart'; import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/app/app.locator.dart';
import 'package:revanced_manager/models/patched_application.dart'; import 'package:revanced_manager/models/patched_application.dart';
import 'package:revanced_manager/services/patcher_api.dart'; import 'package:revanced_manager/services/patcher_api.dart';
@@ -16,10 +15,16 @@ class AppSelectorViewModel extends BaseViewModel {
final Toast _toast = locator<Toast>(); final Toast _toast = locator<Toast>();
final List<ApplicationWithIcon> apps = []; final List<ApplicationWithIcon> apps = [];
bool noApps = false; bool noApps = false;
int patchesCount(String packageName) {
return _patcherAPI.getFilteredPatches(packageName).length;
}
Future<void> initialize() async { Future<void> initialize() async {
apps.addAll(await _patcherAPI.getFilteredInstalledApps()); apps.addAll(await _patcherAPI.getFilteredInstalledApps());
apps.sort((a, b) => a.appName.compareTo(b.appName)); apps.sort(((a, b) => _patcherAPI
.getFilteredPatches(b.packageName)
.length
.compareTo(_patcherAPI.getFilteredPatches(a.packageName).length)));
noApps = apps.isEmpty; noApps = apps.isEmpty;
notifyListeners(); notifyListeners();
} }

View File

@@ -6,6 +6,7 @@ class InstalledAppItem extends StatefulWidget {
final String name; final String name;
final String pkgName; final String pkgName;
final Uint8List icon; final Uint8List icon;
final int patchesCount;
final Function()? onTap; final Function()? onTap;
const InstalledAppItem({ const InstalledAppItem({
@@ -13,6 +14,7 @@ class InstalledAppItem extends StatefulWidget {
required this.name, required this.name,
required this.pkgName, required this.pkgName,
required this.icon, required this.icon,
required this.patchesCount,
this.onTap, this.onTap,
}) : super(key: key); }) : super(key: key);
@@ -45,14 +47,29 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Row(
widget.name, crossAxisAlignment: CrossAxisAlignment.center,
maxLines: 2, children: <Widget>[
overflow: TextOverflow.visible, Text(
style: const TextStyle( widget.name,
fontSize: 16, maxLines: 2,
fontWeight: FontWeight.w500, overflow: TextOverflow.visible,
), style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 6),
Text(
widget.patchesCount == 1
? "${widget.patchesCount} patch"
: "${widget.patchesCount} patches",
style: TextStyle(
fontSize: 8,
color: Theme.of(context).colorScheme.secondary,
),
),
],
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text(widget.pkgName), Text(widget.pkgName),

View File

@@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
publish_to: 'none' publish_to: 'none'
version: 0.0.46+46 version: 0.0.49+49
environment: environment:
sdk: ">=2.17.5 <3.0.0" sdk: ">=2.17.5 <3.0.0"