mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 01:01:56 +01:00
chore: Merge branch dev
to main
(#1340)
This commit is contained in:
commit
657ba11e7e
6 changed files with 86 additions and 12 deletions
|
@ -85,7 +85,7 @@ dependencies {
|
|||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
|
||||
// ReVanced
|
||||
implementation "app.revanced:revanced-patcher:16.0.1"
|
||||
implementation "app.revanced:revanced-patcher:16.0.2"
|
||||
|
||||
// Signing & aligning
|
||||
implementation("org.bouncycastle:bcpkix-jdk15on:1.70")
|
||||
|
|
|
@ -30,10 +30,7 @@ class ExportSettingsActivity : Activity() {
|
|||
val sharedPreferences = getSharedPreferences("FlutterSharedPreferences", Context.MODE_PRIVATE)
|
||||
val allEntries: Map<String, *> = sharedPreferences.getAll()
|
||||
for ((key, value) in allEntries.entries) {
|
||||
json.put(
|
||||
key.replace("flutter.", ""),
|
||||
if (value is Boolean) if (value) 1 else 0 else value
|
||||
)
|
||||
json.put(key.replace("flutter.", ""), value)
|
||||
}
|
||||
|
||||
// Load keystore
|
||||
|
|
|
@ -158,6 +158,9 @@
|
|||
"exportApkButtonTooltip": "Export patched APK",
|
||||
"exportLogButtonTooltip": "Export log",
|
||||
|
||||
"screenshotDetected": "A screenshot has been detected. If you are trying to share the log, please share a text copy instead.\n\nCopy log to clipboard?",
|
||||
"copiedToClipboard": "Copied log to clipboard",
|
||||
|
||||
"noExit": "Installer is still running, cannot exit..."
|
||||
},
|
||||
"settingsView": {
|
||||
|
|
|
@ -273,7 +273,7 @@ class PatcherAPI {
|
|||
.replaceAll(':', '')
|
||||
.replaceAll('T', '')
|
||||
.replaceAll('.', '');
|
||||
final String fileName = 'revanced-manager_patcher_$dateTime.log';
|
||||
final String fileName = 'revanced-manager_patcher_$dateTime.txt';
|
||||
final File log = File('${logDir.path}/$fileName');
|
||||
log.writeAsStringSync(logs);
|
||||
CRFileSaver.saveFileWithDialog(
|
||||
|
|
|
@ -15,6 +15,8 @@ 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';
|
||||
import 'package:wakelock/wakelock.dart';
|
||||
|
||||
|
@ -29,6 +31,7 @@ class InstallerViewModel extends BaseViewModel {
|
|||
'app.revanced.manager.flutter/installer',
|
||||
);
|
||||
final ScrollController scrollController = ScrollController();
|
||||
final ScreenshotCallback screenshotCallback = ScreenshotCallback();
|
||||
double? progress = 0.0;
|
||||
String logs = '';
|
||||
String headerLogs = '';
|
||||
|
@ -38,6 +41,7 @@ class InstallerViewModel extends BaseViewModel {
|
|||
bool hasErrors = false;
|
||||
bool isCanceled = false;
|
||||
bool cancel = false;
|
||||
bool showPopupScreenshotWarning = true;
|
||||
|
||||
Future<void> initialize(BuildContext context) async {
|
||||
isRooted = await _rootAPI.isRooted();
|
||||
|
@ -64,6 +68,12 @@ class InstallerViewModel extends BaseViewModel {
|
|||
} // ignore
|
||||
}
|
||||
}
|
||||
screenshotCallback.addListener(() {
|
||||
if (showPopupScreenshotWarning) {
|
||||
showPopupScreenshotWarning = false;
|
||||
screenshotDetected(context);
|
||||
}
|
||||
});
|
||||
await Wakelock.enable();
|
||||
await handlePlatformChannelMethods();
|
||||
await runPatcher();
|
||||
|
@ -169,6 +179,72 @@ class InstallerViewModel extends BaseViewModel {
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> copyLogs() async {
|
||||
final info = await AboutInfo.getInfo();
|
||||
|
||||
final formattedLogs = [
|
||||
'```',
|
||||
'~ Device Info',
|
||||
'ReVanced Manager: ${info['version']}',
|
||||
'Build: ${info['flavor']}',
|
||||
'Model: ${info['model']}',
|
||||
'Android version: ${info['androidVersion']}',
|
||||
'Supported architectures: ${info['supportedArch'].join(", ")}',
|
||||
|
||||
'\n~ Patch Info',
|
||||
'App: ${_app.packageName} v${_app.version}',
|
||||
'Patches version: ${_managerAPI.patchesVersion}',
|
||||
'Patches: ${_patches.map((p) => p.name).toList().join(", ")}',
|
||||
|
||||
'\n~ Settings',
|
||||
'Enabled changing patches: ${_managerAPI.isPatchesChangeEnabled()}',
|
||||
'Enabled universal patches: ${_managerAPI.areUniversalPatchesEnabled()}',
|
||||
'Enabled experimental patches: ${_managerAPI.areExperimentalPatchesEnabled()}',
|
||||
'Patches source: ${_managerAPI.getPatchesRepo()}',
|
||||
'Integration source: ${_managerAPI.getIntegrationsRepo()}',
|
||||
|
||||
'\n~ Logs',
|
||||
logs,
|
||||
'```',
|
||||
];
|
||||
|
||||
Clipboard.setData(ClipboardData(text: formattedLogs.join('\n')));
|
||||
_toast.showBottom('installerView.copiedToClipboard');
|
||||
}
|
||||
|
||||
Future<void> screenshotDetected(BuildContext context) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
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'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
CustomMaterialButton(
|
||||
label: I18nText('yesButton'),
|
||||
onPressed: () {
|
||||
copyLogs();
|
||||
showPopupScreenshotWarning = true;
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> installTypeDialog(BuildContext context) async {
|
||||
final ValueNotifier<int> installType = ValueNotifier(0);
|
||||
if (isRooted) {
|
||||
|
@ -316,10 +392,6 @@ class InstallerViewModel extends BaseViewModel {
|
|||
}
|
||||
}
|
||||
|
||||
void exportLog() {
|
||||
_patcherAPI.exportPatcherLog(logs);
|
||||
}
|
||||
|
||||
Future<void> cleanPatcher() async {
|
||||
try {
|
||||
_patcherAPI.cleanPatcher();
|
||||
|
@ -343,7 +415,7 @@ class InstallerViewModel extends BaseViewModel {
|
|||
exportResult();
|
||||
break;
|
||||
case 1:
|
||||
exportLog();
|
||||
copyLogs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -365,6 +437,7 @@ class InstallerViewModel extends BaseViewModel {
|
|||
} else {
|
||||
_patcherAPI.cleanPatcher();
|
||||
}
|
||||
screenshotCallback.dispose();
|
||||
Navigator.of(context).pop();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
|
|||
|
||||
publish_to: 'none'
|
||||
|
||||
version: 1.11.1+101100100
|
||||
version: 1.11.2+101100200
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
|
@ -75,6 +75,7 @@ dependencies:
|
|||
flutter_markdown: ^0.6.14
|
||||
dio_cache_interceptor: ^3.4.0
|
||||
install_plugin: ^2.1.0
|
||||
screenshot_callback: ^3.0.1
|
||||
synchronized: ^3.1.0
|
||||
|
||||
dev_dependencies:
|
||||
|
|
Loading…
Reference in a new issue