mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-03 07:14:25 +02:00
chore: merge dev
to main
(#1300)
This commit is contained in:
commit
e0e01ae3ee
@ -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 = [];
|
||||||
|
@ -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,
|
||||||
|
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user