mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-24 03:31:03 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5838550188 | ||
|
|
e0e01ae3ee | ||
|
|
0983ba8a0f | ||
|
|
0bfa776ce7 | ||
|
|
d2b09936d1 | ||
|
|
68e9f0f7c1 | ||
|
|
c3d345de80 | ||
|
|
385c0e246a | ||
|
|
5ead49a5b7 | ||
|
|
c0760b1347 | ||
|
|
e01b323aee | ||
|
|
6f4866ef63 |
@@ -94,9 +94,12 @@ class MainActivity : FlutterActivity() {
|
|||||||
|
|
||||||
"getPatches" -> {
|
"getPatches" -> {
|
||||||
val patchBundleFilePath = call.argument<String>("patchBundleFilePath")
|
val patchBundleFilePath = call.argument<String>("patchBundleFilePath")
|
||||||
|
val cacheDirPath = call.argument<String>("cacheDirPath")
|
||||||
|
|
||||||
if (patchBundleFilePath != null) {
|
if (patchBundleFilePath != null) {
|
||||||
val patches = PatchBundleLoader.Dex(
|
val patches = PatchBundleLoader.Dex(
|
||||||
File(patchBundleFilePath)
|
File(patchBundleFilePath),
|
||||||
|
optimizedDexDirectory = File(cacheDirPath)
|
||||||
).map { patch ->
|
).map { patch ->
|
||||||
val map = HashMap<String, Any>()
|
val map = HashMap<String, Any>()
|
||||||
map["\"name\""] = "\"${patch.patchName.replace("\"","\\\"")}\""
|
map["\"name\""] = "\"${patch.patchName.replace("\"","\\\"")}\""
|
||||||
|
|||||||
@@ -306,12 +306,20 @@ class ManagerAPI {
|
|||||||
return patches;
|
return patches;
|
||||||
}
|
}
|
||||||
final File? patchBundleFile = await downloadPatches();
|
final File? patchBundleFile = await downloadPatches();
|
||||||
|
final Directory appCache = await getTemporaryDirectory();
|
||||||
|
Directory('${appCache.path}/cache').createSync();
|
||||||
|
final Directory workDir =
|
||||||
|
Directory('${appCache.path}/cache').createTempSync('tmp-');
|
||||||
|
final Directory cacheDir = Directory('${workDir.path}/cache');
|
||||||
|
cacheDir.createSync();
|
||||||
|
|
||||||
if (patchBundleFile != null) {
|
if (patchBundleFile != null) {
|
||||||
try {
|
try {
|
||||||
final patchesObject = await PatcherAPI.patcherChannel.invokeMethod(
|
final patchesObject = await PatcherAPI.patcherChannel.invokeMethod(
|
||||||
'getPatches',
|
'getPatches',
|
||||||
{
|
{
|
||||||
'patchBundleFilePath': patchBundleFile.path,
|
'patchBundleFilePath': patchBundleFile.path,
|
||||||
|
'cacheDirPath': cacheDir.path,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
final List<Map<String, dynamic>> patchesMap = [];
|
final List<Map<String, dynamic>> patchesMap = [];
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class _DynamicThemeBuilderState extends State<DynamicThemeBuilder> with WidgetsB
|
|||||||
4: darkCustomTheme,
|
4: darkCustomTheme,
|
||||||
5: darkDynamicTheme,
|
5: darkDynamicTheme,
|
||||||
},
|
},
|
||||||
fallbackTheme: brightness == Brightness.light ? lightCustomTheme : darkCustomTheme,
|
fallbackTheme: PlatformDispatcher.instance.platformBrightness == Brightness.light ? lightCustomTheme : darkCustomTheme,
|
||||||
),
|
),
|
||||||
builder: (context, theme) => MaterialApp(
|
builder: (context, theme) => MaterialApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
|||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
bottom: PreferredSize(
|
bottom: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(64.0),
|
preferredSize: const Size.fromHeight(66.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 8.0,
|
vertical: 8.0,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// ignore_for_file: use_build_context_synchronously
|
// ignore_for_file: use_build_context_synchronously
|
||||||
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:dynamic_themes/dynamic_themes.dart';
|
import 'package:dynamic_themes/dynamic_themes.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -30,9 +31,23 @@ class NavigationViewModel extends IndexTrackingViewModel {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final dynamicTheme = DynamicTheme.of(context)!;
|
||||||
if (prefs.getInt('themeMode') == null) {
|
if (prefs.getInt('themeMode') == null) {
|
||||||
await prefs.setInt('themeMode', 0);
|
await prefs.setInt('themeMode', 0);
|
||||||
|
await dynamicTheme.setTheme(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force disable Material You on Android 11 and below
|
||||||
|
if (dynamicTheme.themeId.isOdd) {
|
||||||
|
const int ANDROID_12_SDK_VERSION = 31;
|
||||||
|
final AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
|
||||||
|
if (info.version.sdkInt < ANDROID_12_SDK_VERSION) {
|
||||||
|
await prefs.setInt('themeMode', 0);
|
||||||
|
await prefs.setBool('useDynamicTheme', false);
|
||||||
|
await dynamicTheme.setTheme(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(
|
||||||
SystemUiOverlayStyle(
|
SystemUiOverlayStyle(
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(top: 12, bottom: 12),
|
margin: const EdgeInsets.only(top: 12, bottom: 12),
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 6, vertical: 6),
|
const EdgeInsets.symmetric(horizontal: 6, vertical: 6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
@@ -99,7 +99,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
),
|
),
|
||||||
CustomPopupMenu(
|
CustomPopupMenu(
|
||||||
onSelected: (value) =>
|
onSelected: (value) =>
|
||||||
{model.onMenuSelection(value, context)},
|
{model.onMenuSelection(value, context)},
|
||||||
children: {
|
children: {
|
||||||
0: I18nText(
|
0: I18nText(
|
||||||
'patchesSelectorView.loadPatchesSelection',
|
'patchesSelectorView.loadPatchesSelection',
|
||||||
@@ -114,7 +114,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
bottom: PreferredSize(
|
bottom: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(64.0),
|
preferredSize: const Size.fromHeight(66.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 8.0,
|
vertical: 8.0,
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ class SUpdateThemeUI extends StatelessWidget {
|
|||||||
label: sUpdateTheme.getThemeModeName(),
|
label: sUpdateTheme.getThemeModeName(),
|
||||||
onPressed: () => { sUpdateTheme.showThemeDialog(context) },
|
onPressed: () => { sUpdateTheme.showThemeDialog(context) },
|
||||||
),
|
),
|
||||||
|
onTap: () => { sUpdateTheme.showThemeDialog(context) },
|
||||||
),
|
),
|
||||||
FutureBuilder<int>(
|
FutureBuilder<int>(
|
||||||
future: _settingViewModel.getSdkVersion(),
|
future: _settingViewModel.getSdkVersion(),
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
|
|||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 1.10.0+101000000
|
version: 1.10.3+101000300
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0 <4.0.0'
|
sdk: '>=3.0.0 <4.0.0'
|
||||||
|
|||||||
Reference in New Issue
Block a user