mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-29 12:33:28 +01:00
Compare commits
10 Commits
v0.14.23-b
...
v0.14.25-b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
547c2c8c0d | ||
|
|
7453d19d27 | ||
|
|
2a0b68d637 | ||
|
|
02f374fdf0 | ||
|
|
3536dcd775 | ||
|
|
6fa887e536 | ||
|
|
71755763b9 | ||
|
|
5aabcccfd4 | ||
|
|
1e009e2211 | ||
|
|
811bc6434b |
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Release (as Draft)
|
name: Build and Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -42,18 +42,16 @@ jobs:
|
|||||||
done
|
done
|
||||||
rm apksign.keystore
|
rm apksign.keystore
|
||||||
PGP_KEY_FINGERPRINT="${{ steps.import_pgp_key.outputs.fingerprint }}"
|
PGP_KEY_FINGERPRINT="${{ steps.import_pgp_key.outputs.fingerprint }}"
|
||||||
gpg --batch --yes --delete-secret-keys "$PGP_KEY_FINGERPRINT"
|
|
||||||
gpg --batch --yes --delete-keys "$PGP_KEY_FINGERPRINT"
|
|
||||||
|
|
||||||
- name: Extract Version
|
- name: Extract Version
|
||||||
id: extract_version
|
id: extract_version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(grep -oP "currentVersion = '\K[^']+" lib/main.dart)
|
VERSION=$(grep -oP "currentVersion = '\K[^']+" lib/main.dart)
|
||||||
echo "::set-output name=version::$VERSION"
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
TAG=$(grep -oP "'.*\\\$currentVersion.*'" lib/main.dart | head -c -2 | tail -c +2 | sed "s/\$currentVersion/$VERSION/g")
|
TAG=$(grep -oP "'.*\\\$currentVersion.*'" lib/main.dart | head -c -2 | tail -c +2 | sed "s/\$currentVersion/$VERSION/g")
|
||||||
echo "::set-output name=tag::$TAG"
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
if [ -n "$(echo $TAG | grep -oP '\-beta$')" ]; then BETA=true; else BETA=false; fi
|
if [ -n "$(echo $TAG | grep -oP '\-beta$')" ]; then BETA=true; else BETA=false; fi
|
||||||
echo "::set-output name=beta::$BETA"
|
echo "beta=$BETA" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create Tag
|
- name: Create Tag
|
||||||
uses: mathieudutour/github-tag-action@v6.1
|
uses: mathieudutour/github-tag-action@v6.1
|
||||||
@@ -70,11 +68,3 @@ jobs:
|
|||||||
prerelease: "${{ steps.extract_version.outputs.beta }}"
|
prerelease: "${{ steps.extract_version.outputs.beta }}"
|
||||||
artifacts: ./build/app/outputs/flutter-apk/*-release*.apk*
|
artifacts: ./build/app/outputs/flutter-apk/*-release*.apk*
|
||||||
generateReleaseNotes: true
|
generateReleaseNotes: true
|
||||||
draft: true
|
|
||||||
|
|
||||||
- name: Archive Reports For Job
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: reports
|
|
||||||
path: '*/build/reports'
|
|
||||||
if: ${{ always() }}
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class FDroid extends AppSource {
|
|||||||
FDroid() {
|
FDroid() {
|
||||||
host = 'f-droid.org';
|
host = 'f-droid.org';
|
||||||
name = tr('fdroid');
|
name = tr('fdroid');
|
||||||
|
naiveStandardVersionDetection = true;
|
||||||
canSearch = true;
|
canSearch = true;
|
||||||
additionalSourceAppSpecificSettingFormItems = [
|
additionalSourceAppSpecificSettingFormItems = [
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -16,14 +16,13 @@ class WhatsApp extends AppSource {
|
|||||||
@override
|
@override
|
||||||
Future<String> apkUrlPrefetchModifier(
|
Future<String> apkUrlPrefetchModifier(
|
||||||
String apkUrl, String standardUrl) async {
|
String apkUrl, String standardUrl) async {
|
||||||
Response res = await sourceRequest('https://www.whatsapp.com/android');
|
Response res = await sourceRequest('$standardUrl/android');
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
var targetLinks = parse(res.body)
|
var targetLinks = parse(res.body)
|
||||||
.querySelectorAll('a')
|
.querySelectorAll('a')
|
||||||
.map((e) => e.attributes['href'] ?? '')
|
.map((e) => e.attributes['href'] ?? '')
|
||||||
.where((e) => e.isNotEmpty)
|
.where((e) => e.isNotEmpty)
|
||||||
.where((e) =>
|
.where((e) => e.contains('WhatsApp.apk'))
|
||||||
e.contains('content.whatsapp.net') && e.contains('WhatsApp.apk'))
|
|
||||||
.toList();
|
.toList();
|
||||||
if (targetLinks.isEmpty) {
|
if (targetLinks.isEmpty) {
|
||||||
throw NoAPKError();
|
throw NoAPKError();
|
||||||
@@ -39,37 +38,16 @@ class WhatsApp extends AppSource {
|
|||||||
String standardUrl,
|
String standardUrl,
|
||||||
Map<String, dynamic> additionalSettings,
|
Map<String, dynamic> additionalSettings,
|
||||||
) async {
|
) async {
|
||||||
Response res = await sourceRequest('https://www.whatsapp.com/android');
|
// This is a CDN link that is consistent per version
|
||||||
if (res.statusCode == 200) {
|
// But it has query params that change constantly
|
||||||
var targetElements = parse(res.body)
|
Uri apkUri =
|
||||||
.querySelectorAll('p')
|
Uri.parse(await apkUrlPrefetchModifier(standardUrl, standardUrl));
|
||||||
.where((element) => element.innerHtml.contains('Version '))
|
var unusableApkUrl = '${apkUri.origin}/${apkUri.path}';
|
||||||
.toList();
|
// So we use the param-less URL is a pseudo-version to add the app and check for updates
|
||||||
if (targetElements.isEmpty) {
|
// See #357 for why we can't scrape the version number directly
|
||||||
throw NoVersionError();
|
// But we re-fetch the URL again with its latest query params at the actual download time
|
||||||
}
|
String version = unusableApkUrl.hashCode.toString();
|
||||||
var vLines = targetElements[0]
|
return APKDetails(version, getApkUrlsFromUrls([unusableApkUrl]),
|
||||||
.innerHtml
|
AppNames('Meta', 'WhatsApp'));
|
||||||
.split('\n')
|
|
||||||
.where((element) => element.contains('Version '))
|
|
||||||
.toList();
|
|
||||||
if (vLines.isEmpty) {
|
|
||||||
throw NoVersionError();
|
|
||||||
}
|
|
||||||
var versionMatch = RegExp('[0-9]+(\\.[0-9]+)+').firstMatch(vLines[0]);
|
|
||||||
if (versionMatch == null) {
|
|
||||||
throw NoVersionError();
|
|
||||||
}
|
|
||||||
String version =
|
|
||||||
vLines[0].substring(versionMatch.start, versionMatch.end);
|
|
||||||
return APKDetails(
|
|
||||||
version,
|
|
||||||
getApkUrlsFromUrls([
|
|
||||||
'https://www.whatsapp.com/android?v=$version&=thisIsaPlaceholder&a=realURLPrefetchedAtDownloadTime'
|
|
||||||
]),
|
|
||||||
AppNames('Meta', 'WhatsApp'));
|
|
||||||
} else {
|
|
||||||
throw getObtainiumHttpError(res);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:android_package_installer/android_package_installer.dart';
|
import 'package:android_package_installer/android_package_installer.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -72,6 +74,9 @@ class MultiAppMultiError extends ObtainiumError {
|
|||||||
MultiAppMultiError() : super(tr('placeholder'), unexpected: true);
|
MultiAppMultiError() : super(tr('placeholder'), unexpected: true);
|
||||||
|
|
||||||
add(String appId, dynamic error, {String? appName}) {
|
add(String appId, dynamic error, {String? appName}) {
|
||||||
|
if (error is SocketException) {
|
||||||
|
error = error.message;
|
||||||
|
}
|
||||||
rawErrors[appId] = error;
|
rawErrors[appId] = error;
|
||||||
var string = error.toString();
|
var string = error.toString();
|
||||||
var tempIds = idsByErrorString.remove(string);
|
var tempIds = idsByErrorString.remove(string);
|
||||||
@@ -83,12 +88,17 @@ class MultiAppMultiError extends ObtainiumError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String errorString(String appId) =>
|
String errorString(String appId, {bool includeIdsWithNames = false}) =>
|
||||||
'${appIdNames.containsKey(appId) ? '${appIdNames[appId]} ($appId)' : appId}: ${rawErrors[appId].toString()}';
|
'${appIdNames.containsKey(appId) ? '${appIdNames[appId]}${includeIdsWithNames ? ' ($appId)' : ''}' : appId}: ${rawErrors[appId].toString()}';
|
||||||
|
|
||||||
|
String errorsAppsString(String errString, List<String> appIds,
|
||||||
|
{bool includeIdsWithNames = false}) =>
|
||||||
|
'$errString [${list2FriendlyString(appIds.map((id) => appIdNames.containsKey(id) == true ? '${appIdNames[id]}${includeIdsWithNames ? ' ($id)' : ''}' : id).toList())}]';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => idsByErrorString.entries
|
||||||
idsByErrorString.keys.map((e) => errorString(e)).join('\n\n');
|
.map((e) => errorsAppsString(e.key, e.value))
|
||||||
|
.join('\n\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
showError(dynamic e, BuildContext context) {
|
showError(dynamic e, BuildContext context) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
|
|||||||
// ignore: implementation_imports
|
// ignore: implementation_imports
|
||||||
import 'package:easy_localization/src/localization.dart';
|
import 'package:easy_localization/src/localization.dart';
|
||||||
|
|
||||||
const String currentVersion = '0.14.23';
|
const String currentVersion = '0.14.25';
|
||||||
const String currentReleaseTag =
|
const String currentReleaseTag =
|
||||||
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
|
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
|
||||||
|
|
||||||
|
|||||||
@@ -1375,6 +1375,30 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async {
|
|||||||
logs.add(
|
logs.add(
|
||||||
'BG ${installMode ? 'install' : 'update'} task $taskId: Started (${installMode ? toInstall.length : toCheck.length}).');
|
'BG ${installMode ? 'install' : 'update'} task $taskId: Started (${installMode ? toInstall.length : toCheck.length}).');
|
||||||
|
|
||||||
|
var netResult = await (Connectivity().checkConnectivity());
|
||||||
|
|
||||||
|
if (netResult == ConnectivityResult.none) {
|
||||||
|
var networkBasedRetryInterval = 15;
|
||||||
|
var nextRegularCheck = appsProvider.settingsProvider.lastBGCheckTime
|
||||||
|
.add(Duration(minutes: appsProvider.settingsProvider.updateInterval));
|
||||||
|
var potentialNetworkRetryCheck =
|
||||||
|
DateTime.now().add(Duration(minutes: networkBasedRetryInterval));
|
||||||
|
var shouldRetry = potentialNetworkRetryCheck.isBefore(nextRegularCheck);
|
||||||
|
logs.add(
|
||||||
|
'BG update task $taskId: No network. Will ${shouldRetry ? 'retry in $networkBasedRetryInterval minutes' : 'not retry'}.');
|
||||||
|
AndroidAlarmManager.oneShot(
|
||||||
|
const Duration(minutes: 15), taskId + 1, bgUpdateCheck,
|
||||||
|
params: {
|
||||||
|
'toCheck': toCheck
|
||||||
|
.map((entry) => {'key': entry.key, 'value': entry.value})
|
||||||
|
.toList(),
|
||||||
|
'toInstall': toInstall
|
||||||
|
.map((entry) => {'key': entry.key, 'value': entry.value})
|
||||||
|
.toList(),
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!installMode) {
|
if (!installMode) {
|
||||||
// If in update mode, we check for updates.
|
// If in update mode, we check for updates.
|
||||||
// We divide the results into 4 groups:
|
// We divide the results into 4 groups:
|
||||||
@@ -1391,7 +1415,7 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async {
|
|||||||
List<App> toNotify = [];
|
List<App> toNotify = [];
|
||||||
List<MapEntry<String, int>> toRetry = [];
|
List<MapEntry<String, int>> toRetry = [];
|
||||||
var retryAfterXSeconds = 0;
|
var retryAfterXSeconds = 0;
|
||||||
List<String> toThrow = [];
|
MultiAppMultiError toThrow = MultiAppMultiError();
|
||||||
var networkRestricted = false;
|
var networkRestricted = false;
|
||||||
if (appsProvider.settingsProvider.bgUpdatesOnWiFiOnly) {
|
if (appsProvider.settingsProvider.bgUpdatesOnWiFiOnly) {
|
||||||
var netResult = await (Connectivity().checkConnectivity());
|
var netResult = await (Connectivity().checkConnectivity());
|
||||||
@@ -1427,7 +1451,7 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async {
|
|||||||
retryAfterXSeconds = minRetryIntervalForThisApp;
|
retryAfterXSeconds = minRetryIntervalForThisApp;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
toThrow.add(key);
|
toThrow.add(key, err, appName: errors?.appIdNames[key]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -1455,10 +1479,10 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send the error notifications
|
// Send the error notifications
|
||||||
if (toThrow.isNotEmpty) {
|
if (toThrow.rawErrors.isNotEmpty) {
|
||||||
for (var appId in toThrow) {
|
for (var element in toThrow.idsByErrorString.entries) {
|
||||||
notificationsProvider.notify(ErrorCheckingUpdatesNotification(
|
notificationsProvider.notify(ErrorCheckingUpdatesNotification(
|
||||||
errors!.errorString(appId),
|
errors!.errorsAppsString(element.key, element.value),
|
||||||
id: Random().nextInt(10000)));
|
id: Random().nextInt(10000)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import 'package:obtainium/app_sources/steammobile.dart';
|
|||||||
import 'package:obtainium/app_sources/telegramapp.dart';
|
import 'package:obtainium/app_sources/telegramapp.dart';
|
||||||
import 'package:obtainium/app_sources/uptodown.dart';
|
import 'package:obtainium/app_sources/uptodown.dart';
|
||||||
import 'package:obtainium/app_sources/vlc.dart';
|
import 'package:obtainium/app_sources/vlc.dart';
|
||||||
|
import 'package:obtainium/app_sources/whatsapp.dart';
|
||||||
import 'package:obtainium/components/generated_form.dart';
|
import 'package:obtainium/components/generated_form.dart';
|
||||||
import 'package:obtainium/custom_errors.dart';
|
import 'package:obtainium/custom_errors.dart';
|
||||||
import 'package:obtainium/mass_app_sources/githubstars.dart';
|
import 'package:obtainium/mass_app_sources/githubstars.dart';
|
||||||
@@ -557,7 +558,7 @@ class SourceProvider {
|
|||||||
Mullvad(),
|
Mullvad(),
|
||||||
Signal(),
|
Signal(),
|
||||||
VLC(),
|
VLC(),
|
||||||
// WhatsApp(), // As of 2023-03-20 this is unusable as the version on the webpage is months out of date
|
WhatsApp(), // As of 2023-03-20 this is unusable as the version on the webpage is months out of date
|
||||||
TelegramApp(),
|
TelegramApp(),
|
||||||
SteamMobile(),
|
SteamMobile(),
|
||||||
NeutronCode(),
|
NeutronCode(),
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
sha256: "06a96f1249f38a00435b3b0c9a3246d934d7dbc8183fc7c9e56989860edb99d4"
|
sha256: ca12e6c9ac022f33fd89128e7007fb5e97ab6e814d4fa05dd8d4f2db1e3c69cb
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.4.4"
|
version: "3.4.5"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 0.14.23+215 # When changing this, update the tag in main() accordingly
|
version: 0.14.25+217 # When changing this, update the tag in main() accordingly
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0 <4.0.0'
|
sdk: '>=3.0.0 <4.0.0'
|
||||||
|
|||||||
Reference in New Issue
Block a user