build for Android

This commit is contained in:
polv committed 2026-03-04 19:07:25 +07:00
1 parent 047054f8f7
commit cf1880c2b3
14 files changed
+56 -194

No files matched your search

-1
View File
@@ -25,5 +25,4 @@ tauri-plugin-http = "2"
anyhow = "1.0.102"
tauri-plugin-fs = "2"
serde_json = "1.0.149"
reqwest = { version = "0.13.2", features = ["stream"] }
serde = "1.0.228"
+2 -21
View File
@@ -8,26 +8,7 @@
"permissions": [
"core:default",
"opener:default",
{
"identifier": "http:default",
"allow": [
{
"url": "https://api.github.com"
}
]
},
"fs:allow-exists",
"fs:allow-read-dir",
"fs:allow-appdata-read",
{
"identifier": "fs:scope",
"allow": [
"$APPDATA/**/*.zip",
"$APPDATA/yomitan/*"
],
"deny": [
"$APPDATA/*.db"
]
}
"http:default",
"fs:default"
]
}
+2 -1
View File
@@ -16,4 +16,5 @@ local.properties
key.properties
/.tauri
/tauri.settings.gradle
/tauri.settings.gradle
keystore.properties
@@ -1,4 +1,5 @@
import java.util.Properties
import java.io.FileInputStream
plugins {
id("com.android.application")
@@ -24,6 +25,20 @@ android {
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
}
signingConfigs {
create("release") {
val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties = Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["password"] as String
storeFile = file(keystoreProperties["storeFile"] as String)
storePassword = keystoreProperties["password"] as String
}
}
buildTypes {
getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true"
@@ -43,6 +58,7 @@ android {
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
.toList().toTypedArray()
)
signingConfig = signingConfigs.getByName("release")
}
}
kotlinOptions {
-1
View File
@@ -1 +0,0 @@
*.zip
@@ -1,4 +0,0 @@
*
!.gitignore
# Pixiv_*.zip => Pixiv.zip from https://github.com/MarvNC/pixiv-yomitan/releases
Whitespace-only changes.
+3 -1
View File
@@ -1,9 +1,9 @@
use std::{fs::File, io::Write, path::PathBuf};
use cjdic2_core::{AppService, CJDicError, SqlParam, YomitanRow, YomitanZipImportResult};
use reqwest::Client;
use serde::{Deserialize, Serialize};
use tauri::{AppHandle, Emitter, Manager};
use tauri_plugin_http::reqwest::Client;
#[derive(Deserialize)]
pub struct YomitanDictEntry {
@@ -155,6 +155,8 @@ where
let content_length = response.content_length().unwrap_or(0);
let mut file = File::create(&file_pf).map_err(|e| CJDicError::Error(e.to_string()))?;
println!("{}", content_length);
// Downloading the file in chunks
let mut downloaded: u64 = 0;
while let Some(chunk) = response
-4
View File
@@ -23,10 +23,6 @@
}
},
"bundle": {
"resources": [
"resources/**/*.zip",
"resources/**/manifest.json"
],
"active": true,
"targets": "all",
"icon": [