Skip to content

Commit

Permalink
Merge branch 'reduce-apk-size' of https://github.com/osociety/vernet
Browse files Browse the repository at this point in the history
…into reduce-apk-size
  • Loading branch information
git-elliot committed Feb 5, 2024
2 parents af19811 + 9363123 commit e92039d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<package android:name="org.fdroid.fdroid" />
</queries>
<application
android:label="Vernet"
Expand Down Expand Up @@ -42,7 +43,10 @@
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand Down
14 changes: 14 additions & 0 deletions lib/api/update_checker.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:convert';
import 'dart:io';

import 'package:external_app_launcher/external_app_launcher.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
Expand Down Expand Up @@ -69,11 +70,24 @@ Future<void> checkForUpdates(

Future<void> _navigateToStore() async {
String url = 'https://github.com/git-elliot/vernet/releases/latest';
final isFdroidInstalled = await LaunchApp.isAppInstalled(
androidPackageName: 'org.fdroid.fdroid',
iosUrlScheme: 'fdroid://',
);

if (Platform.isAndroid) {
if ((await PackageInfo.fromPlatform()).version.contains('store')) {
//Goto playstore
url =
'https://play.google.com/store/apps/details?id=org.fsociety.vernet.store';
} else if (isFdroidInstalled == true) {
await LaunchApp.openApp(
androidPackageName: 'org.fdroid.fdroid',
iosUrlScheme: 'fdroid://',
appStoreLink: 'itms-apps://itunes.apple.com/',
openStore: false,
);
return;
}
}
launchURL(url);
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.5
dart_ping: ^9.0.0
external_app_launcher: ^3.1.0
flutter:
sdk: flutter
# Bloc for state management, replace StatefulWidget
Expand Down

0 comments on commit e92039d

Please sign in to comment.