mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-22 17:19:42 +02:00
Add toggle for App ID inferring where optional
This commit is contained in:
@@ -233,6 +233,7 @@
|
|||||||
"about": "Über",
|
"about": "Über",
|
||||||
"requiresCredentialsInSettings": "Benötigt zusätzliche Anmeldedaten (in den Einstellungen)",
|
"requiresCredentialsInSettings": "Benötigt zusätzliche Anmeldedaten (in den Einstellungen)",
|
||||||
"checkOnStart": "Überprüfe einmalig beim Start",
|
"checkOnStart": "Überprüfe einmalig beim Start",
|
||||||
|
"tryInferAppIdFromCode": "Try inferring App ID from source code",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "App entfernen?",
|
"one": "App entfernen?",
|
||||||
"other": "Apps entfernen?"
|
"other": "Apps entfernen?"
|
||||||
|
@@ -233,6 +233,7 @@
|
|||||||
"about": "About",
|
"about": "About",
|
||||||
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
||||||
"checkOnStart": "Check Once on Start",
|
"checkOnStart": "Check Once on Start",
|
||||||
|
"tryInferAppIdFromCode": "Try inferring App ID from source code",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Remove App?",
|
"one": "Remove App?",
|
||||||
"other": "Remove Apps?"
|
"other": "Remove Apps?"
|
||||||
|
@@ -233,6 +233,7 @@
|
|||||||
"about": "About",
|
"about": "About",
|
||||||
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
||||||
"checkOnStart": "Check Once on Start",
|
"checkOnStart": "Check Once on Start",
|
||||||
|
"tryInferAppIdFromCode": "Try inferring App ID from source code",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "¿Eliminar Aplicación?",
|
"one": "¿Eliminar Aplicación?",
|
||||||
"other": "¿Eliminar Aplicaciones?"
|
"other": "¿Eliminar Aplicaciones?"
|
||||||
|
@@ -233,6 +233,7 @@
|
|||||||
"about": "About",
|
"about": "About",
|
||||||
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
||||||
"checkOnStart": "Check Once on Start",
|
"checkOnStart": "Check Once on Start",
|
||||||
|
"tryInferAppIdFromCode": "Try inferring App ID from source code",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "برنامه حذف شود؟",
|
"one": "برنامه حذف شود؟",
|
||||||
"other": "برنامه ها حذف شوند؟"
|
"other": "برنامه ها حذف شوند؟"
|
||||||
|
@@ -233,6 +233,7 @@
|
|||||||
"about": "About",
|
"about": "About",
|
||||||
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
||||||
"checkOnStart": "Check Once on Start",
|
"checkOnStart": "Check Once on Start",
|
||||||
|
"tryInferAppIdFromCode": "Try inferring App ID from source code",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Supprimer l'application ?",
|
"one": "Supprimer l'application ?",
|
||||||
"other": "Supprimer les applications ?"
|
"other": "Supprimer les applications ?"
|
||||||
|
@@ -232,6 +232,7 @@
|
|||||||
"about": "Rólunk",
|
"about": "Rólunk",
|
||||||
"requiresCredentialsInSettings": "Ehhez további hitelesítő adatokra van szükség (a Beállításokban)",
|
"requiresCredentialsInSettings": "Ehhez további hitelesítő adatokra van szükség (a Beállításokban)",
|
||||||
"checkOnStart": "Egyszer az indításkor",
|
"checkOnStart": "Egyszer az indításkor",
|
||||||
|
"tryInferAppIdFromCode": "Try inferring App ID from source code",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Eltávolítja az alkalmazást?",
|
"one": "Eltávolítja az alkalmazást?",
|
||||||
"other": "Eltávolítja az alkalmazást?"
|
"other": "Eltávolítja az alkalmazást?"
|
||||||
|
@@ -233,6 +233,7 @@
|
|||||||
"about": "About",
|
"about": "About",
|
||||||
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
"requiresCredentialsInSettings": "This needs additional credentials (in Settings)",
|
||||||
"checkOnStart": "Check Once on Start",
|
"checkOnStart": "Check Once on Start",
|
||||||
|
"tryInferAppIdFromCode": "Try inferring App ID from source code",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Rimuovere l'App?",
|
"one": "Rimuovere l'App?",
|
||||||
"other": "Rimuovere le App?"
|
"other": "Rimuovere le App?"
|
||||||
|
@@ -233,6 +233,7 @@
|
|||||||
"about": "概要",
|
"about": "概要",
|
||||||
"requiresCredentialsInSettings": "これには追加の認証が必要です (設定にて)",
|
"requiresCredentialsInSettings": "これには追加の認証が必要です (設定にて)",
|
||||||
"checkOnStart": "Check Once on Start",
|
"checkOnStart": "Check Once on Start",
|
||||||
|
"tryInferAppIdFromCode": "Try inferring App ID from source code",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "アプリを削除しますか?",
|
"one": "アプリを削除しますか?",
|
||||||
"other": "アプリを削除しますか?"
|
"other": "アプリを削除しますか?"
|
||||||
|
@@ -233,6 +233,7 @@
|
|||||||
"about": "相关文档",
|
"about": "相关文档",
|
||||||
"requiresCredentialsInSettings": "此功能需要额外的凭据(在“设置”中添加)",
|
"requiresCredentialsInSettings": "此功能需要额外的凭据(在“设置”中添加)",
|
||||||
"checkOnStart": "启动时进行一次检查",
|
"checkOnStart": "启动时进行一次检查",
|
||||||
|
"tryInferAppIdFromCode": "Try inferring App ID from source code",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "是否删除应用?",
|
"one": "是否删除应用?",
|
||||||
"other": "是否删除应用?"
|
"other": "是否删除应用?"
|
||||||
|
@@ -14,6 +14,7 @@ import 'package:url_launcher/url_launcher_string.dart';
|
|||||||
class GitHub extends AppSource {
|
class GitHub extends AppSource {
|
||||||
GitHub() {
|
GitHub() {
|
||||||
host = 'github.com';
|
host = 'github.com';
|
||||||
|
appIdInferIsOptional = true;
|
||||||
|
|
||||||
additionalSourceSpecificSettingFormItems = [
|
additionalSourceSpecificSettingFormItems = [
|
||||||
GeneratedFormTextField('github-creds',
|
GeneratedFormTextField('github-creds',
|
||||||
|
@@ -33,6 +33,7 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
AppSource? pickedSource;
|
AppSource? pickedSource;
|
||||||
Map<String, dynamic> additionalSettings = {};
|
Map<String, dynamic> additionalSettings = {};
|
||||||
bool additionalSettingsValid = true;
|
bool additionalSettingsValid = true;
|
||||||
|
bool inferAppIdIfOptional = true;
|
||||||
List<String> pickedCategories = [];
|
List<String> pickedCategories = [];
|
||||||
int searchnum = 0;
|
int searchnum = 0;
|
||||||
SourceProvider sourceProvider = SourceProvider();
|
SourceProvider sourceProvider = SourceProvider();
|
||||||
@@ -78,6 +79,7 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
additionalSettingsValid = source != null
|
additionalSettingsValid = source != null
|
||||||
? !sourceProvider.ifRequiredAppSpecificSettingsExist(source)
|
? !sourceProvider.ifRequiredAppSpecificSettingsExist(source)
|
||||||
: true;
|
: true;
|
||||||
|
inferAppIdIfOptional = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -147,7 +149,8 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
app = await sourceProvider.getApp(
|
app = await sourceProvider.getApp(
|
||||||
pickedSource!, userInput, additionalSettings,
|
pickedSource!, userInput, additionalSettings,
|
||||||
trackOnlyOverride: trackOnly,
|
trackOnlyOverride: trackOnly,
|
||||||
overrideSource: pickedSourceOverride);
|
overrideSource: pickedSourceOverride,
|
||||||
|
inferAppIdIfOptional: inferAppIdIfOptional);
|
||||||
// Only download the APK here if you need to for the package ID
|
// Only download the APK here if you need to for the package ID
|
||||||
if (sourceProvider.isTempId(app) &&
|
if (sourceProvider.isTempId(app) &&
|
||||||
app.additionalSettings['trackOnly'] != true) {
|
app.additionalSettings['trackOnly'] != true) {
|
||||||
@@ -428,6 +431,23 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if (pickedSource != null && pickedSource!.appIdInferIsOptional)
|
||||||
|
GeneratedForm(
|
||||||
|
key: const Key('inferAppIdIfOptional'),
|
||||||
|
items: [
|
||||||
|
[
|
||||||
|
GeneratedFormSwitch('inferAppIdIfOptional',
|
||||||
|
label: tr('tryInferAppIdFromCode'),
|
||||||
|
defaultValue: inferAppIdIfOptional)
|
||||||
|
]
|
||||||
|
],
|
||||||
|
onValueChanges: (values, valid, isBuilding) {
|
||||||
|
if (!isBuilding) {
|
||||||
|
setState(() {
|
||||||
|
inferAppIdIfOptional = values['inferAppIdIfOptional'];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -317,6 +317,7 @@ abstract class AppSource {
|
|||||||
late String name;
|
late String name;
|
||||||
bool enforceTrackOnly = false;
|
bool enforceTrackOnly = false;
|
||||||
bool changeLogIfAnyIsMarkDown = true;
|
bool changeLogIfAnyIsMarkDown = true;
|
||||||
|
bool appIdInferIsOptional = false;
|
||||||
|
|
||||||
AppSource() {
|
AppSource() {
|
||||||
name = runtimeType.toString();
|
name = runtimeType.toString();
|
||||||
@@ -552,7 +553,8 @@ class SourceProvider {
|
|||||||
AppSource source, String url, Map<String, dynamic> additionalSettings,
|
AppSource source, String url, Map<String, dynamic> additionalSettings,
|
||||||
{App? currentApp,
|
{App? currentApp,
|
||||||
bool trackOnlyOverride = false,
|
bool trackOnlyOverride = false,
|
||||||
String? overrideSource}) async {
|
String? overrideSource,
|
||||||
|
bool inferAppIdIfOptional = false}) async {
|
||||||
if (trackOnlyOverride || source.enforceTrackOnly) {
|
if (trackOnlyOverride || source.enforceTrackOnly) {
|
||||||
additionalSettings['trackOnly'] = true;
|
additionalSettings['trackOnly'] = true;
|
||||||
}
|
}
|
||||||
@@ -592,8 +594,11 @@ class SourceProvider {
|
|||||||
: apk.names.name[0].toUpperCase() + apk.names.name.substring(1);
|
: apk.names.name[0].toUpperCase() + apk.names.name.substring(1);
|
||||||
return App(
|
return App(
|
||||||
currentApp?.id ??
|
currentApp?.id ??
|
||||||
await source.tryInferringAppId(standardUrl,
|
((!source.appIdInferIsOptional ||
|
||||||
additionalSettings: additionalSettings) ??
|
(source.appIdInferIsOptional && inferAppIdIfOptional))
|
||||||
|
? await source.tryInferringAppId(standardUrl,
|
||||||
|
additionalSettings: additionalSettings)
|
||||||
|
: null) ??
|
||||||
generateTempID(standardUrl, additionalSettings),
|
generateTempID(standardUrl, additionalSettings),
|
||||||
standardUrl,
|
standardUrl,
|
||||||
apk.names.author[0].toUpperCase() + apk.names.author.substring(1),
|
apk.names.author[0].toUpperCase() + apk.names.author.substring(1),
|
||||||
|
Reference in New Issue
Block a user