fix: unify version source
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import java.util.Properties
|
||||
import java.io.FileInputStream
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
@@ -29,11 +32,24 @@ android {
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
val keystoreProperties = Properties()
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
|
||||
keyAlias = keystoreProperties["keyAlias"] as String
|
||||
keyPassword = keystoreProperties["keyPassword"] as String
|
||||
storeFile = file(keystoreProperties["storeFile"] as String)
|
||||
storePassword = keystoreProperties["storePassword"] as String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Internet access permissions -->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
<!-- Media access permissions (Android 13 or higher) -->
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||
|
||||
<!-- Storage access permissions (Android 12 or lower) -->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<!-- Explicitly remove media permissions that media_kit may add -->
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" tools:node="remove" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" tools:node="remove" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />
|
||||
|
||||
<application
|
||||
android:label="Plezy"
|
||||
|
||||
@@ -473,11 +473,13 @@
|
||||
DEVELOPMENT_TEAM = G88U5B5783;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = Plezy;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.edde746.plezy;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -657,11 +659,13 @@
|
||||
DEVELOPMENT_TEAM = G88U5B5783;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = Plezy;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.edde746.plezy;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -681,11 +685,13 @@
|
||||
DEVELOPMENT_TEAM = G88U5B5783;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = Plezy;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.edde746.plezy;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
class PlexConfig {
|
||||
final String baseUrl;
|
||||
final String? token;
|
||||
@@ -12,13 +14,35 @@ class PlexConfig {
|
||||
required this.baseUrl,
|
||||
this.token,
|
||||
required this.clientIdentifier,
|
||||
this.product = 'Plezy',
|
||||
this.version = '1.0.0',
|
||||
required this.product,
|
||||
required this.version,
|
||||
this.platform = 'Flutter',
|
||||
this.device,
|
||||
this.acceptJson = true,
|
||||
});
|
||||
|
||||
static Future<PlexConfig> create({
|
||||
required String baseUrl,
|
||||
String? token,
|
||||
required String clientIdentifier,
|
||||
String? product,
|
||||
String? platform,
|
||||
String? device,
|
||||
bool acceptJson = true,
|
||||
}) async {
|
||||
final packageInfo = await PackageInfo.fromPlatform();
|
||||
return PlexConfig(
|
||||
baseUrl: baseUrl,
|
||||
token: token,
|
||||
clientIdentifier: clientIdentifier,
|
||||
product: product ?? 'Plezy',
|
||||
version: packageInfo.version,
|
||||
platform: platform ?? 'Flutter',
|
||||
device: device,
|
||||
acceptJson: acceptJson,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, String> get headers {
|
||||
final headers = {
|
||||
'X-Plex-Client-Identifier': clientIdentifier,
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ class _SetupScreenState extends State<SetupScreen> {
|
||||
await storage.saveServerUrl(connection.uri);
|
||||
|
||||
// Create client with working connection
|
||||
final config = PlexConfig(
|
||||
final config = await PlexConfig.create(
|
||||
baseUrl: connection.uri,
|
||||
token: server.accessToken,
|
||||
clientIdentifier: clientId,
|
||||
|
||||
@@ -1,13 +1,36 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import '../widgets/desktop_app_bar.dart';
|
||||
|
||||
class AboutScreen extends StatelessWidget {
|
||||
class AboutScreen extends StatefulWidget {
|
||||
const AboutScreen({super.key});
|
||||
|
||||
@override
|
||||
State<AboutScreen> createState() => _AboutScreenState();
|
||||
}
|
||||
|
||||
class _AboutScreenState extends State<AboutScreen> {
|
||||
String _appName = '';
|
||||
String _appVersion = '';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadPackageInfo();
|
||||
}
|
||||
|
||||
Future<void> _loadPackageInfo() async {
|
||||
final packageInfo = await PackageInfo.fromPlatform();
|
||||
setState(() {
|
||||
_appName = 'Plezy';
|
||||
_appVersion = packageInfo.version;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const appName = 'Plezy';
|
||||
const appVersion = '1.0.0';
|
||||
final appName = _appName;
|
||||
final appVersion = _appVersion;
|
||||
|
||||
return Scaffold(
|
||||
body: CustomScrollView(
|
||||
|
||||
@@ -266,7 +266,7 @@ class _DiscoverScreenState extends State<DiscoverScreen> with Refreshable {
|
||||
}
|
||||
|
||||
// Create new client
|
||||
final config = PlexConfig(
|
||||
final config = await PlexConfig.create(
|
||||
baseUrl: connection.uri,
|
||||
token: server.accessToken,
|
||||
clientIdentifier: clientId,
|
||||
|
||||
@@ -96,7 +96,7 @@ class _ServerSelectionScreenState extends State<ServerSelectionScreen> {
|
||||
storage.getClientIdentifier() ?? widget.authService.clientIdentifier;
|
||||
|
||||
// Create client and navigate to main app
|
||||
final config = PlexConfig(
|
||||
final config = await PlexConfig.create(
|
||||
baseUrl: connection.uri,
|
||||
token: server.accessToken,
|
||||
clientIdentifier: clientId,
|
||||
|
||||
+1
-1
@@ -562,7 +562,7 @@ packages:
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
package_info_plus:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: package_info_plus
|
||||
sha256: f69da0d3189a4b4ceaeb1a3defb0f329b3b352517f52bed4290f83d4f06bc08d
|
||||
|
||||
+2
-1
@@ -1,7 +1,7 @@
|
||||
name: plezy
|
||||
description: "A beautiful Plex client for Flutter"
|
||||
publish_to: "none"
|
||||
version: 0.1.0
|
||||
version: 1.0.1+3
|
||||
|
||||
environment:
|
||||
sdk: ^3.8.1
|
||||
@@ -25,6 +25,7 @@ dependencies:
|
||||
window_manager: ^0.4.3
|
||||
logger: ^2.0.2
|
||||
flutter_svg: ^2.0.10
|
||||
package_info_plus: ^9.0.0
|
||||
|
||||
dependency_overrides:
|
||||
media_kit:
|
||||
|
||||
Reference in New Issue
Block a user