Skip to content

Commit

Permalink
Merge pull request #1941 from ImranR98/dev
Browse files Browse the repository at this point in the history
Fix PathAccessException on secondary profiles (#1754), Log installs (#1924), APKPure URL parsing bugfix (#1926), Remove Signal source (HTML is enough) (#1928), F-Droid URL parsing bugfix (#1933), HTML link extraction bugfix (#1937)
  • Loading branch information
ImranR98 authored Nov 1, 2024
2 parents da0b1d0 + 2d5676f commit dd8acd9
Show file tree
Hide file tree
Showing 32 changed files with 38 additions and 158 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Currently supported App sources:
- Jenkins Jobs
- [APKMirror](https://apkmirror.com/) (Track-Only)
- Open Source - App-Specific:
- [Signal](https://signal.org/)
- [VLC](https://videolan.org/)
- Other - App-Specific:
- [WhatsApp](https://whatsapp.com)
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Nije pronađena aplikacija s tim ID-om ili imenom",
"reposHaveMultipleApps": "Repo-i mogu sadržavati više aplikacija",
"fdroidThirdPartyRepo": "F-Droid Repo treće strane",
"steamMobile": "Steam Mobile",
"steamChat": "Razgovor na Steamu (chat)",
"install": "Instaliraj",
"markInstalled": "Označi kao instalirano",
"update": "Nadogradi",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Žádná aplikace s tímto ID nebo názvem nebyla nalezena",
"reposHaveMultipleApps": "Repozitáře mohou obsahovat více aplikací",
"fdroidThirdPartyRepo": "F-Droid repozitář třetí strany",
"steamMobile": "Steam Mobile",
"steamChat": "Steam Chat",
"install": "Nainstalujte",
"markInstalled": "Označit jako nainstalovaný",
"update": "Aktualizovat",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Ingen app med det ID eller navn blev fundet",
"reposHaveMultipleApps": "Repos kan indeholde flere apps",
"fdroidThirdPartyRepo": "F-Droid Tredjeparts-repo",
"steamMobile": "Steam Mobil",
"steamChat": "Steam Chat",
"install": "Installer",
"markInstalled": "Markér som installeret",
"update": "Opdater",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Es wurde keine App mit dieser ID oder diesem Namen gefunden",
"reposHaveMultipleApps": "Repos können mehrere Apps enthalten",
"fdroidThirdPartyRepo": "F-Droid-Drittanbieter-Repo",
"steamMobile": "Steam Mobile",
"steamChat": "Steam-Chat",
"install": "Installieren",
"markInstalled": "Als installiert markieren",
"update": "Aktualisieren",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/en-EO.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Neniu apo estas trovita kun tiu identigilo aŭ nomo",
"reposHaveMultipleApps": "Deponejoj povas enhavi plurajn apojn",
"fdroidThirdPartyRepo": "Tria deponejo de F-Droid",
"steamMobile": "Telefona Steam",
"steamChat": "Steam Babilejo",
"install": "Instali",
"markInstalled": "Marki kiel instalita",
"update": "Ĝisdatigi",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "No App was found with that ID or Name",
"reposHaveMultipleApps": "Repos may contain multiple Apps",
"fdroidThirdPartyRepo": "F-Droid Third-Party Repo",
"steamMobile": "Steam Mobile",
"steamChat": "Steam Chat",
"install": "Install",
"markInstalled": "Mark Installed",
"update": "Update",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "No se han encontrado aplicaciones con ese ID o nombre",
"reposHaveMultipleApps": "Los repositorios pueden contener varias aplicaciones",
"fdroidThirdPartyRepo": "Repositorio de terceros F-Droid",
"steamMobile": "Steam para móviles",
"steamChat": "Chat de Steam",
"install": "Instalar",
"markInstalled": "Marcar como instalada",
"update": "Actualizar",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "هیچ برنامه ای با آن شناسه یا نام یافت نشد",
"reposHaveMultipleApps": "مخازن ممکن است شامل چندین برنامه باشد",
"fdroidThirdPartyRepo": "مخازن شخص ثالث F-Droid",
"steamMobile": "استیم موبایل",
"steamChat": "چت استیم",
"install": "نصب",
"markInstalled": "علامت گذاری به عنوان نصب شده",
"update": "به روز رسانی",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Aucune application n'a été trouvée avec cet identifiant ou ce nom",
"reposHaveMultipleApps": "Les dépôts peuvent contenir plusieurs applications",
"fdroidThirdPartyRepo": "Dépôt tiers F-Droid",
"steamMobile": "Application mobile Steam",
"steamChat": "Steam Chat",
"install": "Installer",
"markInstalled": "Marquer comme étant installé",
"update": "Mettre à jour",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Nem található alkalmazás ezzel az azonosítóval vagy névvel",
"reposHaveMultipleApps": "A tárolók több alkalmazást is tartalmazhatnak",
"fdroidThirdPartyRepo": "F-Droid harmadik féltől származó tároló",
"steamMobile": "Steam Mobil",
"steamChat": "Steam Chat",
"install": "Telepítés",
"markInstalled": "Telepítettnek jelölés",
"update": "Frissítés",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Tidak ada aplikasi yang ditemukan dengan ID atau nama tersebut",
"reposHaveMultipleApps": "Repositori dapat berisi beberapa aplikasi",
"fdroidThirdPartyRepo": "Repositori pihak ketiga F-Droid",
"steamMobile": "Steam Mobile",
"steamChat": "Obrolan Steam",
"install": "Pasang",
"markInstalled": "Tandai terpasang",
"update": "perbarui",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Non è stata trovata alcuna app con quell'ID o nome",
"reposHaveMultipleApps": "I repository possono contenere più app",
"fdroidThirdPartyRepo": "Repository F-Droid di terze parti",
"steamMobile": "Mobile a vapore",
"steamChat": "Chat di vapore",
"install": "Installa",
"markInstalled": "Contrassegna come installata",
"update": "Aggiorna",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "そのIDや名前を持つアプリは見つかりませんでした",
"reposHaveMultipleApps": "リポジトリには複数のアプリが含まれることがあります",
"fdroidThirdPartyRepo": "F-Droid サードパーティリポジトリ",
"steamMobile": "Steamモバイル",
"steamChat": "Steamチャット",
"install": "インストール",
"markInstalled": "インストール済みとしてマークする",
"update": "アップデート",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Er is geen app gevonden met dat ID of die naam",
"reposHaveMultipleApps": "Repositories kunnen meerdere apps bevatten",
"fdroidThirdPartyRepo": "F-Droid Repository voor derden",
"steamMobile": "Steam Mobile",
"steamChat": "Steam Chat",
"install": "Installeren",
"markInstalled": "Als geïnstalleerd markeren",
"update": "Bijwerken",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Nie znaleziono aplikacji o tym identyfikatorze lub nazwie",
"reposHaveMultipleApps": "Repozytoria mogą zawierać wiele aplikacji",
"fdroidThirdPartyRepo": "Zewnętrzne repo F-Droid",
"steamMobile": "Mobilny Steam",
"steamChat": "Steam Chat",
"install": "Instaluj",
"markInstalled": "Oznacz jako zainstalowane",
"update": "Zaktualizuj",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Nenhum aplicativo foi encontrado com esse ID ou nome",
"reposHaveMultipleApps": "Repositórios podem conter múltiplos aplicativos",
"fdroidThirdPartyRepo": "Repositórios de terceiros F-Droid",
"steamMobile": "Steam para celular",
"steamChat": "Chat do Steam",
"install": "Instalar",
"markInstalled": "Marcar instalado",
"update": "Atualizar",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Приложение с таким ID или названием не было найдено",
"reposHaveMultipleApps": "В хранилище несколько приложений",
"fdroidThirdPartyRepo": "Сторонние репозитории F-Droid",
"steamMobile": "Приложение Steam",
"steamChat": "Steam Chat",
"install": "Установить",
"markInstalled": "Пометить как установленное",
"update": "Обновить",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Ingen App funnen med det namnet eller ID",
"reposHaveMultipleApps": "Förråd kan innehålla flera ApparR",
"fdroidThirdPartyRepo": "F-Droid Tredjeparts Förråd",
"steamMobile": "Steam Mobile",
"steamChat": "Steam Chat",
"install": "Installera",
"markInstalled": "Märk Installerad",
"update": "Uppdatera",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Bu kimlik veya ada sahip bir uygulama bulunamadı",
"reposHaveMultipleApps": "Depolar birden fazla uygulama içerebilir",
"fdroidThirdPartyRepo": "F-Droid Üçüncü Parti Depo",
"steamMobile": "Steam Mobil",
"steamChat": "Steam Sohbet",
"install": "Yükle",
"markInstalled": "Yüklendi olarak İşaretle",
"update": "Güncelle",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Застосунок з таким ідентифікатором або назвою не знайдено",
"reposHaveMultipleApps": "Сховища можуть містити кілька застосунків",
"fdroidThirdPartyRepo": "F-Droid Стороннє сховище",
"steamMobile": "Мобільний Steam",
"steamChat": "Чат Steam",
"install": "Встановити",
"markInstalled": "Позначити як встановлене",
"update": "Оновити",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "Không tìm thấy ứng dụng nào có ID hoặc tên đó",
"reposHaveMultipleApps": "Kho có thể chứa nhiều Ứng dụng",
"fdroidThirdPartyRepo": "Kho lưu trữ bên thứ ba F-Droid",
"steamMobile": "Điện thoại di động hơi nước",
"steamChat": "Trò chuyện hơi nước",
"install": "Cài đặt",
"markInstalled": "Đánh dấu là đã cài đặt",
"update": "Cập nhật",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/zh-Hant-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "找不到具有該 ID 或名稱的應用程式",
"reposHaveMultipleApps": "倉庫可能包含多個應用程式",
"fdroidThirdPartyRepo": "F-Droid 第三方倉庫",
"steamMobile": "Steam 行動版",
"steamChat": "Steam 聊天",
"install": "安裝",
"markInstalled": "標記為已安裝",
"update": "更新",
Expand Down
2 changes: 0 additions & 2 deletions assets/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@
"appWithIdOrNameNotFound": "未找到符合此 ID 或名称的应用",
"reposHaveMultipleApps": "存储库中可能包含多个应用",
"fdroidThirdPartyRepo": "F-Droid 第三方存储库",
"steamMobile": "Steam Mobile",
"steamChat": "Steam Chat",
"install": "安装",
"markInstalled": "标记为已安装",
"update": "更新",
Expand Down
8 changes: 7 additions & 1 deletion lib/app_sources/apkpure.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,15 @@ class APKPure extends AppSource {
String host = Uri.parse(standardUrl).host;

var res0 = await sourceRequest('$standardUrl/versions', additionalSettings);
var decodedStandardUrl = standardUrl;
try {
decodedStandardUrl = Uri.decodeFull(decodedStandardUrl);
} catch (e) {
//
}
var versionLinks = await grabLinksCommon(res0, {
'skipSort': true,
'customLinkFilterRegex': '${Uri.decodeFull(standardUrl)}/download/[^/]+\$'
'customLinkFilterRegex': '$decodedStandardUrl/download/[^/]+\$'
});

var supportedArchs = (await DeviceInfoPlugin().androidInfo).supportedAbis;
Expand Down
2 changes: 1 addition & 1 deletion lib/app_sources/fdroid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FDroid extends AppSource {
RegExpMatch? match = standardUrlRegExB.firstMatch(url);
if (match != null) {
url =
'https://${Uri.parse(match.group(0)!).host}/packages/${Uri.parse(url).pathSegments.last}';
'https://${Uri.parse(match.group(0)!).host}/packages/${Uri.parse(url).pathSegments.where((s) => s.trim().isNotEmpty).last}';
}
RegExp standardUrlRegExA = RegExp(
'^https?://(www\\.)?${getSourceRegex(hosts)}/+packages/+[^/]+',
Expand Down
2 changes: 1 addition & 1 deletion lib/app_sources/html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ String ensureAbsoluteUrl(String ambiguousUrl, Uri referenceAbsoluteUrl) {
.where((element) => element.trim().isNotEmpty)
.toList();
String absoluteUrl;
if (ambiguousUrl.startsWith('/') || currPathSegments.isEmpty) {
if (ambiguousUrl.startsWith('/')) {
absoluteUrl = '${referenceAbsoluteUrl.origin}$ambiguousUrl';
} else if (currPathSegments.isEmpty) {
absoluteUrl = '${referenceAbsoluteUrl.origin}/$ambiguousUrl';
Expand Down
37 changes: 0 additions & 37 deletions lib/app_sources/signal.dart

This file was deleted.

63 changes: 0 additions & 63 deletions lib/app_sources/steammobile.dart

This file was deleted.

13 changes: 10 additions & 3 deletions lib/providers/apps_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ class AppsProvider with ChangeNotifier {
}
}
PackageInfo? appInfo = await getInstalledInfo(apps[file.appId]!.app.id);
logs.add(
'Installing "${newInfo.packageName}" version "${newInfo.versionName}" versionCode "${newInfo.versionCode}"${appInfo != null ? ' (from existing version "${appInfo.versionName}" versionCode "${appInfo.versionCode}")' : ''}');
if (appInfo != null &&
newInfo.versionCode! < appInfo.versionCode! &&
!(await canDowngradeApps())) {
Expand Down Expand Up @@ -743,6 +745,10 @@ class AppsProvider with ChangeNotifier {
return installed;
}

Future<String> getStorageRootPath() async {
return '/${(await getExternalStorageDirectory())!.uri.pathSegments.sublist(0, 3).join('/')}';
}

Future<void> moveObbFile(File file, String appId) async {
if (!file.path.toLowerCase().endsWith('.obb')) return;

Expand All @@ -751,7 +757,7 @@ class AppsProvider with ChangeNotifier {
await Permission.storage.request();
}

String obbDirPath = "/storage/emulated/0/Android/obb/$appId";
String obbDirPath = "${await getStorageRootPath()}/Android/obb/$appId";
Directory(obbDirPath).createSync(recursive: true);

String obbFileName = file.path.split("/").last;
Expand Down Expand Up @@ -1045,10 +1051,11 @@ class AppsProvider with ChangeNotifier {
Future<void> downloadFn(MapEntry<String, String> fileUrl, App app) async {
try {
var exportDir = await settingsProvider.getExportDir();
String downloadPath = '/storage/emulated/0/Download';
String downloadPath = '${await getStorageRootPath()}/Download';
bool downloadsAccessible = false;
try {
downloadsAccessible = Directory(downloadPath).existsSync();
Directory(downloadPath).listSync();
downloadsAccessible = true;
} catch (e) {
//
}
Expand Down
Loading

0 comments on commit dd8acd9

Please sign in to comment.