mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-24 11:41:01 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4505f10e50 | ||
|
|
3ce3df5e19 | ||
|
|
8d4e4ba6c9 | ||
|
|
d78868b462 | ||
|
|
01a681ad00 | ||
|
|
adfeb61eab | ||
|
|
8c3faac343 | ||
|
|
c81acce31c |
@@ -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")
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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),
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user