mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-18 23:16:50 +08:00
Compare commits
35 Commits
Author | SHA1 | Date | |
---|---|---|---|
f9242c1958 | |||
f9865166b0 | |||
f0f934f6a1 | |||
3d25655851 | |||
733190e76c | |||
ab312dec43 | |||
70159b8cd8 | |||
97060913a2 | |||
4a0c5f9935 | |||
f643a31455 | |||
03b87a50ea | |||
4631982d42 | |||
4c4b694db9 | |||
fd099fb632 | |||
e374e03355 | |||
d0293f5412 | |||
6f72c2ebec | |||
07407933d9 | |||
2f4726ea68 | |||
207e94de5a | |||
7231d44e02 | |||
bd5b38d88e | |||
530dd78752 | |||
efcf455b24 | |||
bed2cf76d5 | |||
5c8079ae95 | |||
2a2bb8212f | |||
3e6e94c098 | |||
ce100d97fd | |||
743a661c10 | |||
2b7287c04c | |||
9bdccb3c9d | |||
b8171253c7 | |||
d6dde3e23b | |||
fc5414c788 |
55
.github/ISSUE_TEMPLATE/bug-issue.yml
vendored
55
.github/ISSUE_TEMPLATE/bug-issue.yml
vendored
@ -20,10 +20,12 @@ body:
|
|||||||
- Other
|
- Other
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: dropdown
|
||||||
attributes:
|
attributes:
|
||||||
label: Branch
|
label: Manager Branch
|
||||||
description: Which github branch did you use (Flutter or Compose)?
|
options:
|
||||||
|
- Flutter
|
||||||
|
- Compose
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
@ -41,11 +43,56 @@ body:
|
|||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Relevant log output
|
label: Android version
|
||||||
|
description: Android version used.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Manager version
|
||||||
|
description: Manager version used.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Target package name
|
||||||
|
description: App you tried to patch.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Target package version.
|
||||||
|
description: Version of the app you tried to patch.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Installation type
|
||||||
|
options:
|
||||||
|
- Non-root
|
||||||
|
- Root
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Patches selected.
|
||||||
|
description: Patches you selected for the app.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Device logs (exported using Manager settings).
|
||||||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
||||||
render: shell
|
render: shell
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Installer logs (exported using Installer menu option) [unneeded if issue is not during patching].
|
||||||
|
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
||||||
|
render: shell
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Screenshots or videos
|
label: Screenshots or videos
|
||||||
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
blank_issues_enabled: false
|
8
.github/ISSUE_TEMPLATE/feature-issue.yml
vendored
8
.github/ISSUE_TEMPLATE/feature-issue.yml
vendored
@ -12,10 +12,12 @@ body:
|
|||||||
- Other
|
- Other
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: dropdown
|
||||||
attributes:
|
attributes:
|
||||||
label: Branch
|
label: Manager Branch
|
||||||
description: Which github branch did you use (Flutter or Compose)?
|
options:
|
||||||
|
- Flutter
|
||||||
|
- Compose
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
@ -16,4 +16,5 @@ If you wish to discuss the Manager, a thread has been made under the [#chat](htt
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
1. Android 8 or higher.
|
1. Android 8 or higher.
|
||||||
2. For YouTube and YouTube Music - Vanced MicroG(Only for non-root).
|
2. Does not work on armv7
|
||||||
|
3. For YouTube and YouTube Music - Vanced MicroG(Only for non-root).
|
||||||
|
@ -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:4.4.2"
|
implementation "app.revanced:revanced-patcher:5.0.0"
|
||||||
|
|
||||||
// Signing & aligning
|
// Signing & aligning
|
||||||
implementation("org.bouncycastle:bcpkix-jdk15on:1.70")
|
implementation("org.bouncycastle:bcpkix-jdk15on:1.70")
|
||||||
|
@ -14,18 +14,18 @@
|
|||||||
"widgetTitle": "Dashboard",
|
"widgetTitle": "Dashboard",
|
||||||
"updatesSubtitle": "Updates",
|
"updatesSubtitle": "Updates",
|
||||||
"patchedSubtitle": "Patched Applications",
|
"patchedSubtitle": "Patched Applications",
|
||||||
"updatesAvailable": "Updates Available",
|
"updatesAvailable": "Updates available",
|
||||||
"noUpdates": "No updates available",
|
"noUpdates": "No updates available",
|
||||||
"noInstallations": "No patched applications installed",
|
"noInstallations": "No patched applications installed",
|
||||||
"installed": "Installed",
|
"installed": "Installed",
|
||||||
"updateDialogTitle": "Update",
|
"updateDialogTitle": "Update Manager",
|
||||||
"updateDialogText": "Are you sure you want to download and update Manager?",
|
"updateDialogText": "Are you sure you want to download and update ReVanced Manager?",
|
||||||
"notificationTitle": "ReVanced Manager was updated!",
|
"notificationTitle": "ReVanced Manager was updated",
|
||||||
"notificationText": "Tap to open the app",
|
"notificationText": "Tap to open the app",
|
||||||
"downloadingMessage": "Downloading update!",
|
"downloadingMessage": "Downloading update...",
|
||||||
"installingMessage": "Installing update... Hang on!",
|
"installingMessage": "Installing update...",
|
||||||
"errorDownloadMessage": "Unable to download update!",
|
"errorDownloadMessage": "Unable to download update",
|
||||||
"errorInstallMessage": "Unable to install update!",
|
"errorInstallMessage": "Unable to install update",
|
||||||
"noConnection": "No internet connection"
|
"noConnection": "No internet connection"
|
||||||
},
|
},
|
||||||
"applicationItem": {
|
"applicationItem": {
|
||||||
@ -34,7 +34,7 @@
|
|||||||
"changelogLabel": "Changelog"
|
"changelogLabel": "Changelog"
|
||||||
},
|
},
|
||||||
"latestCommitCard": {
|
"latestCommitCard": {
|
||||||
"loadingLabel": "Loading",
|
"loadingLabel": "Loading...",
|
||||||
"timeagoLabel": "{time} ago",
|
"timeagoLabel": "{time} ago",
|
||||||
"patcherLabel": "Patcher: ",
|
"patcherLabel": "Patcher: ",
|
||||||
"managerLabel": "Manager: ",
|
"managerLabel": "Manager: ",
|
||||||
@ -44,12 +44,12 @@
|
|||||||
"widgetTitle": "Patcher",
|
"widgetTitle": "Patcher",
|
||||||
"patchButton": "Patch",
|
"patchButton": "Patch",
|
||||||
"patchDialogTitle": "Warning",
|
"patchDialogTitle": "Warning",
|
||||||
"patchDialogText": "You have selected a resource patch and a split APK installation was detected so patching errors can occur.\nAre you sure you want to proceed with patching a split base APK?"
|
"patchDialogText": "You have selected a resource patch and a split APK installation was detected so patching errors may occur.\nAre you sure you want to proceed with patching a split base APK?"
|
||||||
},
|
},
|
||||||
"appSelectorCard": {
|
"appSelectorCard": {
|
||||||
"widgetTitle": "Select application",
|
"widgetTitle": "Select application",
|
||||||
"widgetTitleSelected": "Selected application",
|
"widgetTitleSelected": "Selected application",
|
||||||
"widgetSubtitle": "No application selected.",
|
"widgetSubtitle": "No application selected",
|
||||||
"noAppsLabel": "No applications found.",
|
"noAppsLabel": "No applications found.",
|
||||||
"currentVersion": "Current",
|
"currentVersion": "Current",
|
||||||
"recommendedVersion": "Recommended",
|
"recommendedVersion": "Recommended",
|
||||||
@ -58,22 +58,24 @@
|
|||||||
"patchSelectorCard": {
|
"patchSelectorCard": {
|
||||||
"widgetTitle": "Select patches",
|
"widgetTitle": "Select patches",
|
||||||
"widgetTitleSelected": "Selected patches",
|
"widgetTitleSelected": "Selected patches",
|
||||||
"widgetSubtitle": "Select an application first.",
|
"widgetSubtitle": "Select an application first",
|
||||||
"widgetEmptySubtitle": "No patches selected."
|
"widgetEmptySubtitle": "No patches selected"
|
||||||
},
|
},
|
||||||
"socialMediaCard": {
|
"socialMediaCard": {
|
||||||
"widgetTitle": "Social Media",
|
"widgetTitle": "Socials",
|
||||||
"widgetSubtitle": "We are online!"
|
"widgetSubtitle": "We are online!"
|
||||||
},
|
},
|
||||||
"appSelectorView": {
|
"appSelectorView": {
|
||||||
|
"viewTitle": "Select application",
|
||||||
"searchBarHint": "Search applications",
|
"searchBarHint": "Search applications",
|
||||||
"storageButton": "Storage",
|
"storageButton": "Storage",
|
||||||
"errorMessage": "Unable to use selected application."
|
"errorMessage": "Unable to use selected application."
|
||||||
},
|
},
|
||||||
"patchesSelectorView": {
|
"patchesSelectorView": {
|
||||||
|
"viewTitle": "Select patches",
|
||||||
"searchBarHint": "Search patches",
|
"searchBarHint": "Search patches",
|
||||||
"doneButton": "Done",
|
"doneButton": "Done",
|
||||||
"noPatchesFound": "No patches found for the selected app."
|
"noPatchesFound": "No patches found for the selected app"
|
||||||
},
|
},
|
||||||
"patchItem": {
|
"patchItem": {
|
||||||
"unsupportedWarningButton": "Unsupported version",
|
"unsupportedWarningButton": "Unsupported version",
|
||||||
@ -93,12 +95,12 @@
|
|||||||
"installErrorDialogTitle": "Error",
|
"installErrorDialogTitle": "Error",
|
||||||
"installErrorDialogText1": "Root install is not possible with the current patches selection.\nRepatch your app or choose non-root install.",
|
"installErrorDialogText1": "Root install is not possible with the current patches selection.\nRepatch your app or choose non-root install.",
|
||||||
"installErrorDialogText2": "Non-root install is not possible with the current patches selection.\nRepatch your app or choose root install if you have your device rooted.",
|
"installErrorDialogText2": "Non-root install is not possible with the current patches selection.\nRepatch your app or choose root install if you have your device rooted.",
|
||||||
"installErrorDialogText3": "Root install is not possible as the original APK was selected from storage.\nSelect an installed app or choose non-root install."
|
"installErrorDialogText3": "Root install is not possible as the original APK was selected from storage.\nSelect an installed app or choose non-root install.",
|
||||||
|
"noExit": "Installer is still running..."
|
||||||
},
|
},
|
||||||
"settingsView": {
|
"settingsView": {
|
||||||
"widgetTitle": "Settings",
|
"widgetTitle": "Settings",
|
||||||
"appearanceSectionTitle": "Appearance",
|
"appearanceSectionTitle": "Appearance",
|
||||||
"patcherSectionTitle": "Patcher",
|
|
||||||
"teamSectionTitle": "Team",
|
"teamSectionTitle": "Team",
|
||||||
"infoSectionTitle": "Info",
|
"infoSectionTitle": "Info",
|
||||||
"advancedSectionTitle": "Advanced",
|
"advancedSectionTitle": "Advanced",
|
||||||
@ -111,13 +113,13 @@
|
|||||||
"frenchOption": "French",
|
"frenchOption": "French",
|
||||||
"sourcesLabel": "Sources",
|
"sourcesLabel": "Sources",
|
||||||
"sourcesLabelHint": "Configure your custom sources",
|
"sourcesLabelHint": "Configure your custom sources",
|
||||||
"orgPatchesLabel" : "Patches Org",
|
"orgPatchesLabel" : "Patches Organization",
|
||||||
"sourcesPatchesLabel" : "Patches Source",
|
"sourcesPatchesLabel" : "Patches Source",
|
||||||
"orgIntegrationsLabel": "Integrations Org",
|
"orgIntegrationsLabel": "Integrations Organization",
|
||||||
"sourcesIntegrationsLabel": "Integrations Source",
|
"sourcesIntegrationsLabel": "Integrations Source",
|
||||||
"sourcesResetDialogTitle": "Reset",
|
"sourcesResetDialogTitle": "Reset",
|
||||||
"sourcesResetDialogText": "Are you sure you want to reset custom sources to their default values?",
|
"sourcesResetDialogText": "Are you sure you want to reset custom sources to their default values?",
|
||||||
"apiURLResetDialogText": "Are you sure you want to reset API URL to their default values?",
|
"apiURLResetDialogText": "Are you sure you want to reset API URL to its default value?",
|
||||||
"contributorsLabel": "Contributors",
|
"contributorsLabel": "Contributors",
|
||||||
"contributorsHint": "A list of contributors of ReVanced",
|
"contributorsHint": "A list of contributors of ReVanced",
|
||||||
"logsLabel": "Logs",
|
"logsLabel": "Logs",
|
||||||
|
3
crowdin.yml
Normal file
3
crowdin.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
files:
|
||||||
|
- source: /assets/i18n/en.json
|
||||||
|
translation: /assets/i18n/%two_letters_code%.json
|
@ -2,6 +2,7 @@ import 'package:revanced_manager/services/github_api.dart';
|
|||||||
import 'package:revanced_manager/services/manager_api.dart';
|
import 'package:revanced_manager/services/manager_api.dart';
|
||||||
import 'package:revanced_manager/services/patcher_api.dart';
|
import 'package:revanced_manager/services/patcher_api.dart';
|
||||||
import 'package:revanced_manager/services/revanced_api.dart';
|
import 'package:revanced_manager/services/revanced_api.dart';
|
||||||
|
import 'package:revanced_manager/services/toast.dart';
|
||||||
import 'package:revanced_manager/ui/views/app_selector/app_selector_view.dart';
|
import 'package:revanced_manager/ui/views/app_selector/app_selector_view.dart';
|
||||||
import 'package:revanced_manager/ui/views/contributors/contributors_view.dart';
|
import 'package:revanced_manager/ui/views/contributors/contributors_view.dart';
|
||||||
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
||||||
@ -36,6 +37,7 @@ import 'package:stacked_services/stacked_services.dart';
|
|||||||
LazySingleton(classType: PatcherAPI),
|
LazySingleton(classType: PatcherAPI),
|
||||||
LazySingleton(classType: RevancedAPI),
|
LazySingleton(classType: RevancedAPI),
|
||||||
LazySingleton(classType: GithubAPI),
|
LazySingleton(classType: GithubAPI),
|
||||||
|
LazySingleton(classType: Toast),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
class AppSetup {}
|
class AppSetup {}
|
||||||
|
@ -9,6 +9,7 @@ import 'package:revanced_manager/services/revanced_api.dart';
|
|||||||
import 'package:revanced_manager/ui/theme/dynamic_theme_builder.dart';
|
import 'package:revanced_manager/ui/theme/dynamic_theme_builder.dart';
|
||||||
import 'package:revanced_manager/ui/views/navigation/navigation_view.dart';
|
import 'package:revanced_manager/ui/views/navigation/navigation_view.dart';
|
||||||
import 'package:stacked_themes/stacked_themes.dart';
|
import 'package:stacked_themes/stacked_themes.dart';
|
||||||
|
import 'package:timezone/data/latest.dart' as tz;
|
||||||
|
|
||||||
Future main() async {
|
Future main() async {
|
||||||
await ThemeManager.initialise();
|
await ThemeManager.initialise();
|
||||||
@ -19,6 +20,7 @@ Future main() async {
|
|||||||
await locator<RevancedAPI>().initialize(apiUrl);
|
await locator<RevancedAPI>().initialize(apiUrl);
|
||||||
locator<GithubAPI>().initialize();
|
locator<GithubAPI>().initialize();
|
||||||
await locator<PatcherAPI>().initialize();
|
await locator<PatcherAPI>().initialize();
|
||||||
|
tz.initializeTimeZones();
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,8 +97,10 @@ class ManagerAPI {
|
|||||||
Future<void> savePatchedApp(PatchedApplication app) async {
|
Future<void> savePatchedApp(PatchedApplication app) async {
|
||||||
List<PatchedApplication> patchedApps = getPatchedApps();
|
List<PatchedApplication> patchedApps = getPatchedApps();
|
||||||
patchedApps.removeWhere((a) => a.packageName == app.packageName);
|
patchedApps.removeWhere((a) => a.packageName == app.packageName);
|
||||||
ApplicationWithIcon? installed =
|
ApplicationWithIcon? installed = await DeviceApps.getApp(
|
||||||
await DeviceApps.getApp(app.packageName, true) as ApplicationWithIcon?;
|
app.packageName,
|
||||||
|
true,
|
||||||
|
) as ApplicationWithIcon?;
|
||||||
if (installed != null) {
|
if (installed != null) {
|
||||||
app.name = installed.appName;
|
app.name = installed.appName;
|
||||||
app.version = installed.versionName!;
|
app.version = installed.versionName!;
|
||||||
@ -202,9 +204,10 @@ class ManagerAPI {
|
|||||||
List<String> installedApps = await _rootAPI.getInstalledApps();
|
List<String> installedApps = await _rootAPI.getInstalledApps();
|
||||||
for (String packageName in installedApps) {
|
for (String packageName in installedApps) {
|
||||||
if (!patchedApps.any((app) => app.packageName == packageName)) {
|
if (!patchedApps.any((app) => app.packageName == packageName)) {
|
||||||
ApplicationWithIcon? application =
|
ApplicationWithIcon? application = await DeviceApps.getApp(
|
||||||
await DeviceApps.getApp(packageName, true)
|
packageName,
|
||||||
as ApplicationWithIcon?;
|
true,
|
||||||
|
) as ApplicationWithIcon?;
|
||||||
if (application != null) {
|
if (application != null) {
|
||||||
unsavedApps.add(
|
unsavedApps.add(
|
||||||
PatchedApplication(
|
PatchedApplication(
|
||||||
@ -229,9 +232,10 @@ class ManagerAPI {
|
|||||||
if (app.packageName.startsWith('app.revanced') &&
|
if (app.packageName.startsWith('app.revanced') &&
|
||||||
!app.packageName.startsWith('app.revanced.manager.') &&
|
!app.packageName.startsWith('app.revanced.manager.') &&
|
||||||
!patchedApps.any((uapp) => uapp.packageName == app.packageName)) {
|
!patchedApps.any((uapp) => uapp.packageName == app.packageName)) {
|
||||||
ApplicationWithIcon? application =
|
ApplicationWithIcon? application = await DeviceApps.getApp(
|
||||||
await DeviceApps.getApp(app.packageName, true)
|
app.packageName,
|
||||||
as ApplicationWithIcon?;
|
true,
|
||||||
|
) as ApplicationWithIcon?;
|
||||||
if (application != null) {
|
if (application != null) {
|
||||||
unsavedApps.add(
|
unsavedApps.add(
|
||||||
PatchedApplication(
|
PatchedApplication(
|
||||||
|
@ -53,9 +53,10 @@ class PatcherAPI {
|
|||||||
for (Package package in patch.compatiblePackages) {
|
for (Package package in patch.compatiblePackages) {
|
||||||
try {
|
try {
|
||||||
if (!filteredApps.any((app) => app.packageName == package.name)) {
|
if (!filteredApps.any((app) => app.packageName == package.name)) {
|
||||||
ApplicationWithIcon? app =
|
ApplicationWithIcon? app = await DeviceApps.getApp(
|
||||||
await DeviceApps.getApp(package.name, true)
|
package.name,
|
||||||
as ApplicationWithIcon?;
|
true,
|
||||||
|
) as ApplicationWithIcon?;
|
||||||
if (app != null) {
|
if (app != null) {
|
||||||
filteredApps.add(app);
|
filteredApps.add(app);
|
||||||
}
|
}
|
||||||
@ -69,10 +70,14 @@ class PatcherAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Patch>> getFilteredPatches(String packageName) async {
|
Future<List<Patch>> getFilteredPatches(String packageName) async {
|
||||||
|
String newPackageName = packageName.replaceFirst(
|
||||||
|
'app.revanced.',
|
||||||
|
'com.google.',
|
||||||
|
);
|
||||||
return _patches
|
return _patches
|
||||||
.where((patch) =>
|
.where((patch) =>
|
||||||
!patch.name.contains('settings') &&
|
!patch.name.contains('settings') &&
|
||||||
patch.compatiblePackages.any((pack) => pack.name == packageName))
|
patch.compatiblePackages.any((pack) => pack.name == newPackageName))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,19 +89,25 @@ class PatcherAPI {
|
|||||||
|
|
||||||
Future<bool> needsIntegrations(List<Patch> selectedPatches) async {
|
Future<bool> needsIntegrations(List<Patch> selectedPatches) async {
|
||||||
return selectedPatches.any(
|
return selectedPatches.any(
|
||||||
(patch) => patch.dependencies.contains('integrations'),
|
(patch) => patch.dependencies.any(
|
||||||
|
(dep) => dep.contains('integrations'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> needsResourcePatching(List<Patch> selectedPatches) async {
|
Future<bool> needsResourcePatching(List<Patch> selectedPatches) async {
|
||||||
return selectedPatches.any(
|
return selectedPatches.any(
|
||||||
(patch) => patch.dependencies.any((dep) => dep.contains('resource-')),
|
(patch) => patch.dependencies.any(
|
||||||
|
(dep) => dep.contains('resource-'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> needsSettingsPatch(List<Patch> selectedPatches) async {
|
Future<bool> needsSettingsPatch(List<Patch> selectedPatches) async {
|
||||||
return selectedPatches.any(
|
return selectedPatches.any(
|
||||||
(patch) => patch.dependencies.contains('settings'),
|
(patch) => patch.dependencies.any(
|
||||||
|
(dep) => dep.contains('settings'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,12 @@ class RootAPI {
|
|||||||
|
|
||||||
Future<bool> hasRootPermissions() async {
|
Future<bool> hasRootPermissions() async {
|
||||||
try {
|
try {
|
||||||
bool? isRooted = await Root.isRooted();
|
bool? isRooted = await Root.isRootAvailable();
|
||||||
|
if (isRooted != null && isRooted) {
|
||||||
|
isRooted = await Root.isRooted();
|
||||||
return isRooted != null && isRooted;
|
return isRooted != null && isRooted;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
} on Exception {
|
} on Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
23
lib/services/toast.dart
Normal file
23
lib/services/toast.dart
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
|
import 'package:fluttertoast/fluttertoast.dart' as t;
|
||||||
|
|
||||||
|
class Toast {
|
||||||
|
final t.FToast _fToast = t.FToast();
|
||||||
|
late BuildContext buildContext;
|
||||||
|
|
||||||
|
void initialize(BuildContext context) {
|
||||||
|
_fToast.init(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
void show(String text) {
|
||||||
|
t.Fluttertoast.showToast(
|
||||||
|
msg: FlutterI18n.translate(
|
||||||
|
_fToast.context!,
|
||||||
|
text,
|
||||||
|
),
|
||||||
|
toastLength: t.Toast.LENGTH_LONG,
|
||||||
|
gravity: t.ToastGravity.CENTER,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -31,13 +31,36 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
|||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverAppBar(
|
||||||
|
pinned: true,
|
||||||
|
floating: true,
|
||||||
|
snap: false,
|
||||||
|
title: I18nText(
|
||||||
|
'appSelectorView.viewTitle',
|
||||||
|
child: Text(
|
||||||
|
'',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).textTheme.headline6!.color,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
leading: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.arrow_back,
|
||||||
|
color: Theme.of(context).textTheme.headline6!.color,
|
||||||
|
),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
bottom: PreferredSize(
|
||||||
|
preferredSize: const Size.fromHeight(64.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(
|
||||||
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 12.0),
|
vertical: 8.0,
|
||||||
child: Column(
|
horizontal: 12.0,
|
||||||
children: <Widget>[
|
),
|
||||||
SearchBar(
|
child: SearchBar(
|
||||||
showSelectIcon: false,
|
showSelectIcon: false,
|
||||||
hintText: FlutterI18n.translate(
|
hintText: FlutterI18n.translate(
|
||||||
context,
|
context,
|
||||||
@ -49,37 +72,38 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
),
|
||||||
Expanded(
|
),
|
||||||
|
),
|
||||||
|
SliverToBoxAdapter(
|
||||||
child: model.noApps
|
child: model.noApps
|
||||||
? Center(
|
? Center(
|
||||||
child: I18nText('appSelectorCard.noAppsLabel'),
|
child: I18nText('appSelectorCard.noAppsLabel'),
|
||||||
)
|
)
|
||||||
: model.apps.isEmpty
|
: model.apps.isEmpty
|
||||||
? const AppSkeletonLoader()
|
? const AppSkeletonLoader()
|
||||||
: ListView(
|
: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 80),
|
padding: const EdgeInsets.symmetric(horizontal: 12.0)
|
||||||
|
.copyWith(bottom: 80),
|
||||||
|
child: Column(
|
||||||
children: model
|
children: model
|
||||||
.getFilteredApps(_query)
|
.getFilteredApps(_query)
|
||||||
.map((app) => InkWell(
|
.map((app) => InstalledAppItem(
|
||||||
|
name: app.appName,
|
||||||
|
pkgName: app.packageName,
|
||||||
|
icon: app.icon,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
model.selectApp(app);
|
model.selectApp(app);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
child: InstalledAppItem(
|
|
||||||
name: app.appName,
|
|
||||||
pkgName: app.packageName,
|
|
||||||
icon: app.icon,
|
|
||||||
),
|
|
||||||
))
|
))
|
||||||
.toList(),
|
.toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,16 +2,16 @@ 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_i18n/flutter_i18n.dart';
|
|
||||||
import 'package:fluttertoast/fluttertoast.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';
|
||||||
|
import 'package:revanced_manager/services/toast.dart';
|
||||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
class AppSelectorViewModel extends BaseViewModel {
|
class AppSelectorViewModel extends BaseViewModel {
|
||||||
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
||||||
|
final Toast _toast = locator<Toast>();
|
||||||
final List<ApplicationWithIcon> apps = [];
|
final List<ApplicationWithIcon> apps = [];
|
||||||
bool noApps = false;
|
bool noApps = false;
|
||||||
|
|
||||||
@ -43,9 +43,10 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||||||
);
|
);
|
||||||
if (result != null && result.files.single.path != null) {
|
if (result != null && result.files.single.path != null) {
|
||||||
File apkFile = File(result.files.single.path!);
|
File apkFile = File(result.files.single.path!);
|
||||||
ApplicationWithIcon? application =
|
ApplicationWithIcon? application = await DeviceApps.getAppFromStorage(
|
||||||
await DeviceApps.getAppFromStorage(apkFile.path, true)
|
apkFile.path,
|
||||||
as ApplicationWithIcon?;
|
true,
|
||||||
|
) as ApplicationWithIcon?;
|
||||||
if (application != null) {
|
if (application != null) {
|
||||||
locator<PatcherViewModel>().selectedApp = PatchedApplication(
|
locator<PatcherViewModel>().selectedApp = PatchedApplication(
|
||||||
name: application.appName,
|
name: application.appName,
|
||||||
@ -61,14 +62,7 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on Exception {
|
} on Exception {
|
||||||
Fluttertoast.showToast(
|
_toast.show('appSelectorView.errorMessage');
|
||||||
msg: FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'appSelectorView.errorMessage',
|
|
||||||
),
|
|
||||||
toastLength: Toast.LENGTH_LONG,
|
|
||||||
gravity: ToastGravity.CENTER,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ class HomeView extends StatelessWidget {
|
|||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: <Widget>[
|
slivers: <Widget>[
|
||||||
CustomSliverAppBar(
|
CustomSliverAppBar(
|
||||||
|
isMainView: true,
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'homeView.widgetTitle',
|
'homeView.widgetTitle',
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -6,24 +6,26 @@ import 'package:device_apps/device_apps.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.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/app/app.router.dart';
|
import 'package:revanced_manager/app/app.router.dart';
|
||||||
import 'package:revanced_manager/models/patched_application.dart';
|
import 'package:revanced_manager/models/patched_application.dart';
|
||||||
import 'package:revanced_manager/services/manager_api.dart';
|
import 'package:revanced_manager/services/manager_api.dart';
|
||||||
import 'package:revanced_manager/services/patcher_api.dart';
|
import 'package:revanced_manager/services/patcher_api.dart';
|
||||||
|
import 'package:revanced_manager/services/toast.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/installerView/custom_material_button.dart';
|
import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
import 'package:stacked_services/stacked_services.dart';
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
import 'package:timezone/timezone.dart' as tz;
|
||||||
|
|
||||||
@lazySingleton
|
@lazySingleton
|
||||||
class HomeViewModel extends BaseViewModel {
|
class HomeViewModel extends BaseViewModel {
|
||||||
final NavigationService _navigationService = locator<NavigationService>();
|
final NavigationService _navigationService = locator<NavigationService>();
|
||||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||||
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
||||||
|
final Toast _toast = locator<Toast>();
|
||||||
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
||||||
DateTime? _lastUpdate;
|
DateTime? _lastUpdate;
|
||||||
bool showUpdatableApps = true;
|
bool showUpdatableApps = true;
|
||||||
@ -38,16 +40,13 @@ class HomeViewModel extends BaseViewModel {
|
|||||||
onSelectNotification: (p) =>
|
onSelectNotification: (p) =>
|
||||||
DeviceApps.openApp('app.revanced.manager.flutter'),
|
DeviceApps.openApp('app.revanced.manager.flutter'),
|
||||||
);
|
);
|
||||||
|
flutterLocalNotificationsPlugin
|
||||||
|
.resolvePlatformSpecificImplementation<
|
||||||
|
AndroidFlutterLocalNotificationsPlugin>()
|
||||||
|
?.requestPermission();
|
||||||
bool isConnected = await Connectivity().checkConnection();
|
bool isConnected = await Connectivity().checkConnection();
|
||||||
if (!isConnected) {
|
if (!isConnected) {
|
||||||
Fluttertoast.showToast(
|
_toast.show('homeView.noConnection');
|
||||||
msg: FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'homeView.noConnection',
|
|
||||||
),
|
|
||||||
toastLength: Toast.LENGTH_LONG,
|
|
||||||
gravity: ToastGravity.CENTER,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
_getPatchedApps();
|
_getPatchedApps();
|
||||||
_managerAPI.reAssessSavedApps().then((_) => _getPatchedApps());
|
_managerAPI.reAssessSavedApps().then((_) => _getPatchedApps());
|
||||||
@ -102,18 +101,12 @@ class HomeViewModel extends BaseViewModel {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateManager(BuildContext context) async {
|
Future<void> updateManager(BuildContext context) async {
|
||||||
Fluttertoast.showToast(
|
try {
|
||||||
msg: FlutterI18n.translate(
|
_toast.show('homeView.downloadingMessage');
|
||||||
context,
|
|
||||||
'homeView.downloadingMessage',
|
|
||||||
),
|
|
||||||
toastLength: Toast.LENGTH_LONG,
|
|
||||||
gravity: ToastGravity.CENTER,
|
|
||||||
);
|
|
||||||
File? managerApk = await _managerAPI.downloadManager();
|
File? managerApk = await _managerAPI.downloadManager();
|
||||||
if (managerApk != null) {
|
if (managerApk != null) {
|
||||||
flutterLocalNotificationsPlugin.show(
|
await flutterLocalNotificationsPlugin.zonedSchedule(
|
||||||
0,
|
0,
|
||||||
FlutterI18n.translate(
|
FlutterI18n.translate(
|
||||||
context,
|
context,
|
||||||
@ -123,48 +116,33 @@ class HomeViewModel extends BaseViewModel {
|
|||||||
context,
|
context,
|
||||||
'homeView.notificationText',
|
'homeView.notificationText',
|
||||||
),
|
),
|
||||||
|
tz.TZDateTime.now(tz.local).add(const Duration(seconds: 5)),
|
||||||
const NotificationDetails(
|
const NotificationDetails(
|
||||||
android: AndroidNotificationDetails(
|
android: AndroidNotificationDetails(
|
||||||
'revanced_manager_channel',
|
'revanced_manager_channel',
|
||||||
'ReVanced Manager Channel',
|
'ReVanced Manager Channel',
|
||||||
|
importance: Importance.max,
|
||||||
|
priority: Priority.high,
|
||||||
|
ticker: 'ticker',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
androidAllowWhileIdle: true,
|
||||||
|
uiLocalNotificationDateInterpretation:
|
||||||
|
UILocalNotificationDateInterpretation.absoluteTime,
|
||||||
);
|
);
|
||||||
try {
|
_toast.show('homeView.installingMessage');
|
||||||
Fluttertoast.showToast(
|
|
||||||
msg: FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'homeView.installingMessage',
|
|
||||||
),
|
|
||||||
toastLength: Toast.LENGTH_LONG,
|
|
||||||
gravity: ToastGravity.CENTER,
|
|
||||||
);
|
|
||||||
await AppInstaller.installApk(managerApk.path);
|
await AppInstaller.installApk(managerApk.path);
|
||||||
} on Exception {
|
|
||||||
Fluttertoast.showToast(
|
|
||||||
msg: FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'homeView.errorInstallMessage',
|
|
||||||
),
|
|
||||||
toastLength: Toast.LENGTH_LONG,
|
|
||||||
gravity: ToastGravity.CENTER,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Fluttertoast.showToast(
|
_toast.show('homeView.errorDownloadMessage');
|
||||||
msg: FlutterI18n.translate(
|
}
|
||||||
context,
|
} on Exception {
|
||||||
'homeView.errorDownloadMessage',
|
_toast.show('homeView.errorInstallMessage');
|
||||||
),
|
|
||||||
toastLength: Toast.LENGTH_LONG,
|
|
||||||
gravity: ToastGravity.CENTER,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> showUpdateConfirmationDialog(BuildContext context) async {
|
Future<void> showUpdateConfirmationDialog(BuildContext parentContext) async {
|
||||||
return showDialog(
|
return showDialog(
|
||||||
context: context,
|
context: parentContext,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
title: I18nText('homeView.updateDialogTitle'),
|
title: I18nText('homeView.updateDialogTitle'),
|
||||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||||
@ -179,7 +157,7 @@ class HomeViewModel extends BaseViewModel {
|
|||||||
label: I18nText('yesButton'),
|
label: I18nText('yesButton'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
updateManager(context);
|
updateManager(parentContext);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
@ -29,6 +29,7 @@ class InstallerView extends StatelessWidget {
|
|||||||
color: Theme.of(context).textTheme.headline6!.color,
|
color: Theme.of(context).textTheme.headline6!.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
onBackButtonPressed: () => model.onWillPop(context),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: !model.isPatching && !model.hasErrors,
|
visible: !model.isPatching && !model.hasErrors,
|
||||||
@ -143,13 +144,7 @@ class InstallerView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onWillPop: () async {
|
onWillPop: () => model.onWillPop(context),
|
||||||
if (!model.isPatching) {
|
|
||||||
model.cleanPatcher();
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import 'package:revanced_manager/models/patch.dart';
|
|||||||
import 'package:revanced_manager/models/patched_application.dart';
|
import 'package:revanced_manager/models/patched_application.dart';
|
||||||
import 'package:revanced_manager/services/manager_api.dart';
|
import 'package:revanced_manager/services/manager_api.dart';
|
||||||
import 'package:revanced_manager/services/patcher_api.dart';
|
import 'package:revanced_manager/services/patcher_api.dart';
|
||||||
|
import 'package:revanced_manager/services/toast.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/installerView/custom_material_button.dart';
|
import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
@ -17,6 +18,7 @@ import 'package:wakelock/wakelock.dart';
|
|||||||
class InstallerViewModel extends BaseViewModel {
|
class InstallerViewModel extends BaseViewModel {
|
||||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||||
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
||||||
|
final Toast _toast = locator<Toast>();
|
||||||
final PatchedApplication _app = locator<PatcherViewModel>().selectedApp!;
|
final PatchedApplication _app = locator<PatcherViewModel>().selectedApp!;
|
||||||
final List<Patch> _patches = locator<PatcherViewModel>().selectedPatches;
|
final List<Patch> _patches = locator<PatcherViewModel>().selectedPatches;
|
||||||
static const _installerChannel = MethodChannel(
|
static const _installerChannel = MethodChannel(
|
||||||
@ -176,6 +178,7 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
_app.patchDate = DateTime.now();
|
_app.patchDate = DateTime.now();
|
||||||
_app.appliedPatches = _patches.map((p) => p.name).toList();
|
_app.appliedPatches = _patches.map((p) => p.name).toList();
|
||||||
if (hasMicroG) {
|
if (hasMicroG) {
|
||||||
|
_app.name += ' ReVanced';
|
||||||
_app.packageName = _app.packageName.replaceFirst(
|
_app.packageName = _app.packageName.replaceFirst(
|
||||||
'com.google.',
|
'com.google.',
|
||||||
'app.revanced.',
|
'app.revanced.',
|
||||||
@ -215,4 +218,14 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> onWillPop(BuildContext context) async {
|
||||||
|
if (isPatching) {
|
||||||
|
_toast.show('installerView.noExit');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
cleanPatcher();
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:injectable/injectable.dart';
|
import 'package:injectable/injectable.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:revanced_manager/services/root_api.dart';
|
import 'package:revanced_manager/services/root_api.dart';
|
||||||
|
import 'package:revanced_manager/services/toast.dart';
|
||||||
import 'package:revanced_manager/ui/views/home/home_view.dart';
|
import 'package:revanced_manager/ui/views/home/home_view.dart';
|
||||||
import 'package:revanced_manager/ui/views/patcher/patcher_view.dart';
|
import 'package:revanced_manager/ui/views/patcher/patcher_view.dart';
|
||||||
import 'package:revanced_manager/ui/views/settings/settings_view.dart';
|
import 'package:revanced_manager/ui/views/settings/settings_view.dart';
|
||||||
@ -14,6 +16,7 @@ import 'package:stacked/stacked.dart';
|
|||||||
@lazySingleton
|
@lazySingleton
|
||||||
class NavigationViewModel extends IndexTrackingViewModel {
|
class NavigationViewModel extends IndexTrackingViewModel {
|
||||||
void initialize(BuildContext context) async {
|
void initialize(BuildContext context) async {
|
||||||
|
locator<Toast>().initialize(context);
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
if (prefs.getBool('permissionsRequested') == null) {
|
if (prefs.getBool('permissionsRequested') == null) {
|
||||||
await prefs.setBool('permissionsRequested', true);
|
await prefs.setBool('permissionsRequested', true);
|
||||||
|
@ -28,6 +28,7 @@ class PatcherView extends StatelessWidget {
|
|||||||
body: CustomScrollView(
|
body: CustomScrollView(
|
||||||
slivers: <Widget>[
|
slivers: <Widget>[
|
||||||
CustomSliverAppBar(
|
CustomSliverAppBar(
|
||||||
|
isMainView: true,
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'patcherView.widgetTitle',
|
'patcherView.widgetTitle',
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -33,13 +33,36 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverAppBar(
|
||||||
|
pinned: true,
|
||||||
|
floating: true,
|
||||||
|
snap: false,
|
||||||
|
title: I18nText(
|
||||||
|
'patchesSelectorView.viewTitle',
|
||||||
|
child: Text(
|
||||||
|
'',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).textTheme.headline6!.color,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
leading: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.arrow_back,
|
||||||
|
color: Theme.of(context).textTheme.headline6!.color,
|
||||||
|
),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
bottom: PreferredSize(
|
||||||
|
preferredSize: const Size.fromHeight(64.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(
|
||||||
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 12.0),
|
vertical: 8.0,
|
||||||
child: Column(
|
horizontal: 12.0,
|
||||||
children: <Widget>[
|
),
|
||||||
SearchBar(
|
child: SearchBar(
|
||||||
showSelectIcon: true,
|
showSelectIcon: true,
|
||||||
hintText: FlutterI18n.translate(
|
hintText: FlutterI18n.translate(
|
||||||
context,
|
context,
|
||||||
@ -52,8 +75,10 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
},
|
},
|
||||||
onSelectAll: (value) => model.selectAllPatches(value),
|
onSelectAll: (value) => model.selectAllPatches(value),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
),
|
||||||
Expanded(
|
),
|
||||||
|
),
|
||||||
|
SliverToBoxAdapter(
|
||||||
child: model.patches.isEmpty
|
child: model.patches.isEmpty
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
@ -67,8 +92,10 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView(
|
: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 80),
|
padding: const EdgeInsets.symmetric(horizontal: 12.0)
|
||||||
|
.copyWith(bottom: 80),
|
||||||
|
child: Column(
|
||||||
children: model
|
children: model
|
||||||
.getQueriedPatches(_query)
|
.getQueriedPatches(_query)
|
||||||
.map(
|
.map(
|
||||||
@ -168,11 +195,10 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
.toList(),
|
.toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,13 +17,6 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
locator<PatcherViewModel>().selectedApp!.packageName,
|
locator<PatcherViewModel>().selectedApp!.packageName,
|
||||||
));
|
));
|
||||||
patches.sort((a, b) => a.name.compareTo(b.name));
|
patches.sort((a, b) => a.name.compareTo(b.name));
|
||||||
if (selectedPatches.isEmpty) {
|
|
||||||
for (Patch patch in patches) {
|
|
||||||
if (!patch.excluded && isPatchSupported(patch)) {
|
|
||||||
selectedPatches.add(patch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,9 @@ import 'package:stacked/stacked.dart';
|
|||||||
class SettingsView extends StatelessWidget {
|
class SettingsView extends StatelessWidget {
|
||||||
const SettingsView({Key? key}) : super(key: key);
|
const SettingsView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
static const _settingsDivider =
|
||||||
|
Divider(thickness: 1.0, indent: 20.0, endIndent: 20.0);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ViewModelBuilder<SettingsViewModel>.reactive(
|
return ViewModelBuilder<SettingsViewModel>.reactive(
|
||||||
@ -21,6 +24,7 @@ class SettingsView extends StatelessWidget {
|
|||||||
body: CustomScrollView(
|
body: CustomScrollView(
|
||||||
slivers: <Widget>[
|
slivers: <Widget>[
|
||||||
CustomSliverAppBar(
|
CustomSliverAppBar(
|
||||||
|
isMainView: true,
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'settingsView.widgetTitle',
|
'settingsView.widgetTitle',
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -31,15 +35,14 @@ class SettingsView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverList(
|
||||||
padding: const EdgeInsets.all(20.0),
|
|
||||||
sliver: SliverList(
|
|
||||||
delegate: SliverChildListDelegate.fixed(
|
delegate: SliverChildListDelegate.fixed(
|
||||||
<Widget>[
|
<Widget>[
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
title: 'settingsView.appearanceSectionTitle',
|
title: 'settingsView.appearanceSectionTitle',
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CustomSwitchTile(
|
CustomSwitchTile(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'settingsView.darkThemeLabel',
|
'settingsView.darkThemeLabel',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -63,6 +66,8 @@ class SettingsView extends StatelessWidget {
|
|||||||
visible: snapshot.hasData &&
|
visible: snapshot.hasData &&
|
||||||
snapshot.data! >= ANDROID_12_SDK_VERSION,
|
snapshot.data! >= ANDROID_12_SDK_VERSION,
|
||||||
child: CustomSwitchTile(
|
child: CustomSwitchTile(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'settingsView.dynamicThemeLabel',
|
'settingsView.dynamicThemeLabel',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -73,8 +78,7 @@ class SettingsView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle:
|
subtitle: I18nText('settingsView.dynamicThemeHint'),
|
||||||
I18nText('settingsView.dynamicThemeHint'),
|
|
||||||
value: model.getDynamicThemeStatus(),
|
value: model.getDynamicThemeStatus(),
|
||||||
onTap: (value) => model.setUseDynamicTheme(
|
onTap: (value) => model.setUseDynamicTheme(
|
||||||
context,
|
context,
|
||||||
@ -86,27 +90,18 @@ class SettingsView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
SettingsTileDialog(
|
SettingsTileDialog(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
title: 'settingsView.languageLabel',
|
title: 'settingsView.languageLabel',
|
||||||
subtitle: 'English',
|
subtitle: 'English',
|
||||||
onTap: () => model.showLanguagesDialog(context),
|
onTap: () => model.showLanguagesDialog(context),
|
||||||
),
|
),
|
||||||
const Divider(thickness: 1.0),
|
_settingsDivider,
|
||||||
SettingsSection(
|
|
||||||
title: 'settingsView.patcherSectionTitle',
|
|
||||||
children: <Widget>[
|
|
||||||
SettingsTileDialog(
|
|
||||||
title: 'settingsView.sourcesLabel',
|
|
||||||
subtitle: 'settingsView.sourcesLabelHint',
|
|
||||||
onTap: () => model.showSourcesDialog(context),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const Divider(thickness: 1.0),
|
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
title: 'settingsView.teamSectionTitle',
|
title: 'settingsView.teamSectionTitle',
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'settingsView.contributorsLabel',
|
'settingsView.contributorsLabel',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -120,15 +115,36 @@ class SettingsView extends StatelessWidget {
|
|||||||
subtitle: I18nText('settingsView.contributorsHint'),
|
subtitle: I18nText('settingsView.contributorsHint'),
|
||||||
onTap: () => model.navigateToContributors(),
|
onTap: () => model.navigateToContributors(),
|
||||||
),
|
),
|
||||||
const SocialMediaWidget(),
|
const SocialMediaWidget(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const Divider(thickness: 1.0),
|
_settingsDivider,
|
||||||
|
SettingsSection(
|
||||||
|
title: 'settingsView.advancedSectionTitle',
|
||||||
|
children: <Widget>[
|
||||||
|
SettingsTileDialog(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
|
title: 'settingsView.apiURLLabel',
|
||||||
|
subtitle: 'settingsView.apiURLHint',
|
||||||
|
onTap: () => model.showApiUrlDialog(context),
|
||||||
|
),
|
||||||
|
SettingsTileDialog(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
|
title: 'settingsView.sourcesLabel',
|
||||||
|
subtitle: 'settingsView.sourcesLabelHint',
|
||||||
|
onTap: () => model.showSourcesDialog(context),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
_settingsDivider,
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
title: 'settingsView.infoSectionTitle',
|
title: 'settingsView.infoSectionTitle',
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'settingsView.logsLabel',
|
'settingsView.logsLabel',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -142,24 +158,14 @@ class SettingsView extends StatelessWidget {
|
|||||||
subtitle: I18nText('settingsView.logsHint'),
|
subtitle: I18nText('settingsView.logsHint'),
|
||||||
onTap: () => model.exportLogcatLogs(),
|
onTap: () => model.exportLogcatLogs(),
|
||||||
),
|
),
|
||||||
const AboutWidget(),
|
const AboutWidget(
|
||||||
],
|
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
),
|
|
||||||
const Divider(thickness: 1.0),
|
|
||||||
SettingsSection(
|
|
||||||
title: 'settingsView.advancedSectionTitle',
|
|
||||||
children: <Widget>[
|
|
||||||
SettingsTileDialog(
|
|
||||||
title: 'settingsView.apiURLLabel',
|
|
||||||
subtitle: 'settingsView.apiURLHint',
|
|
||||||
onTap: () => model.showApiUrlDialog(context),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -34,7 +34,7 @@ class AppInfoView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.symmetric(vertical: 20.0),
|
||||||
sliver: SliverList(
|
sliver: SliverList(
|
||||||
delegate: SliverChildListDelegate.fixed(
|
delegate: SliverChildListDelegate.fixed(
|
||||||
<Widget>[
|
<Widget>[
|
||||||
@ -61,21 +61,30 @@ class AppInfoView extends StatelessWidget {
|
|||||||
style: Theme.of(context).textTheme.subtitle1,
|
style: Theme.of(context).textTheme.subtitle1,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
CustomCard(
|
Padding(
|
||||||
child: IntrinsicHeight(
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
|
child: CustomCard(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
child: SizedBox(
|
||||||
|
height: 94.0,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
!app.isRooted ? const Spacer() : Container(),
|
Expanded(
|
||||||
InkWell(
|
child: Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
onTap: () => model.openApp(app),
|
onTap: () => model.openApp(app),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(
|
Icon(
|
||||||
Icons.open_in_new_outlined,
|
Icons.open_in_new_outlined,
|
||||||
color:
|
color: Theme.of(context)
|
||||||
Theme.of(context).colorScheme.primary,
|
.colorScheme
|
||||||
|
.primary,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
I18nText(
|
I18nText(
|
||||||
@ -93,24 +102,33 @@ class AppInfoView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
),
|
||||||
|
),
|
||||||
VerticalDivider(
|
VerticalDivider(
|
||||||
color: Theme.of(context).canvasColor,
|
color: Theme.of(context).canvasColor,
|
||||||
|
indent: 12.0,
|
||||||
|
endIndent: 12.0,
|
||||||
|
width: 1.0,
|
||||||
),
|
),
|
||||||
const Spacer(),
|
Expanded(
|
||||||
InkWell(
|
child: Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
onTap: () => model.showUninstallDialog(
|
onTap: () => model.showUninstallDialog(
|
||||||
context,
|
context,
|
||||||
app,
|
app,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(
|
Icon(
|
||||||
Icons.delete_outline,
|
Icons.delete_outline,
|
||||||
color:
|
color: Theme.of(context)
|
||||||
Theme.of(context).colorScheme.primary,
|
.colorScheme
|
||||||
|
.primary,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
I18nText(
|
I18nText(
|
||||||
@ -128,23 +146,32 @@ class AppInfoView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
),
|
||||||
|
),
|
||||||
VerticalDivider(
|
VerticalDivider(
|
||||||
color: Theme.of(context).canvasColor,
|
color: Theme.of(context).canvasColor,
|
||||||
|
indent: 12.0,
|
||||||
|
endIndent: 12.0,
|
||||||
|
width: 1.0,
|
||||||
),
|
),
|
||||||
const Spacer(),
|
Expanded(
|
||||||
InkWell(
|
child: Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
model.navigateToPatcher(app);
|
model.navigateToPatcher(app);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(
|
Icon(
|
||||||
Icons.build_outlined,
|
Icons.build_outlined,
|
||||||
color:
|
color: Theme.of(context)
|
||||||
Theme.of(context).colorScheme.primary,
|
.colorScheme
|
||||||
|
.primary,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
I18nText(
|
I18nText(
|
||||||
@ -162,15 +189,21 @@ class AppInfoView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
app.isRooted ? const Spacer() : Container(),
|
),
|
||||||
app.isRooted
|
),
|
||||||
? VerticalDivider(
|
if (app.isRooted)
|
||||||
|
VerticalDivider(
|
||||||
color: Theme.of(context).canvasColor,
|
color: Theme.of(context).canvasColor,
|
||||||
)
|
indent: 12.0,
|
||||||
: Container(),
|
endIndent: 12.0,
|
||||||
app.isRooted ? const Spacer() : Container(),
|
width: 1.0,
|
||||||
app.isRooted
|
),
|
||||||
? InkWell(
|
if (app.isRooted)
|
||||||
|
Expanded(
|
||||||
|
child: Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
onTap: () => model.showUninstallDialog(
|
onTap: () => model.showUninstallDialog(
|
||||||
context,
|
context,
|
||||||
app,
|
app,
|
||||||
@ -202,16 +235,18 @@ class AppInfoView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
: Container(),
|
),
|
||||||
!app.isRooted ? const Spacer() : Container(),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'appInfoView.packageNameLabel',
|
'appInfoView.packageNameLabel',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -226,7 +261,8 @@ class AppInfoView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'appInfoView.installTypeLabel',
|
'appInfoView.installTypeLabel',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -243,7 +279,8 @@ class AppInfoView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'appInfoView.patchedDateLabel',
|
'appInfoView.patchedDateLabel',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -264,7 +301,8 @@ class AppInfoView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'appInfoView.appliedPatchesLabel',
|
'appInfoView.appliedPatchesLabel',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
|
@ -20,20 +20,26 @@ class AppInfoViewModel extends BaseViewModel {
|
|||||||
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
||||||
final RootAPI _rootAPI = RootAPI();
|
final RootAPI _rootAPI = RootAPI();
|
||||||
|
|
||||||
Future<void> uninstallApp(PatchedApplication app, bool onlyUnpatch) async {
|
Future<void> uninstallApp(
|
||||||
|
BuildContext context,
|
||||||
|
PatchedApplication app,
|
||||||
|
bool onlyUnpatch,
|
||||||
|
) async {
|
||||||
|
bool isUninstalled = true;
|
||||||
if (app.isRooted) {
|
if (app.isRooted) {
|
||||||
bool hasRootPermissions = await _rootAPI.hasRootPermissions();
|
bool hasRootPermissions = await _rootAPI.hasRootPermissions();
|
||||||
if (hasRootPermissions) {
|
if (hasRootPermissions) {
|
||||||
_rootAPI.deleteApp(app.packageName, app.apkFilePath);
|
await _rootAPI.deleteApp(app.packageName, app.apkFilePath);
|
||||||
_managerAPI.deletePatchedApp(app);
|
|
||||||
if (!onlyUnpatch) {
|
if (!onlyUnpatch) {
|
||||||
DeviceApps.uninstallApp(app.packageName);
|
await DeviceApps.uninstallApp(app.packageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DeviceApps.uninstallApp(app.packageName).then(
|
isUninstalled = await DeviceApps.uninstallApp(app.packageName);
|
||||||
(value) => _managerAPI.deletePatchedApp(app),
|
}
|
||||||
);
|
if (isUninstalled) {
|
||||||
|
await _managerAPI.deletePatchedApp(app);
|
||||||
|
locator<HomeViewModel>().initialize(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,8 +93,7 @@ class AppInfoViewModel extends BaseViewModel {
|
|||||||
CustomMaterialButton(
|
CustomMaterialButton(
|
||||||
label: I18nText('yesButton'),
|
label: I18nText('yesButton'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
uninstallApp(app, onlyUnpatch);
|
uninstallApp(context, app, onlyUnpatch);
|
||||||
locator<HomeViewModel>().initialize(context);
|
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@ -97,8 +102,7 @@ class AppInfoViewModel extends BaseViewModel {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
uninstallApp(app, onlyUnpatch);
|
uninstallApp(context, app, onlyUnpatch);
|
||||||
locator<HomeViewModel>().initialize(context);
|
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ class AppSkeletonLoader extends StatelessWidget {
|
|||||||
return Skeleton(
|
return Skeleton(
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
skeleton: ListView.builder(
|
skeleton: ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
itemCount: 7,
|
itemCount: 7,
|
||||||
itemBuilder: (context, index) => Padding(
|
itemBuilder: (context, index) => Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 8.0),
|
||||||
|
@ -6,12 +6,14 @@ class InstalledAppItem extends StatefulWidget {
|
|||||||
final String name;
|
final String name;
|
||||||
final String pkgName;
|
final String pkgName;
|
||||||
final Uint8List icon;
|
final Uint8List icon;
|
||||||
|
final Function()? onTap;
|
||||||
|
|
||||||
const InstalledAppItem({
|
const InstalledAppItem({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.pkgName,
|
required this.pkgName,
|
||||||
required this.icon,
|
required this.icon,
|
||||||
|
this.onTap,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -24,6 +26,7 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
|||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
|
onTap: widget.onTap,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -15,9 +15,8 @@ class AppSelectorCard extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return CustomCard(
|
||||||
onTap: onPressed,
|
onTap: onPressed,
|
||||||
child: CustomCard(
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -70,7 +69,6 @@ class AppSelectorCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,8 @@ class PatchSelectorCard extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return CustomCard(
|
||||||
onTap: onPressed,
|
onTap: onPressed,
|
||||||
child: CustomCard(
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -41,7 +40,6 @@ class PatchSelectorCard extends StatelessWidget {
|
|||||||
: Text(_getPatchesSelection()),
|
: Text(_getPatchesSelection()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,13 +39,11 @@ class _PatchItemState extends State<PatchItem> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||||
child: InkWell(
|
child: CustomCard(
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() => widget.isSelected = !widget.isSelected);
|
setState(() => widget.isSelected = !widget.isSelected);
|
||||||
widget.onChanged(widget.isSelected);
|
widget.onChanged(widget.isSelected);
|
||||||
},
|
},
|
||||||
child: CustomCard(
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
@ -105,8 +103,7 @@ class _PatchItemState extends State<PatchItem> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: TextButton.icon(
|
child: TextButton.icon(
|
||||||
label:
|
label: I18nText('patchItem.unsupportedWarningButton'),
|
||||||
I18nText('patchItem.unsupportedWarningButton'),
|
|
||||||
icon: const Icon(Icons.warning),
|
icon: const Icon(Icons.warning),
|
||||||
onPressed: () => _showUnsupportedWarningDialog(),
|
onPressed: () => _showUnsupportedWarningDialog(),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
@ -136,7 +133,6 @@ class _PatchItemState extends State<PatchItem> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,9 @@ import 'package:revanced_manager/utils/about_info.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
class AboutWidget extends StatefulWidget {
|
class AboutWidget extends StatefulWidget {
|
||||||
const AboutWidget({Key? key}) : super(key: key);
|
const AboutWidget({Key? key, this.padding}) : super(key: key);
|
||||||
|
|
||||||
|
final EdgeInsetsGeometry? padding;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AboutWidget> createState() => _AboutWidgetState();
|
State<AboutWidget> createState() => _AboutWidgetState();
|
||||||
@ -13,28 +15,15 @@ class AboutWidget extends StatefulWidget {
|
|||||||
class _AboutWidgetState extends State<AboutWidget> {
|
class _AboutWidgetState extends State<AboutWidget> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return FutureBuilder<Map<String, dynamic>>(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
I18nText(
|
|
||||||
'settingsView.aboutLabel',
|
|
||||||
child: const Text(
|
|
||||||
'',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
FutureBuilder<Map<String, dynamic>>(
|
|
||||||
future: AboutInfo.getInfo(),
|
future: AboutInfo.getInfo(),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.hasData) {
|
return Padding(
|
||||||
return GestureDetector(
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
onLongPress: () {
|
child: ListTile(
|
||||||
|
contentPadding: widget.padding ?? EdgeInsets.zero,
|
||||||
|
onLongPress: snapshot.hasData
|
||||||
|
? () {
|
||||||
Clipboard.setData(
|
Clipboard.setData(
|
||||||
ClipboardData(
|
ClipboardData(
|
||||||
text: 'Version: ${snapshot.data!['version']}\n'
|
text: 'Version: ${snapshot.data!['version']}\n'
|
||||||
@ -50,8 +39,20 @@ class _AboutWidgetState extends State<AboutWidget> {
|
|||||||
Theme.of(context).colorScheme.secondary,
|
Theme.of(context).colorScheme.secondary,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
child: Column(
|
: null,
|
||||||
|
title: I18nText(
|
||||||
|
'settingsView.aboutLabel',
|
||||||
|
child: const Text(
|
||||||
|
'',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: snapshot.hasData
|
||||||
|
? Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
@ -90,15 +91,11 @@ class _AboutWidgetState extends State<AboutWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return Container();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ class CustomSwitchTile extends StatelessWidget {
|
|||||||
final Widget subtitle;
|
final Widget subtitle;
|
||||||
final bool value;
|
final bool value;
|
||||||
final Function(bool) onTap;
|
final Function(bool) onTap;
|
||||||
|
final EdgeInsetsGeometry? padding;
|
||||||
|
|
||||||
const CustomSwitchTile({
|
const CustomSwitchTile({
|
||||||
Key? key,
|
Key? key,
|
||||||
@ -13,14 +14,16 @@ class CustomSwitchTile extends StatelessWidget {
|
|||||||
required this.subtitle,
|
required this.subtitle,
|
||||||
required this.value,
|
required this.value,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
|
this.padding,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: padding ?? EdgeInsets.zero,
|
||||||
title: title,
|
title: title,
|
||||||
subtitle: subtitle,
|
subtitle: subtitle,
|
||||||
|
onTap: () => onTap(!value),
|
||||||
trailing: CustomSwitch(
|
trailing: CustomSwitch(
|
||||||
value: value,
|
value: value,
|
||||||
onChanged: onTap,
|
onChanged: onTap,
|
||||||
|
@ -17,7 +17,7 @@ class SettingsSection extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.only(top: 16.0, bottom: 10.0),
|
padding: const EdgeInsets.only(top: 16.0, bottom: 10.0, left: 20.0),
|
||||||
child: I18nText(
|
child: I18nText(
|
||||||
title,
|
title,
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -5,18 +5,20 @@ class SettingsTileDialog extends StatelessWidget {
|
|||||||
final String title;
|
final String title;
|
||||||
final String subtitle;
|
final String subtitle;
|
||||||
final Function()? onTap;
|
final Function()? onTap;
|
||||||
|
final EdgeInsetsGeometry? padding;
|
||||||
|
|
||||||
const SettingsTileDialog({
|
const SettingsTileDialog({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.title,
|
required this.title,
|
||||||
required this.subtitle,
|
required this.subtitle,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
|
this.padding,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: padding ?? EdgeInsets.zero,
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
title,
|
title,
|
||||||
child: const Text(
|
child: const Text(
|
||||||
|
52
lib/ui/widgets/settingsView/social_media_item.dart
Normal file
52
lib/ui/widgets/settingsView/social_media_item.dart
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
class SocialMediaItem extends StatelessWidget {
|
||||||
|
final Widget? icon;
|
||||||
|
final Widget title;
|
||||||
|
final Widget? subtitle;
|
||||||
|
final String? url;
|
||||||
|
|
||||||
|
const SocialMediaItem({
|
||||||
|
Key? key,
|
||||||
|
this.icon,
|
||||||
|
required this.title,
|
||||||
|
this.subtitle,
|
||||||
|
this.url,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ListTile(
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)),
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
leading: SizedBox(
|
||||||
|
width: 48.0,
|
||||||
|
child: Center(
|
||||||
|
child: icon,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: DefaultTextStyle(
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||||
|
color: Theme.of(context).colorScheme.onSecondaryContainer,
|
||||||
|
),
|
||||||
|
child: title,
|
||||||
|
),
|
||||||
|
subtitle: subtitle != null
|
||||||
|
? DefaultTextStyle(
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
child: subtitle!,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
onTap: () => url != null
|
||||||
|
? launchUrl(
|
||||||
|
Uri.parse(url!),
|
||||||
|
mode: LaunchMode.externalApplication,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -2,11 +2,16 @@ import 'package:expandable/expandable.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:revanced_manager/ui/widgets/settingsView/social_media_item.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
|
|
||||||
class SocialMediaWidget extends StatelessWidget {
|
class SocialMediaWidget extends StatelessWidget {
|
||||||
const SocialMediaWidget({Key? key}) : super(key: key);
|
final EdgeInsetsGeometry? padding;
|
||||||
|
|
||||||
|
const SocialMediaWidget({
|
||||||
|
Key? key,
|
||||||
|
this.padding,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -14,11 +19,13 @@ class SocialMediaWidget extends StatelessWidget {
|
|||||||
theme: ExpandableThemeData(
|
theme: ExpandableThemeData(
|
||||||
hasIcon: true,
|
hasIcon: true,
|
||||||
iconColor: Theme.of(context).iconTheme.color,
|
iconColor: Theme.of(context).iconTheme.color,
|
||||||
iconPadding: const EdgeInsets.symmetric(vertical: 16.0),
|
iconPadding: const EdgeInsets.symmetric(vertical: 16.0)
|
||||||
|
.add(padding ?? EdgeInsets.zero)
|
||||||
|
.resolve(Directionality.of(context)),
|
||||||
animationDuration: const Duration(milliseconds: 400),
|
animationDuration: const Duration(milliseconds: 400),
|
||||||
),
|
),
|
||||||
header: ListTile(
|
header: ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: padding ?? EdgeInsets.zero,
|
||||||
title: I18nText(
|
title: I18nText(
|
||||||
'socialMediaCard.widgetTitle',
|
'socialMediaCard.widgetTitle',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -31,169 +38,52 @@ class SocialMediaWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
subtitle: I18nText('socialMediaCard.widgetSubtitle'),
|
subtitle: I18nText('socialMediaCard.widgetSubtitle'),
|
||||||
),
|
),
|
||||||
expanded: CustomCard(
|
expanded: Padding(
|
||||||
|
padding: padding ?? EdgeInsets.zero,
|
||||||
|
child: CustomCard(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: const <Widget>[
|
||||||
ListTile(
|
SocialMediaItem(
|
||||||
contentPadding: EdgeInsets.zero,
|
icon: FaIcon(FontAwesomeIcons.github),
|
||||||
leading: Padding(
|
title: Text('GitHub'),
|
||||||
padding: const EdgeInsets.all(8.0),
|
subtitle: Text('github.com/revanced'),
|
||||||
child: FaIcon(
|
url: 'https://github.com/revanced',
|
||||||
FontAwesomeIcons.github,
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
),
|
||||||
|
SocialMediaItem(
|
||||||
|
icon: FaIcon(FontAwesomeIcons.discord),
|
||||||
|
title: Text('Discord'),
|
||||||
|
subtitle: Text('discord.gg/revanced'),
|
||||||
|
url: 'https://discord.gg/rF2YcEjcrT',
|
||||||
),
|
),
|
||||||
title: Text(
|
SocialMediaItem(
|
||||||
'GitHub',
|
icon: FaIcon(FontAwesomeIcons.telegram),
|
||||||
style: TextStyle(
|
title: Text('Telegram'),
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
subtitle: Text('t.me/app_revanced'),
|
||||||
|
url: 'https://t.me/app_revanced',
|
||||||
),
|
),
|
||||||
|
SocialMediaItem(
|
||||||
|
icon: FaIcon(FontAwesomeIcons.reddit),
|
||||||
|
title: Text('Reddit'),
|
||||||
|
subtitle: Text('r/revancedapp'),
|
||||||
|
url: 'https://reddit.com/r/revancedapp',
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
SocialMediaItem(
|
||||||
'github.com/revanced',
|
icon: FaIcon(FontAwesomeIcons.twitter),
|
||||||
style: TextStyle(
|
title: Text('Twitter'),
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
subtitle: Text('@revancedapp'),
|
||||||
),
|
url: 'https://twitter.com/revancedapp',
|
||||||
),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
Uri.parse('https://github.com/revanced'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
leading: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0).copyWith(left: 5),
|
|
||||||
child: FaIcon(
|
|
||||||
FontAwesomeIcons.discord,
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Discord',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Text(
|
|
||||||
'discord.gg/revanced',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
Uri.parse('https://discord.gg/rF2YcEjcrT'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
leading: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: FaIcon(
|
|
||||||
FontAwesomeIcons.telegram,
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Telegram',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Text(
|
|
||||||
't.me/app_revanced',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
Uri.parse('https://t.me/app_revanced'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
leading: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: FaIcon(
|
|
||||||
FontAwesomeIcons.reddit,
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Reddit',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Text(
|
|
||||||
'r/revancedapp',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
Uri.parse('https://reddit.com/r/revancedapp'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
leading: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: FaIcon(
|
|
||||||
FontAwesomeIcons.twitter,
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Twitter',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Text(
|
|
||||||
'@revancedapp',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
Uri.parse('https://twitter.com/revancedapp'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
leading: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: FaIcon(
|
|
||||||
FontAwesomeIcons.youtube,
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'YouTube',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Text(
|
|
||||||
'youtube.com/revanced',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
Uri.parse('https://youtube.com/revanced'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
),
|
),
|
||||||
|
SocialMediaItem(
|
||||||
|
icon: FaIcon(FontAwesomeIcons.youtube),
|
||||||
|
title: Text('YouTube'),
|
||||||
|
subtitle: Text('youtube.com/revanced'),
|
||||||
|
url: 'https://youtube.com/revanced',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
collapsed: Container(),
|
),
|
||||||
|
collapsed: const SizedBox(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,15 @@ class _ApplicationItemState extends State<ApplicationItem>
|
|||||||
hasIcon: false,
|
hasIcon: false,
|
||||||
animationDuration: Duration(milliseconds: 450),
|
animationDuration: Duration(milliseconds: 450),
|
||||||
),
|
),
|
||||||
header: CustomCard(
|
header: Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 16.0),
|
||||||
|
child: CustomCard(
|
||||||
|
onTap: () {
|
||||||
|
expController.toggle();
|
||||||
|
_animationController.isCompleted
|
||||||
|
? _animationController.reverse()
|
||||||
|
: _animationController.forward();
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -87,20 +95,12 @@ class _ApplicationItemState extends State<ApplicationItem>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Padding(
|
RotationTransition(
|
||||||
padding: const EdgeInsets.only(right: 5.0),
|
|
||||||
child: RotationTransition(
|
|
||||||
turns:
|
turns:
|
||||||
Tween(begin: 0.0, end: 0.50).animate(_animationController),
|
Tween(begin: 0.0, end: 0.50).animate(_animationController),
|
||||||
child: IconButton(
|
child: const Padding(
|
||||||
onPressed: () {
|
padding: EdgeInsets.all(8.0),
|
||||||
expController.toggle();
|
child: Icon(Icons.arrow_drop_down),
|
||||||
_animationController.isCompleted
|
|
||||||
? _animationController.reverse()
|
|
||||||
: _animationController.forward();
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.arrow_drop_down),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
@ -118,9 +118,10 @@ class _ApplicationItemState extends State<ApplicationItem>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
collapsed: const Text(''),
|
),
|
||||||
|
collapsed: const SizedBox(),
|
||||||
expanded: Padding(
|
expanded: Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0),
|
padding: const EdgeInsets.all(16.0).copyWith(top: 0.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -3,30 +3,33 @@ import 'package:flutter/material.dart';
|
|||||||
class CustomCard extends StatelessWidget {
|
class CustomCard extends StatelessWidget {
|
||||||
final bool isFilled;
|
final bool isFilled;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
final Function()? onTap;
|
||||||
|
final EdgeInsetsGeometry? padding;
|
||||||
|
|
||||||
const CustomCard({
|
const CustomCard({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.isFilled = true,
|
this.isFilled = true,
|
||||||
required this.child,
|
required this.child,
|
||||||
|
this.onTap,
|
||||||
|
this.padding,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Material(
|
||||||
decoration: BoxDecoration(
|
type: isFilled ? MaterialType.card : MaterialType.transparency,
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
color: isFilled
|
color: isFilled
|
||||||
? Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.40)
|
? Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.4)
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
border: isFilled
|
borderRadius: BorderRadius.circular(16),
|
||||||
? null
|
child: InkWell(
|
||||||
: Border.all(
|
onTap: onTap,
|
||||||
width: 1,
|
borderRadius: BorderRadius.circular(16),
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
child: Padding(
|
||||||
),
|
padding: padding ?? const EdgeInsets.all(20.0),
|
||||||
),
|
|
||||||
padding: const EdgeInsets.all(20),
|
|
||||||
child: child,
|
child: child,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,12 +4,16 @@ class CustomSliverAppBar extends StatelessWidget {
|
|||||||
final Widget title;
|
final Widget title;
|
||||||
final List<Widget>? actions;
|
final List<Widget>? actions;
|
||||||
final PreferredSizeWidget? bottom;
|
final PreferredSizeWidget? bottom;
|
||||||
|
final bool isMainView;
|
||||||
|
final Function()? onBackButtonPressed;
|
||||||
|
|
||||||
const CustomSliverAppBar({
|
const CustomSliverAppBar({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.title,
|
required this.title,
|
||||||
this.actions,
|
this.actions,
|
||||||
this.bottom,
|
this.bottom,
|
||||||
|
this.isMainView = false,
|
||||||
|
this.onBackButtonPressed,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -19,16 +23,29 @@ class CustomSliverAppBar extends StatelessWidget {
|
|||||||
snap: false,
|
snap: false,
|
||||||
floating: false,
|
floating: false,
|
||||||
expandedHeight: 100.0,
|
expandedHeight: 100.0,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: !isMainView,
|
||||||
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
|
titlePadding: EdgeInsets.only(
|
||||||
|
bottom: bottom != null ? 16.0 : 14.0,
|
||||||
|
left: isMainView ? 20.0 : 55.0,
|
||||||
|
),
|
||||||
|
title: title,
|
||||||
|
),
|
||||||
|
leading: isMainView
|
||||||
|
? null
|
||||||
|
: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.arrow_back,
|
||||||
|
color: Theme.of(context).textTheme.headline6!.color,
|
||||||
|
),
|
||||||
|
onPressed:
|
||||||
|
onBackButtonPressed ?? () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
backgroundColor: MaterialStateColor.resolveWith(
|
backgroundColor: MaterialStateColor.resolveWith(
|
||||||
(states) => states.contains(MaterialState.scrolledUnder)
|
(states) => states.contains(MaterialState.scrolledUnder)
|
||||||
? Theme.of(context).colorScheme.surface
|
? Theme.of(context).colorScheme.surface
|
||||||
: Theme.of(context).canvasColor,
|
: Theme.of(context).canvasColor,
|
||||||
),
|
),
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
|
||||||
titlePadding: const EdgeInsets.only(bottom: 16.0, left: 20.0),
|
|
||||||
title: title,
|
|
||||||
),
|
|
||||||
actions: actions,
|
actions: actions,
|
||||||
bottom: bottom,
|
bottom: bottom,
|
||||||
);
|
);
|
||||||
|
@ -21,7 +21,7 @@ class SearchBar extends StatefulWidget {
|
|||||||
|
|
||||||
class _SearchBarState extends State<SearchBar> {
|
class _SearchBarState extends State<SearchBar> {
|
||||||
final TextEditingController _textController = TextEditingController();
|
final TextEditingController _textController = TextEditingController();
|
||||||
bool _toggleSelectAll = true;
|
bool _toggleSelectAll = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
|
|||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.0.14+14
|
version: 0.0.18+18
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.5 <3.0.0"
|
sdk: ">=2.17.5 <3.0.0"
|
||||||
@ -54,7 +54,10 @@ dependencies:
|
|||||||
path_provider: ^2.0.11
|
path_provider: ^2.0.11
|
||||||
permission_handler: ^10.0.0
|
permission_handler: ^10.0.0
|
||||||
pull_to_refresh: ^2.0.0
|
pull_to_refresh: ^2.0.0
|
||||||
root: ^2.0.2
|
root:
|
||||||
|
git:
|
||||||
|
url: https://github.com/gokul1630/root
|
||||||
|
ref: main
|
||||||
share_extend: ^2.0.0
|
share_extend: ^2.0.0
|
||||||
shared_preferences: ^2.0.15
|
shared_preferences: ^2.0.15
|
||||||
skeletons: ^0.0.3
|
skeletons: ^0.0.3
|
||||||
@ -63,6 +66,7 @@ dependencies:
|
|||||||
stacked_services: ^0.9.3
|
stacked_services: ^0.9.3
|
||||||
stacked_themes: ^0.3.9
|
stacked_themes: ^0.3.9
|
||||||
timeago: ^3.2.2
|
timeago: ^3.2.2
|
||||||
|
timezone: ^0.8.0
|
||||||
url_launcher: ^6.1.5
|
url_launcher: ^6.1.5
|
||||||
wakelock: ^0.6.2
|
wakelock: ^0.6.2
|
||||||
|
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
// This is a basic Flutter widget test.
|
|
||||||
//
|
|
||||||
// To perform an interaction with a widget in your test, use the WidgetTester
|
|
||||||
// utility in the flutter_test package. For example, you can send tap and scroll
|
|
||||||
// gestures. You can also use WidgetTester to find child widgets in the widget
|
|
||||||
// tree, read text, and verify that the values of widget properties are correct.
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
|
||||||
|
|
||||||
import 'package:revanced_manager/main.dart';
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
|
||||||
// Build our app and trigger a frame.
|
|
||||||
await tester.pumpWidget(const MyApp());
|
|
||||||
|
|
||||||
// Verify that our counter starts at 0.
|
|
||||||
expect(find.text('0'), findsOneWidget);
|
|
||||||
expect(find.text('1'), findsNothing);
|
|
||||||
|
|
||||||
// Tap the '+' icon and trigger a frame.
|
|
||||||
await tester.tap(find.byIcon(Icons.add));
|
|
||||||
await tester.pump();
|
|
||||||
|
|
||||||
// Verify that our counter has incremented.
|
|
||||||
expect(find.text('0'), findsNothing);
|
|
||||||
expect(find.text('1'), findsOneWidget);
|
|
||||||
});
|
|
||||||
}
|
|
Reference in New Issue
Block a user