fix: handle resource patching hardcoded for now

This commit is contained in:
Alberto Ponces
2022-08-14 03:21:32 +01:00
parent 2cd9f99aa3
commit 31ca694f4e
3 changed files with 16 additions and 6 deletions

View File

@ -178,7 +178,7 @@ class PatcherAPI {
return false;
}
Future<bool?> createPatcher() async {
Future<bool?> createPatcher(bool resourcePatching) async {
if (_inputFile != null && _cacheDir != null) {
try {
return await platform.invokeMethod<bool>(
@ -186,6 +186,7 @@ class PatcherAPI {
{
'inputFilePath': _inputFile!.path,
'cacheDirPath': _cacheDir!.path,
'resourcePatching': resourcePatching,
},
);
} on Exception {

View File

@ -55,7 +55,15 @@ class InstallerViewModel extends BaseViewModel {
addLog('Done');
updateProgress(0.2);
addLog('Creating patcher...');
isSuccess = await locator<PatcherAPI>().createPatcher();
bool resourcePatching = false;
if (selectedApp.packageName == 'com.google.android.youtube' ||
selectedApp.packageName ==
'com.google.android.apps.youtube.music') {
resourcePatching = true;
}
isSuccess = await locator<PatcherAPI>().createPatcher(
resourcePatching,
);
if (isSuccess != null && isSuccess) {
if (selectedApp.packageName == 'com.google.android.youtube') {
addLog('Done');