Skip to content

Commit

Permalink
chore: merge dev to main (#1300)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ushie authored Sep 23, 2023
2 parents d2b0993 + 0983ba8 commit e0e01ae
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ class MainActivity : FlutterActivity() {

"getPatches" -> {
val patchBundleFilePath = call.argument<String>("patchBundleFilePath")
val cacheDirPath = call.argument<String>("cacheDirPath")

if (patchBundleFilePath != null) {
val patches = PatchBundleLoader.Dex(
File(patchBundleFilePath)
File(patchBundleFilePath),
optimizedDexDirectory = File(cacheDirPath)
).map { patch ->
val map = HashMap<String, Any>()
map["\"name\""] = "\"${patch.patchName.replace("\"","\\\"")}\""
Expand Down
8 changes: 8 additions & 0 deletions lib/services/manager_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,20 @@ class ManagerAPI {
return patches;
}
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) {
try {
final patchesObject = await PatcherAPI.patcherChannel.invokeMethod(
'getPatches',
{
'patchBundleFilePath': patchBundleFile.path,
'cacheDirPath': cacheDir.path,
},
);
final List<Map<String, dynamic>> patchesMap = [];
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/views/app_selector/app_selector_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
onPressed: () => Navigator.of(context).pop(),
),
bottom: PreferredSize(
preferredSize: const Size.fromHeight(64.0),
preferredSize: const Size.fromHeight(66.0),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 8.0,
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/views/patches_selector/patches_selector_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
child: Container(
margin: const EdgeInsets.only(top: 12, bottom: 12),
padding:
const EdgeInsets.symmetric(horizontal: 6, vertical: 6),
const EdgeInsets.symmetric(horizontal: 6, vertical: 6),
decoration: BoxDecoration(
color: Theme.of(context)
.colorScheme
Expand All @@ -99,7 +99,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
),
CustomPopupMenu(
onSelected: (value) =>
{model.onMenuSelection(value, context)},
{model.onMenuSelection(value, context)},
children: {
0: I18nText(
'patchesSelectorView.loadPatchesSelection',
Expand All @@ -114,7 +114,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
),
],
bottom: PreferredSize(
preferredSize: const Size.fromHeight(64.0),
preferredSize: const Size.fromHeight(66.0),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 8.0,
Expand Down

0 comments on commit e0e01ae

Please sign in to comment.