mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: Remove original package name in app info view
This commit is contained in:
parent
0492e910ea
commit
91837ebade
@ -278,7 +278,6 @@
|
|||||||
"rootDialogText": "App was installed with superuser permissions, but currently ReVanced Manager has no permissions.\nPlease grant superuser permissions first.",
|
"rootDialogText": "App was installed with superuser permissions, but currently ReVanced Manager has no permissions.\nPlease grant superuser permissions first.",
|
||||||
|
|
||||||
"packageNameLabel": "Package name",
|
"packageNameLabel": "Package name",
|
||||||
"originalPackageNameLabel": "Original package name",
|
|
||||||
"installTypeLabel": "Installation type",
|
"installTypeLabel": "Installation type",
|
||||||
"rootTypeLabel": "Root",
|
"rootTypeLabel": "Root",
|
||||||
"nonRootTypeLabel": "Non-root",
|
"nonRootTypeLabel": "Non-root",
|
||||||
|
@ -9,7 +9,6 @@ class PatchedApplication {
|
|||||||
PatchedApplication({
|
PatchedApplication({
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.packageName,
|
required this.packageName,
|
||||||
required this.originalPackageName,
|
|
||||||
required this.version,
|
required this.version,
|
||||||
required this.apkFilePath,
|
required this.apkFilePath,
|
||||||
required this.icon,
|
required this.icon,
|
||||||
@ -23,7 +22,6 @@ class PatchedApplication {
|
|||||||
_$PatchedApplicationFromJson(json);
|
_$PatchedApplicationFromJson(json);
|
||||||
String name;
|
String name;
|
||||||
String packageName;
|
String packageName;
|
||||||
String originalPackageName;
|
|
||||||
String version;
|
String version;
|
||||||
final String apkFilePath;
|
final String apkFilePath;
|
||||||
@JsonKey(
|
@JsonKey(
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import 'dart:convert';
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
@ -7,7 +6,6 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||||
import 'package:injectable/injectable.dart';
|
import 'package:injectable/injectable.dart';
|
||||||
import 'package:revanced_manager/app/app.locator.dart';
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:revanced_manager/models/patch.dart';
|
|
||||||
import 'package:revanced_manager/services/manager_api.dart';
|
import 'package:revanced_manager/services/manager_api.dart';
|
||||||
|
|
||||||
@lazySingleton
|
@lazySingleton
|
||||||
|
@ -520,7 +520,6 @@ class ManagerAPI {
|
|||||||
PatchedApplication(
|
PatchedApplication(
|
||||||
name: application.appName,
|
name: application.appName,
|
||||||
packageName: application.packageName,
|
packageName: application.packageName,
|
||||||
originalPackageName: application.packageName,
|
|
||||||
version: application.versionName!,
|
version: application.versionName!,
|
||||||
apkFilePath: application.apkFilePath,
|
apkFilePath: application.apkFilePath,
|
||||||
icon: application.icon,
|
icon: application.icon,
|
||||||
|
@ -73,7 +73,6 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||||||
locator<PatcherViewModel>().selectedApp = PatchedApplication(
|
locator<PatcherViewModel>().selectedApp = PatchedApplication(
|
||||||
name: application.appName,
|
name: application.appName,
|
||||||
packageName: application.packageName,
|
packageName: application.packageName,
|
||||||
originalPackageName: application.packageName,
|
|
||||||
version: application.versionName!,
|
version: application.versionName!,
|
||||||
apkFilePath: application.apkFilePath,
|
apkFilePath: application.apkFilePath,
|
||||||
icon: application.icon,
|
icon: application.icon,
|
||||||
@ -202,7 +201,6 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||||||
locator<PatcherViewModel>().selectedApp = PatchedApplication(
|
locator<PatcherViewModel>().selectedApp = PatchedApplication(
|
||||||
name: application.appName,
|
name: application.appName,
|
||||||
packageName: application.packageName,
|
packageName: application.packageName,
|
||||||
originalPackageName: application.packageName,
|
|
||||||
version: application.versionName!,
|
version: application.versionName!,
|
||||||
apkFilePath: result.files.single.path!,
|
apkFilePath: result.files.single.path!,
|
||||||
icon: application.icon,
|
icon: application.icon,
|
||||||
|
@ -142,9 +142,9 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
this.selectedPatches.clear();
|
this.selectedPatches.clear();
|
||||||
removedPatches.clear();
|
removedPatches.clear();
|
||||||
final List<String> selectedPatches =
|
final List<String> selectedPatches =
|
||||||
await _managerAPI.getSelectedPatches(selectedApp!.originalPackageName);
|
await _managerAPI.getSelectedPatches(selectedApp!.packageName);
|
||||||
final List<Patch> patches =
|
final List<Patch> patches =
|
||||||
_patcherAPI.getFilteredPatches(selectedApp!.originalPackageName);
|
_patcherAPI.getFilteredPatches(selectedApp!.packageName);
|
||||||
this
|
this
|
||||||
.selectedPatches
|
.selectedPatches
|
||||||
.addAll(patches.where((patch) => selectedPatches.contains(patch.name)));
|
.addAll(patches.where((patch) => selectedPatches.contains(patch.name)));
|
||||||
@ -160,7 +160,7 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
.selectedPatches
|
.selectedPatches
|
||||||
.removeWhere((patch) => patch.compatiblePackages.isEmpty);
|
.removeWhere((patch) => patch.compatiblePackages.isEmpty);
|
||||||
}
|
}
|
||||||
final usedPatches = _managerAPI.getUsedPatches(selectedApp!.originalPackageName);
|
final usedPatches = _managerAPI.getUsedPatches(selectedApp!.packageName);
|
||||||
for (final patch in usedPatches){
|
for (final patch in usedPatches){
|
||||||
if (!patches.any((p) => p.name == patch.name)){
|
if (!patches.any((p) => p.name == patch.name)){
|
||||||
removedPatches.add('\u2022 ${patch.name}');
|
removedPatches.add('\u2022 ${patch.name}');
|
||||||
|
@ -28,7 +28,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
getPatchesVersion().whenComplete(() => notifyListeners());
|
getPatchesVersion().whenComplete(() => notifyListeners());
|
||||||
patches.addAll(
|
patches.addAll(
|
||||||
_patcherAPI.getFilteredPatches(
|
_patcherAPI.getFilteredPatches(
|
||||||
selectedApp!.originalPackageName,
|
selectedApp!.packageName,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
patches.sort((a, b) {
|
patches.sort((a, b) {
|
||||||
@ -98,11 +98,11 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
|
|
||||||
void selectDefaultPatches() {
|
void selectDefaultPatches() {
|
||||||
selectedPatches.clear();
|
selectedPatches.clear();
|
||||||
if (locator<PatcherViewModel>().selectedApp?.originalPackageName != null) {
|
if (locator<PatcherViewModel>().selectedApp?.packageName != null) {
|
||||||
selectedPatches.addAll(
|
selectedPatches.addAll(
|
||||||
_patcherAPI
|
_patcherAPI
|
||||||
.getFilteredPatches(
|
.getFilteredPatches(
|
||||||
locator<PatcherViewModel>().selectedApp!.originalPackageName,
|
locator<PatcherViewModel>().selectedApp!.packageName,
|
||||||
)
|
)
|
||||||
.where(
|
.where(
|
||||||
(element) =>
|
(element) =>
|
||||||
@ -187,7 +187,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
final List<String> selectedPatches =
|
final List<String> selectedPatches =
|
||||||
this.selectedPatches.map((patch) => patch.name).toList();
|
this.selectedPatches.map((patch) => patch.name).toList();
|
||||||
await _managerAPI.setSelectedPatches(
|
await _managerAPI.setSelectedPatches(
|
||||||
locator<PatcherViewModel>().selectedApp!.originalPackageName,
|
locator<PatcherViewModel>().selectedApp!.packageName,
|
||||||
selectedPatches,
|
selectedPatches,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
Future<void> loadSelectedPatches(BuildContext context) async {
|
Future<void> loadSelectedPatches(BuildContext context) async {
|
||||||
if (_managerAPI.isPatchesChangeEnabled()) {
|
if (_managerAPI.isPatchesChangeEnabled()) {
|
||||||
final List<String> selectedPatches = await _managerAPI.getSelectedPatches(
|
final List<String> selectedPatches = await _managerAPI.getSelectedPatches(
|
||||||
locator<PatcherViewModel>().selectedApp!.originalPackageName,
|
locator<PatcherViewModel>().selectedApp!.packageName,
|
||||||
);
|
);
|
||||||
if (selectedPatches.isNotEmpty) {
|
if (selectedPatches.isNotEmpty) {
|
||||||
this.selectedPatches.clear();
|
this.selectedPatches.clear();
|
||||||
|
@ -222,22 +222,6 @@ class AppInfoView extends StatelessWidget {
|
|||||||
subtitle: Text(app.packageName),
|
subtitle: Text(app.packageName),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
ListTile(
|
|
||||||
contentPadding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 20.0),
|
|
||||||
title: I18nText(
|
|
||||||
'appInfoView.originalPackageNameLabel',
|
|
||||||
child: const Text(
|
|
||||||
'',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Text(app.originalPackageName),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding:
|
contentPadding:
|
||||||
const EdgeInsets.symmetric(horizontal: 20.0),
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
|
@ -13,7 +13,6 @@ import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
|||||||
import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
|
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
|
||||||
import 'package:revanced_manager/utils/string.dart';
|
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
class AppInfoViewModel extends BaseViewModel {
|
class AppInfoViewModel extends BaseViewModel {
|
||||||
|
Loading…
Reference in New Issue
Block a user