config storing

This commit is contained in:
Iaphetes 2025-03-14 09:30:43 +01:00
parent df53857426
commit 95c34fb431
3 changed files with 7 additions and 8 deletions

View file

@ -32,15 +32,13 @@ android {
if (keystorePropertiesFile.exists()) { if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile)) keystoreProperties.load(FileInputStream(keystorePropertiesFile))
} }
keyAlias = keystoreProperties["keyAlias"] as String keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["password"] as String keyPassword = keystoreProperties["password"] as String
storeFile = file(keystoreProperties["storeFile"] as String) storeFile = file(keystoreProperties["storeFile"] as String)
storePassword = keystoreProperties["password"] as String storePassword = keystoreProperties["password"] as String
} }
} }
buildTypes { buildTypes {
getByName("debug") { getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true" manifestPlaceholders["usesCleartextTraffic"] = "true"
@ -54,7 +52,6 @@ android {
} }
} }
getByName("release") { getByName("release") {
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = true isMinifyEnabled = true
proguardFiles( proguardFiles(
*fileTree(".") { include("**/*.pro") } *fileTree(".") { include("**/*.pro") }
@ -62,6 +59,9 @@ android {
.toList().toTypedArray() .toList().toTypedArray()
) )
} }
getByName("release") {
signingConfig = signingConfigs.getByName("release")
}
} }
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "1.8"

View file

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- AndroidTV support --> <!-- AndroidTV support -->
<uses-feature android:name="android.software.leanback" android:required="false" /> <uses-feature android:name="android.software.leanback" android:required="false" />

View file

@ -35,11 +35,11 @@ impl Default for CoreCFG {
pub fn load_config(path: Option<PathBuf>) -> Config { pub fn load_config(path: Option<PathBuf>) -> Config {
match path { match path {
Some(p) => confy::load_path(p).expect("Configuration could not be loaded"), Some(p) => confy::load_path(p).expect("Configuration could not be loaded"),
None => confy::load("apographe", Some("config")) None => confy::load("apograph", Some("config"))
.ok() .ok()
.unwrap_or_else(|| { .unwrap_or_else(|| {
let config: Config = Config::default(); let config: Config = Config::default();
let _ = confy::store("aphorme", Some("config"), Config::default()); let _ = confy::store("apograph", Some("config"), Config::default());
config config
}), }),
} }
@ -68,6 +68,7 @@ pub fn set_basepath(app_handle: tauri::AppHandle, path: String) -> bool {
// Lock the mutex to get mutable access: // Lock the mutex to get mutable access:
let mut config = config.lock().unwrap(); let mut config = config.lock().unwrap();
config.core_cfg.home_path = Some(basepath); config.core_cfg.home_path = Some(basepath);
let _ = confy::store("apograph", Some("config"), config.clone());
return true; return true;
} else { } else {
return false; return false;