Skip to content

Commit bd758af

Browse files
committed
feat(android): 更新应用图标并重新生成Android项目
更新所有分辨率下的应用图标资源,包括iOS和Android平台 重新初始化Android项目结构,修复构建路径问题 适配多分辨率设备,添加缺失的mipmap资源 版本号升级至0.5.3
1 parent 80540b9 commit bd758af

94 files changed

Lines changed: 948 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## [0.5.3] - 2026-04-30
4+
5+
### 🔧 改进优化
6+
7+
**Android 图标尺寸规范化**
8+
- 按照 Tauri 官方文档调整 Android 应用图标尺寸
9+
- 修复 Android 项目生成问题,重新初始化 Android 项目
10+
- 适配多分辨率设备(mdpi/hdpi/xhdpi/xxhdpi/xxxhdpi)
11+
12+
### 🐛 Bug 修复
13+
14+
**Android 构建错误修复**
15+
- 删除失效的 `gen/android` 目录,使用 `tauri android init` 重新生成
16+
- 修复 CI 环境中的 Android 构建路径问题
17+
18+
---
19+
320
## [0.5.2] - 2026-04-30
421

522
### 🔧 改进优化

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "proofreader",
33
"private": true,
4-
"version": "0.5.2",
4+
"version": "0.5.3",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = false
12+
insert_final_newline = false

src-tauri/gen/android/.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
key.properties
17+
18+
/.tauri
19+
/tauri.settings.gradle
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/src/main/**/generated
2+
/src/main/jniLibs/**/*.so
3+
/src/main/assets/tauri.conf.json
4+
/tauri.build.gradle.kts
5+
/proguard-tauri.pro
6+
/tauri.properties
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import java.util.Properties
2+
3+
plugins {
4+
id("com.android.application")
5+
id("org.jetbrains.kotlin.android")
6+
id("rust")
7+
}
8+
9+
val tauriProperties = Properties().apply {
10+
val propFile = file("tauri.properties")
11+
if (propFile.exists()) {
12+
propFile.inputStream().use { load(it) }
13+
}
14+
}
15+
16+
android {
17+
compileSdk = 36
18+
namespace = "cn.helilab.proofreader"
19+
defaultConfig {
20+
manifestPlaceholders["usesCleartextTraffic"] = "false"
21+
applicationId = "cn.helilab.proofreader"
22+
minSdk = 24
23+
targetSdk = 36
24+
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
25+
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
26+
}
27+
buildTypes {
28+
getByName("debug") {
29+
manifestPlaceholders["usesCleartextTraffic"] = "true"
30+
isDebuggable = true
31+
isJniDebuggable = true
32+
isMinifyEnabled = false
33+
packaging { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
34+
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
35+
jniLibs.keepDebugSymbols.add("*/x86/*.so")
36+
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
37+
}
38+
}
39+
getByName("release") {
40+
isMinifyEnabled = true
41+
proguardFiles(
42+
*fileTree(".") { include("**/*.pro") }
43+
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
44+
.toList().toTypedArray()
45+
)
46+
}
47+
}
48+
kotlinOptions {
49+
jvmTarget = "1.8"
50+
}
51+
buildFeatures {
52+
buildConfig = true
53+
}
54+
}
55+
56+
rust {
57+
rootDirRel = "../../../"
58+
}
59+
60+
dependencies {
61+
implementation("androidx.webkit:webkit:1.14.0")
62+
implementation("androidx.appcompat:appcompat:1.7.1")
63+
implementation("androidx.activity:activity-ktx:1.10.1")
64+
implementation("com.google.android.material:material:1.12.0")
65+
testImplementation("junit:junit:4.13.2")
66+
androidTestImplementation("androidx.test.ext:junit:1.1.4")
67+
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
68+
}
69+
70+
apply(from = "tauri.build.gradle.kts")
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<uses-permission android:name="android.permission.INTERNET" />
4+
5+
<!-- AndroidTV support -->
6+
<uses-feature android:name="android.software.leanback" android:required="false" />
7+
8+
<application
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:theme="@style/Theme.proofreader"
12+
android:usesCleartextTraffic="${usesCleartextTraffic}">
13+
<activity
14+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
15+
android:launchMode="singleTask"
16+
android:label="@string/main_activity_title"
17+
android:name=".MainActivity"
18+
android:exported="true">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
<!-- AndroidTV support -->
23+
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
24+
</intent-filter>
25+
</activity>
26+
27+
<provider
28+
android:name="androidx.core.content.FileProvider"
29+
android:authorities="${applicationId}.fileprovider"
30+
android:exported="false"
31+
android:grantUriPermissions="true">
32+
<meta-data
33+
android:name="android.support.FILE_PROVIDER_PATHS"
34+
android:resource="@xml/file_paths" />
35+
</provider>
36+
</application>
37+
</manifest>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package cn.helilab.proofreader
2+
3+
import android.os.Bundle
4+
import androidx.activity.enableEdgeToEdge
5+
6+
class MainActivity : TauriActivity() {
7+
override fun onCreate(savedInstanceState: Bundle?) {
8+
enableEdgeToEdge()
9+
super.onCreate(savedInstanceState)
10+
}
11+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="108dp"
4+
android:height="108dp"
5+
android:viewportWidth="108"
6+
android:viewportHeight="108">
7+
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
8+
<aapt:attr name="android:fillColor">
9+
<gradient
10+
android:endX="85.84757"
11+
android:endY="92.4963"
12+
android:startX="42.9492"
13+
android:startY="49.59793"
14+
android:type="linear">
15+
<item
16+
android:color="#44000000"
17+
android:offset="0.0" />
18+
<item
19+
android:color="#00000000"
20+
android:offset="1.0" />
21+
</gradient>
22+
</aapt:attr>
23+
</path>
24+
<path
25+
android:fillColor="#FFFFFF"
26+
android:fillType="nonZero"
27+
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
28+
android:strokeWidth="1"
29+
android:strokeColor="#00000000" />
30+
</vector>

0 commit comments

Comments
 (0)