File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
crates/tauri/mobile/android/src/main/java/app/tauri Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " tauri " : patch:bug
3+ ---
4+
5+ Update path plugin to use older dataDir API on SDK < 24.
Original file line number Diff line number Diff line change 55package app.tauri
66
77import android.app.Activity
8+ import android.os.Build
89import android.os.Environment
910import app.tauri.annotation.Command
1011import app.tauri.annotation.TauriPlugin
@@ -34,12 +35,20 @@ class PathPlugin(private val activity: Activity): Plugin(activity) {
3435
3536 @Command
3637 fun getConfigDir (invoke : Invoke ) {
38+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
3739 resolvePath(invoke, activity.dataDir.absolutePath)
40+ } else {
41+ resolvePath(invoke, activity.applicationInfo.dataDir)
42+ }
3843 }
3944
4045 @Command
4146 fun getDataDir (invoke : Invoke ) {
47+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
4248 resolvePath(invoke, activity.dataDir.absolutePath)
49+ } else {
50+ resolvePath(invoke, activity.applicationInfo.dataDir)
51+ }
4352 }
4453
4554 @Command
You can’t perform that action at this time.
0 commit comments