Compare commits

..

7 Commits

Author SHA1 Message Date
c129c1eeae build: bump version to v0.0.36
totally didnt forget to bump last night
2022-10-20 10:08:33 +03:00
caa9694543 feat: improve explanation of update being unusable 2022-10-20 00:15:48 +03:00
ac79765372 fix: keystore name typo. 2022-10-19 18:55:27 +05:30
39500f054d feat: disable sentry for time being. 2022-10-19 18:53:13 +05:30
f2d5cc91db Merge branch 'flutter' of https://github.com/revanced/revanced-manager into flutter 2022-10-19 16:33:00 +05:30
84a788fd9e feat: toast for disabled updates. 2022-10-19 16:32:54 +05:30
3778bfe1b5 feat(installer): remove restriction of Share APK, closes #410 (#412)
Share APK has a requirement of needing to install the patched app before sharing, this PR removes that as I see no reason for this restriction
2022-10-18 16:16:04 +03:00
11 changed files with 148 additions and 121 deletions

View File

@ -16,6 +16,7 @@
"patchedSubtitle": "Patched Applications",
"updatesAvailable": "Updates available",
"noUpdates": "No updates available",
"WIP": "Work In Progress",
"noInstallations": "No patched applications installed",
"installed": "Installed",
"updateDialogTitle": "Update Manager",
@ -26,7 +27,8 @@
"installingMessage": "Installing update...",
"errorDownloadMessage": "Unable to download update",
"errorInstallMessage": "Unable to install update",
"noConnection": "No internet connection"
"noConnection": "No internet connection",
"updatesDisabled": "Updating a patched app is currently disabled. Repatch the app again."
},
"applicationItem": {
"patchButton": "Patch",

View File

@ -19,34 +19,35 @@ Future main() async {
await locator<ManagerAPI>().initialize();
String apiUrl = locator<ManagerAPI>().getApiUrl();
await locator<RevancedAPI>().initialize(apiUrl);
bool isSentryEnabled = locator<ManagerAPI>().isSentryEnabled();
// bool isSentryEnabled = locator<ManagerAPI>().isSentryEnabled();
locator<GithubAPI>().initialize();
await locator<PatcherAPI>().initialize();
tz.initializeTimeZones();
// Remove this section if you are building from source and don't have sentry configured
await SentryFlutter.init(
(options) {
options
..dsn = isSentryEnabled ? '' : ''
..environment = 'alpha'
..release = '0.1'
..tracesSampleRate = 1.0
..anrEnabled = true
..enableOutOfMemoryTracking = true
..sampleRate = isSentryEnabled ? 1.0 : 0.0
..beforeSend = (event, hint) {
if (isSentryEnabled) {
return event;
} else {
return null;
}
} as BeforeSendCallback?;
},
appRunner: () {
runApp(const MyApp());
},
);
// await SentryFlutter.init(
// (options) {
// options
// ..dsn = isSentryEnabled ? '' : ''
// ..environment = 'alpha'
// ..release = '0.1'
// ..tracesSampleRate = 1.0
// ..anrEnabled = true
// ..enableOutOfMemoryTracking = true
// ..sampleRate = isSentryEnabled ? 1.0 : 0.0
// ..beforeSend = (event, hint) {
// if (isSentryEnabled) {
// return event;
// } else {
// return null;
// }
// } as BeforeSendCallback?;
// },
// appRunner: () {
// runApp(const MyApp());
// },
// );
runApp(const MyApp());
}
class MyApp extends StatelessWidget {

View File

@ -82,13 +82,13 @@ class ManagerAPI {
await _prefs.setBool('useDarkTheme', value);
}
bool isSentryEnabled() {
return _prefs.getBool('sentryEnabled') ?? true;
}
// bool isSentryEnabled() {
// return _prefs.getBool('sentryEnabled') ?? true;
// }
Future<void> setSentryStatus(bool value) async {
await _prefs.setBool('sentryEnabled', value);
}
// Future<void> setSentryStatus(bool value) async {
// await _prefs.setBool('sentryEnabled', value);
// }
Future<void> deleteTempFolder() async {
final Directory dir = Directory('/data/local/tmp/revanced-manager');
@ -99,7 +99,7 @@ class ManagerAPI {
Future<void> deleteKeystore() async {
final File keystore = File(
'/sdcard/Android/data/app.revanced.manager.flutter/files/revanced-keystore.keystore');
'/sdcard/Android/data/app.revanced.manager.flutter/files/revanced-manager.keystore');
if (await keystore.exists()) {
await keystore.delete();
}

View File

@ -67,20 +67,20 @@ class HomeView extends StatelessWidget {
const SizedBox(height: 8),
Row(
children: <Widget>[
DashboardChip(
label: I18nText('homeView.updatesAvailable'),
isSelected: model.showUpdatableApps,
onSelected: (value) {
model.toggleUpdatableApps(true);
},
),
const SizedBox(width: 10),
DashboardChip(
label: I18nText('homeView.installed'),
isSelected: !model.showUpdatableApps,
onSelected: (value) {
model.toggleUpdatableApps(false);
},
),
const SizedBox(width: 10),
DashboardChip(
label: I18nText('homeView.updatesAvailable'),
isSelected: model.showUpdatableApps,
onSelected: (value) {
model.toggleUpdatableApps(true);
},
)
],
),

View File

@ -29,7 +29,7 @@ class HomeViewModel extends BaseViewModel {
final Toast _toast = locator<Toast>();
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
DateTime? _lastUpdate;
bool showUpdatableApps = true;
bool showUpdatableApps = false;
List<PatchedApplication> patchedInstalledApps = [];
List<PatchedApplication> patchedUpdatableApps = [];
@ -143,6 +143,10 @@ class HomeViewModel extends BaseViewModel {
}
}
void updatesAreDisabled() {
_toast.show('homeView.updatesDisabled');
}
Future<void> showUpdateConfirmationDialog(BuildContext parentContext) async {
return showDialog(
context: parentContext,

View File

@ -219,9 +219,7 @@ class InstallerViewModel extends BaseViewModel {
void shareResult() {
try {
if (isInstalled) {
_patcherAPI.sharePatchedFile(_app.name, _app.version);
}
_patcherAPI.sharePatchedFile(_app.name, _app.version);
} on Exception catch (e, s) {
Sentry.captureException(e, stackTrace: s);
}

View File

@ -187,28 +187,28 @@ class SettingsView extends StatelessWidget {
],
),
_settingsDivider,
SettingsSection(
title: 'settingsView.logsSectionTitle',
children: <Widget>[
CustomSwitchTile(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.sentryLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
subtitle: I18nText('settingsView.sentryHint'),
value: model.isSentryEnabled(),
onTap: (value) => model.useSentry(value),
),
],
),
_settingsDivider,
// SettingsSection(
// title: 'settingsView.logsSectionTitle',
// children: <Widget>[
// CustomSwitchTile(
// padding: const EdgeInsets.symmetric(horizontal: 20.0),
// title: I18nText(
// 'settingsView.sentryLabel',
// child: const Text(
// '',
// style: TextStyle(
// fontSize: 20,
// fontWeight: FontWeight.w500,
// ),
// ),
// ),
// subtitle: I18nText('settingsView.sentryHint'),
// value: model.isSentryEnabled(),
// onTap: (value) => model.useSentry(value),
// ),
// ],
// ),
// _settingsDivider,
SettingsSection(
title: 'settingsView.infoSectionTitle',
children: <Widget>[

View File

@ -315,17 +315,15 @@ class SettingsViewModel extends BaseViewModel {
);
}
// disable sentry using switch boolean
// bool isSentryEnabled() {
// return _managerAPI.isSentryEnabled();
// }
bool isSentryEnabled() {
return _managerAPI.isSentryEnabled();
}
void useSentry(bool value) {
_managerAPI.setSentryStatus(value);
_toast.showBottom('settingsView.restartAppForChanges');
notifyListeners();
}
// void useSentry(bool value) {
// _managerAPI.setSentryStatus(value);
// _toast.showBottom('settingsView.restartAppForChanges');
// notifyListeners();
// }
void deleteKeystore() {
_managerAPI.deleteKeystore();

View File

@ -14,50 +14,74 @@ class AvailableUpdatesCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return apps.isEmpty
? CustomCard(
child: Center(
child: Column(
children: <Widget>[
Icon(
size: 40,
Icons.update_disabled,
color: Theme.of(context).colorScheme.secondary,
),
const SizedBox(height: 16),
I18nText(
'homeView.noUpdates',
child: Text(
'',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.subtitle1!.copyWith(
color: Theme.of(context).colorScheme.secondary,
),
),
)
],
),
return CustomCard(
child: Center(
child: Column(
children: <Widget>[
Icon(
size: 40,
Icons.update_disabled,
color: Theme.of(context).colorScheme.secondary,
),
)
: ListView(
shrinkWrap: true,
padding: EdgeInsets.zero,
physics: const NeverScrollableScrollPhysics(),
children: apps
.map((app) => ApplicationItem(
icon: app.icon,
name: app.name,
patchDate: app.patchDate,
changelog: app.changelog,
isUpdatableApp: true,
//TODO: Find a better way to do update functionality
onPressed: () {}
// () =>
// locator<HomeViewModel>().navigateToPatcher(
// app,
// ),
))
.toList(),
);
const SizedBox(height: 16),
I18nText(
'homeView.WIP',
child: Text(
'',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.subtitle1!.copyWith(
color: Theme.of(context).colorScheme.secondary,
),
),
)
],
),
),
);
// return apps.isEmpty
// ? CustomCard(
// child: Center(
// child: Column(
// children: <Widget>[
// Icon(
// size: 40,
// Icons.update_disabled,
// color: Theme.of(context).colorScheme.secondary,
// ),
// const SizedBox(height: 16),
// I18nText(
// 'homeView.noUpdates',
// child: Text(
// '',
// textAlign: TextAlign.center,
// style: Theme.of(context).textTheme.subtitle1!.copyWith(
// color: Theme.of(context).colorScheme.secondary,
// ),
// ),
// )
// ],
// ),
// ),
// )
// : ListView(
// shrinkWrap: true,
// padding: EdgeInsets.zero,
// physics: const NeverScrollableScrollPhysics(),
// children: apps
// .map((app) => ApplicationItem(
// icon: app.icon,
// name: app.name,
// patchDate: app.patchDate,
// changelog: app.changelog,
// isUpdatableApp: true,
// //TODO: Find a better way to do update functionality
// onPressed: () {}
// // () =>
// // locator<HomeViewModel>().navigateToPatcher(
// // app,
// // ),
// ))
// .toList(),
// );
}
}

View File

@ -110,7 +110,7 @@ class _ApplicationItemState extends State<ApplicationItem>
children: <Widget>[
CustomMaterialButton(
label: widget.isUpdatableApp
? I18nText('applicationItem.infoButton')
? I18nText('applicationItem.patchButton')
: I18nText('applicationItem.infoButton'),
onPressed: widget.onPressed,
),

View File

@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
publish_to: 'none'
version: 0.0.34+34
version: 0.0.36+36
environment:
sdk: ">=2.17.5 <3.0.0"