Use overlay

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-08-17 21:15:54 +03:00
parent 795ea28583
commit ce342d483c
94 changed files with 547 additions and 710 deletions

View File

@@ -0,0 +1,4 @@
final: prev:
prev.android-tools.overrideAttrs (oldAttrs: {
patches = oldAttrs.patches or [ ] ++ [ ./env-var-user-home.patch ];
})

View File

@@ -0,0 +1,21 @@
--- a/vendor/adb/adb_utils.cpp
+++ b/vendor/adb/adb_utils.cpp
@@ -308,8 +308,16 @@
}
std::string adb_get_android_dir_path() {
- std::string user_dir = adb_get_homedir_path();
- std::string android_dir = user_dir + OS_PATH_SEPARATOR + ".android";
+ const char* android_user_home = getenv("ANDROID_USER_HOME");
+ std::string android_dir;
+
+ if (android_user_home) {
+ android_dir = std::string(android_user_home);
+ } else {
+ std::string user_dir = adb_get_homedir_path();
+ android_dir = user_dir + OS_PATH_SEPARATOR + ".android";
+ }
+
struct stat buf;
if (stat(android_dir.c_str(), &buf) == -1) {
if (adb_mkdir(android_dir, 0750) == -1) {