Skip to content

Commit

Permalink
Merge branch 'dev' into implement-packageinstaller-api
Browse files Browse the repository at this point in the history
  • Loading branch information
validcube authored Dec 22, 2023
2 parents d7f9d6f + f8d086a commit 68db4a1
Show file tree
Hide file tree
Showing 25 changed files with 173 additions and 348 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ReVanced Manager is an Android application that uses ReVanced Patcher to add, re

## 💪 Features

We provide the some of the features are:
Some of the features we provide are:

* 📱 **Portable**: ReVanced Patcher that fit in your pocket;
* 🤗 **Intuitive UI**: Help you manage your patched applications with easy-to-use interface;
Expand Down
4 changes: 3 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 7 additions & 3 deletions docs/3_troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ In case you encounter any issues while using ReVanced Manager, please refer to t
- 💉 Patching fails with an error

Make sure ReVanced Manager is up to date by following [🔄 Updating ReVanced Manager](2_3_updating.md) and select the **Default** button when choosing patches.

- 🚫 App not installed as package conflicts with an existing package

An existing installation of the app you're trying to patch is conflicting with the patched app. Uninstall the existing app before installing the patched app.
An existing installation of the app you're trying to patch conflicts with the patched app (i.e., signature mismatch or downgrade). Uninstall the existing app before installing the patched app.

- ❗️ Error code `135`, `139` or `1` when patching the app

Your device is not supported. Refer to the [Prerequisites](0_prerequisites.md) page for supported devices.
You may be trying to patch a split APK[^1]. This may not work under certain circumstances. In such a case, patch a full APK.

Your device may otherwise be unsupported. Please look at the [Prerequisites](0_prerequisites.md) page for supported devices.

Alternatively, you can use [ReVanced CLI](https://github.com/revanced/revanced-cli) to patch the app.

Expand All @@ -25,3 +27,5 @@ In case you encounter any issues while using ReVanced Manager, please refer to t
The next page will teach you how to build ReVanced Manager from source.

Continue: [🔨 Building from source](4_building.md)

[^1]: https://developer.android.com/guide/app-bundle/app-bundle-format
9 changes: 4 additions & 5 deletions lib/services/manager_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import 'package:revanced_manager/services/github_api.dart';
import 'package:revanced_manager/services/patcher_api.dart';
import 'package:revanced_manager/services/revanced_api.dart';
import 'package:revanced_manager/services/root_api.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
import 'package:revanced_manager/utils/check_for_supported_patch.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:timeago/timeago.dart';
Expand Down Expand Up @@ -62,7 +61,8 @@ class ManagerAPI {
Future<void> initialize() async {
_prefs = await SharedPreferences.getInstance();
isRooted = await _rootAPI.isRooted();
isDynamicThemeAvailable = (await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31
isDynamicThemeAvailable =
(await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31
storedPatchesFile =
(await getApplicationDocumentsDirectory()).path + storedPatchesFile;
}
Expand Down Expand Up @@ -585,7 +585,6 @@ class ManagerAPI {
builder: (context) => WillPopScope(
onWillPop: () async => false,
child: AlertDialog(
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
title: I18nText('warning'),
content: ValueListenableBuilder(
valueListenable: noShow,
Expand Down Expand Up @@ -620,12 +619,12 @@ class ManagerAPI {
},
),
actions: [
CustomMaterialButton(
label: I18nText('okButton'),
FilledButton(
onPressed: () {
setPatchesChangeWarning(noShow.value);
Navigator.of(context).pop();
},
child: I18nText('okButton'),
),
],
),
Expand Down
18 changes: 8 additions & 10 deletions lib/ui/views/app_selector/app_selector_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'package:revanced_manager/services/manager_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/widgets/shared/custom_material_button.dart';
import 'package:revanced_manager/utils/check_for_supported_patch.dart';
import 'package:stacked/stacked.dart';

Expand Down Expand Up @@ -105,7 +104,8 @@ class AppSelectorViewModel extends BaseViewModel {
]) async {
final String suggestedVersion =
getSuggestedVersion(application.packageName);
if (application.versionName != suggestedVersion && suggestedVersion.isNotEmpty) {
if (application.versionName != suggestedVersion &&
suggestedVersion.isNotEmpty) {
_managerAPI.suggestedAppVersionSelected = false;
if (_managerAPI.isRequireSuggestedAppVersionEnabled() &&
context.mounted) {
Expand Down Expand Up @@ -168,7 +168,6 @@ class AppSelectorViewModel extends BaseViewModel {
return showDialog(
context: context,
builder: (context) => AlertDialog(
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
title: I18nText('warning'),
content: I18nText(
'appSelectorView.requireSuggestedAppVersionDialogText',
Expand All @@ -185,9 +184,9 @@ class AppSelectorViewModel extends BaseViewModel {
),
),
actions: [
CustomMaterialButton(
label: I18nText('okButton'),
FilledButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('okButton'),
),
],
),
Expand Down Expand Up @@ -232,12 +231,12 @@ class AppSelectorViewModel extends BaseViewModel {
),
),
const SizedBox(height: 30),
CustomMaterialButton(
FilledButton(
onPressed: () async {
Navigator.pop(innerContext);
await selectAppFromStorage(context);
},
label: Row(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.sd_card),
Expand All @@ -247,12 +246,11 @@ class AppSelectorViewModel extends BaseViewModel {
),
),
const SizedBox(height: 10),
CustomMaterialButton(
isFilled: false,
TextButton(
onPressed: () {
Navigator.pop(innerContext);
},
label: Row(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(width: 10),
Expand Down
27 changes: 12 additions & 15 deletions lib/ui/views/home/home_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import 'package:revanced_manager/services/toast.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/widgets/homeView/update_confirmation_dialog.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
import 'package:stacked/stacked.dart';
import 'package:stacked_services/stacked_services.dart';

Expand Down Expand Up @@ -64,8 +63,8 @@ class HomeViewModel extends BaseViewModel {
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.requestNotificationsPermission();
final bool isConnected = await Connectivity().checkConnectivity() !=
ConnectivityResult.none;
final bool isConnected =
await Connectivity().checkConnectivity() != ConnectivityResult.none;
if (!isConnected) {
_toast.showBottom('homeView.noConnection');
}
Expand Down Expand Up @@ -223,21 +222,20 @@ class HomeViewModel extends BaseViewModel {
},
),
actions: [
CustomMaterialButton(
isFilled: false,
TextButton(
onPressed: () async {
await _managerAPI.setPatchesConsent(false);
SystemNavigator.pop();
},
label: I18nText('quitButton'),
child: I18nText('quitButton'),
),
CustomMaterialButton(
FilledButton(
onPressed: () async {
await _managerAPI.setPatchesConsent(true);
await _managerAPI.setPatchesAutoUpdate(autoUpdate.value);
Navigator.of(context).pop();
},
label: I18nText('okButton'),
child: I18nText('okButton'),
),
],
),
Expand Down Expand Up @@ -325,12 +323,12 @@ class HomeViewModel extends BaseViewModel {
const SizedBox(height: 16.0),
Align(
alignment: Alignment.centerRight,
child: CustomMaterialButton(
label: I18nText('cancelButton'),
child: FilledButton(
onPressed: () {
_revancedAPI.disposeManagerUpdateProgress();
Navigator.of(context).pop();
},
child: I18nText('cancelButton'),
),
),
],
Expand All @@ -356,22 +354,21 @@ class HomeViewModel extends BaseViewModel {
children: [
Align(
alignment: Alignment.centerRight,
child: CustomMaterialButton(
isFilled: false,
label: I18nText('cancelButton'),
child: TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: I18nText('cancelButton'),
),
),
const SizedBox(width: 8.0),
Align(
alignment: Alignment.centerRight,
child: CustomMaterialButton(
label: I18nText('updateButton'),
child: FilledButton(
onPressed: () async {
await _patcherAPI.installApk(context, downloadedApk!.path);
},
child: I18nText('updateButton'),
),
),
],
Expand Down
22 changes: 8 additions & 14 deletions lib/ui/views/installer/installer_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'package:revanced_manager/services/patcher_api.dart';
import 'package:revanced_manager/services/root_api.dart';
import 'package:revanced_manager/services/toast.dart';
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
import 'package:revanced_manager/utils/about_info.dart';
import 'package:screenshot_callback/screenshot_callback.dart';
import 'package:stacked/stacked.dart';
Expand Down Expand Up @@ -287,26 +286,24 @@ class InstallerViewModel extends BaseViewModel {
title: I18nText(
'warning',
),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
icon: const Icon(Icons.warning),
content: SingleChildScrollView(
child: I18nText('installerView.screenshotDetected'),
),
actions: <Widget>[
CustomMaterialButton(
isFilled: false,
label: I18nText('noButton'),
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: I18nText('noButton'),
),
CustomMaterialButton(
label: I18nText('yesButton'),
FilledButton(
onPressed: () {
copyLogs();
showPopupScreenshotWarning = true;
Navigator.of(context).pop();
},
child: I18nText('yesButton'),
),
],
),
Expand All @@ -323,8 +320,6 @@ class InstallerViewModel extends BaseViewModel {
title: I18nText(
'installerView.installType',
),
backgroundColor:
Theme.of(innerContext).colorScheme.secondaryContainer,
icon: const Icon(Icons.file_download_outlined),
contentPadding: const EdgeInsets.symmetric(vertical: 16),
content: SingleChildScrollView(
Expand Down Expand Up @@ -391,19 +386,18 @@ class InstallerViewModel extends BaseViewModel {
),
),
actions: [
CustomMaterialButton(
label: I18nText('cancelButton'),
isFilled: false,
TextButton(
onPressed: () {
Navigator.of(innerContext).pop();
},
child: I18nText('cancelButton'),
),
CustomMaterialButton(
label: I18nText('installerView.installButton'),
FilledButton(
onPressed: () {
Navigator.of(innerContext).pop();
installResult(context, installType.value == 1);
},
child: I18nText('installerView.installButton'),
),
],
),
Expand Down
8 changes: 3 additions & 5 deletions lib/ui/views/patch_options/patch_options_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/models/patch.dart';
import 'package:revanced_manager/ui/views/patch_options/patch_options_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/patchesSelectorView/patch_options_fields.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
import 'package:stacked/stacked.dart';

class PatchOptionsView extends StatelessWidget {
Expand Down Expand Up @@ -82,8 +81,7 @@ class PatchOptionsView extends StatelessWidget {
model.modifyOptions(value, option);
},
)
else if (option.valueType ==
'StringArray' ||
else if (option.valueType == 'StringArray' ||
option.valueType == 'IntArray' ||
option.valueType == 'LongArray')
IntStringLongListPatchOption(
Expand All @@ -104,11 +102,11 @@ class PatchOptionsView extends StatelessWidget {
const SizedBox(
height: 8,
),
CustomMaterialButton(
FilledButton(
onPressed: () {
model.showAddOptionDialog(context);
},
label: Row(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.add),
Expand Down
Loading

0 comments on commit 68db4a1

Please sign in to comment.