Skip to content

Commit

Permalink
Provide TMPDIR for boot image repacking (tiann#2458)
Browse files Browse the repository at this point in the history
/data/local/tmp is never writable for normal apps, why previously it
works is that Rust's temp_dir() gets path from env, and since A13,
TMPDIR is set to app's cache dir. This is not the case for A12, so it
breaks. Fix it by set TMPDIR ourselves.
  • Loading branch information
aviraxp authored and rsuntk committed Feb 22, 2025
1 parent 0669ddb commit 63e3f35
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.weishu.kernelsu

import android.app.Application
import android.system.Os
import coil.Coil
import coil.ImageLoader
import me.zhanghai.android.appiconloader.coil.AppIconFetcher
Expand Down Expand Up @@ -30,7 +31,10 @@ class KernelSUApplication : Application() {
if (!webroot.exists()) {
webroot.mkdir()
}

// Provide working env for rust's temp_dir()
Os.setenv("TMPDIR", cacheDir.absolutePath, true)
}


}
}

0 comments on commit 63e3f35

Please sign in to comment.