mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-23 17:39:42 +02:00
GitHub: Don't infer AppID if many found (#1112)
This commit is contained in:
@@ -117,22 +117,23 @@ class GitHub extends AppSource {
|
||||
.decode(body['content'].toString().split('\n').join('')))
|
||||
.split('\n')
|
||||
.map((e) => e.trim());
|
||||
var appId = trimmedLines
|
||||
.where((l) =>
|
||||
l.startsWith('applicationId "') ||
|
||||
l.startsWith('applicationId \''))
|
||||
.first;
|
||||
appId = appId
|
||||
.split(appId.startsWith('applicationId "') ? '"' : '\'')[1];
|
||||
if (appId.startsWith('\${') && appId.endsWith('}')) {
|
||||
appId = trimmedLines
|
||||
.where((l) => l.startsWith(
|
||||
'def ${appId.substring(2, appId.length - 1)}'))
|
||||
.first;
|
||||
appId = appId.split(appId.contains('"') ? '"' : '\'')[1];
|
||||
}
|
||||
if (appId.isNotEmpty) {
|
||||
var appIds = trimmedLines.where((l) =>
|
||||
l.startsWith('applicationId "') ||
|
||||
l.startsWith('applicationId \''));
|
||||
appIds = appIds.map((appId) => appId
|
||||
.split(appId.startsWith('applicationId "') ? '"' : '\'')[1]);
|
||||
appIds = appIds.map((appId) {
|
||||
if (appId.startsWith('\${') && appId.endsWith('}')) {
|
||||
appId = trimmedLines
|
||||
.where((l) => l.startsWith(
|
||||
'def ${appId.substring(2, appId.length - 1)}'))
|
||||
.first;
|
||||
appId = appId.split(appId.contains('"') ? '"' : '\'')[1];
|
||||
}
|
||||
return appId;
|
||||
}).where((appId) => appId.isNotEmpty);
|
||||
if (appIds.length == 1) {
|
||||
return appIds.first;
|
||||
}
|
||||
} catch (err) {
|
||||
LogsProvider().add(
|
||||
|
Reference in New Issue
Block a user