Compare commits

...

4 Commits

Author SHA1 Message Date
Ushie
5838550188 build: bump version to v1.10.3 2023-09-23 13:10:46 +03:00
Ushie
e0e01ae3ee chore: merge dev to main (#1300) 2023-09-23 13:10:08 +03:00
Benjamin
0983ba8a0f fix: search bar overflow (#1301) 2023-09-23 00:51:25 +03:00
Ushie
0bfa776ce7 fix: npe when loading patch bundle on android 8 2023-09-23 00:24:17 +03:00
5 changed files with 17 additions and 6 deletions

View File

@@ -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("\"","\\\"")}\""

View File

@@ -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 = [];

View File

@@ -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,

View File

@@ -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,

View File

@@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
publish_to: 'none' publish_to: 'none'
version: 1.10.2+101000200 version: 1.10.3+101000300
environment: environment:
sdk: '>=3.0.0 <4.0.0' sdk: '>=3.0.0 <4.0.0'