mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-13 21:36:42 +02:00
App-wide "pretend to be GPlay" option (#1859)
This commit is contained in:
@ -578,6 +578,22 @@ class _SettingsPageState extends State<SettingsPage> {
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
height16,
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
tr('shizukuPretendToBeGooglePlay'))),
|
||||||
|
Switch(
|
||||||
|
value: settingsProvider
|
||||||
|
.shizukuPretendToBeGooglePlay,
|
||||||
|
onChanged: (value) {
|
||||||
|
settingsProvider
|
||||||
|
.shizukuPretendToBeGooglePlay = value;
|
||||||
|
})
|
||||||
|
],
|
||||||
|
),
|
||||||
height32,
|
height32,
|
||||||
Text(
|
Text(
|
||||||
tr('sourceSpecific'),
|
tr('sourceSpecific'),
|
||||||
|
@ -879,22 +879,20 @@ class AppsProvider with ChangeNotifier {
|
|||||||
apps[id]?.installedInfo == null ? context : null;
|
apps[id]?.installedInfo == null ? context : null;
|
||||||
bool needBGWorkaround =
|
bool needBGWorkaround =
|
||||||
willBeSilent && context == null && !settingsProvider.useShizuku;
|
willBeSilent && context == null && !settingsProvider.useShizuku;
|
||||||
|
bool shizukuPretendToBeGooglePlay = settingsProvider
|
||||||
|
.shizukuPretendToBeGooglePlay ||
|
||||||
|
apps[id]!.app.additionalSettings['shizukuPretendToBeGooglePlay'] ==
|
||||||
|
true;
|
||||||
if (downloadedFile != null) {
|
if (downloadedFile != null) {
|
||||||
if (needBGWorkaround) {
|
if (needBGWorkaround) {
|
||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
installApk(downloadedFile, contextIfNewInstall,
|
installApk(downloadedFile, contextIfNewInstall,
|
||||||
needsBGWorkaround: true,
|
needsBGWorkaround: true,
|
||||||
shizukuPretendToBeGooglePlay: apps[id]!
|
shizukuPretendToBeGooglePlay: shizukuPretendToBeGooglePlay);
|
||||||
.app
|
|
||||||
.additionalSettings['shizukuPretendToBeGooglePlay'] ==
|
|
||||||
true);
|
|
||||||
} else {
|
} else {
|
||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
sayInstalled = await installApk(downloadedFile, contextIfNewInstall,
|
sayInstalled = await installApk(downloadedFile, contextIfNewInstall,
|
||||||
shizukuPretendToBeGooglePlay: apps[id]!
|
shizukuPretendToBeGooglePlay: shizukuPretendToBeGooglePlay);
|
||||||
.app
|
|
||||||
.additionalSettings['shizukuPretendToBeGooglePlay'] ==
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (needBGWorkaround) {
|
if (needBGWorkaround) {
|
||||||
@ -905,10 +903,7 @@ class AppsProvider with ChangeNotifier {
|
|||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
sayInstalled = await installXApkDir(
|
sayInstalled = await installXApkDir(
|
||||||
downloadedDir!, contextIfNewInstall,
|
downloadedDir!, contextIfNewInstall,
|
||||||
shizukuPretendToBeGooglePlay: apps[id]!
|
shizukuPretendToBeGooglePlay: shizukuPretendToBeGooglePlay);
|
||||||
.app
|
|
||||||
.additionalSettings['shizukuPretendToBeGooglePlay'] ==
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (willBeSilent && context == null) {
|
if (willBeSilent && context == null) {
|
||||||
|
@ -48,7 +48,7 @@ class SettingsProvider with ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get useShizuku{
|
bool get useShizuku {
|
||||||
return prefs?.getBool('useShizuku') ?? false;
|
return prefs?.getBool('useShizuku') ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,8 +69,7 @@ class SettingsProvider with ChangeNotifier {
|
|||||||
|
|
||||||
Color get themeColor {
|
Color get themeColor {
|
||||||
int? colorCode = prefs?.getInt('themeColor');
|
int? colorCode = prefs?.getInt('themeColor');
|
||||||
return (colorCode != null) ?
|
return (colorCode != null) ? Color(colorCode) : obtainiumThemeColor;
|
||||||
Color(colorCode) : obtainiumThemeColor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set themeColor(Color themeColor) {
|
set themeColor(Color themeColor) {
|
||||||
@ -469,4 +468,13 @@ class SettingsProvider with ChangeNotifier {
|
|||||||
prefs?.setBool('beforeNewInstallsShareToAppVerifier', val);
|
prefs?.setBool('beforeNewInstallsShareToAppVerifier', val);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get shizukuPretendToBeGooglePlay {
|
||||||
|
return prefs?.getBool('shizukuPretendToBeGooglePlay') ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
set shizukuPretendToBeGooglePlay(bool val) {
|
||||||
|
prefs?.setBool('shizukuPretendToBeGooglePlay', val);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user