Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving /data/app-lib to /sd-ext #35

Open
jfeise opened this issue Jan 9, 2014 · 1 comment
Open

Moving /data/app-lib to /sd-ext #35

jfeise opened this issue Jan 9, 2014 · 1 comment

Comments

@jfeise
Copy link

jfeise commented Jan 9, 2014

Since Jelly Bean 4.2, Android has a /data/app-lib directory, where libraries for apps are stored. They got moved out of /data/data, which now contains symlinks to the files in /data/app-lib.
S2E doesn't support moving /data/app-lib to the external sd card.
I patched the simple2ext script to add that, but haven't done anything with the UI (I have no experience with Android UI stuff.)
I'll attach my patch sometime this weekend, when I find the time.

@jfeise
Copy link
Author

jfeise commented Jan 10, 2014

I'm not that familiar with github and git in general, so I did this as an old-fashioned diff:

diff -ur a/s2e/src/main/assets/simple2ext b/s2e/src/main/assets/simple2ext
--- a/s2e/src/main/assets/simple2ext    2014-01-09 22:40:52.090303709 -0800
+++ b/s2e/src/main/assets/simple2ext    2014-01-09 22:58:21.158217764 -0800
@@ -274,6 +274,38 @@
     fi
 fi

+# app-lib
+CONFIG=`${BB} grep -q "name=\"app-lib\" value=\"true\"" ${S2E_PREF}; ${BB} echo $?`
+if [ "${CONFIG}" = "0" ];
+then
+    if [ "`${BB} egrep -q \"/data/app-lib\" /proc/mounts; ${BB} echo $?`" != "0" ];
+    then
+        if [ ! -e "${SD_EXT_DIRECTORY}/app-lib" ];
+        then
+            ${BB} mkdir ${SD_EXT_DIRECTORY}/app-lib
+            ${BB} chown system:system ${SD_EXT_DIRECTORY}/app-lib
+            ${BB} chmod 0771 ${SD_EXT_DIRECTORY}/app-lib
+        fi
+        if [ "$(ls /data/app-lib)" ];
+        then
+            ${BB} mv /data/app-lib/* ${SD_EXT_DIRECTORY}/app-lib
+            ${DELETE} /data/app-lib/*
+        fi
+
+        ${BB} mount -o bind ${SD_EXT_DIRECTORY}/app-lib/ /data/app-lib
+
+        if [ "`${BB} egrep -q \"/data/app-lib\" /proc/mounts; ${BB} echo $?`" = "0" ];
+        then
+            ${LOGGER} "${SD_EXT_DIRECTORY}/app-lib mounted as /data/app-lib"
+            ${BB} touch ${S2E_STATUS}/app-lib
+        else
+            ${LOGGER} "${SD_EXT_DIRECTORY}/app-lib not mounted..."
+        fi
+    else
+        ${LOGGER} "${SD_EXT_DIRECTORY}/app-lib already mounted..."
+    fi
+fi
+
 # Dalvik-Cache
 CONFIG=`${BB} grep -q "name=\"dalvik-cache\" value=\"true\"" ${S2E_PREF}; ${BB} echo $?`
 if [ "${CONFIG}" = "0" ];
diff -ur a/s2e/src/main/res/values/arrays.xml b/s2e/src/main/res/values/arrays.xml
--- a/s2e/src/main/res/values/arrays.xml        2014-01-09 22:40:52.101303709 -0800
+++ b/s2e/src/main/res/values/arrays.xml        2014-01-09 22:47:57.462268861 -0800
@@ -21,6 +21,7 @@
     <string-array name="targets" translatable="false">
         <item>app</item>
         <item>app-private</item>
+        <item>app-lib</item>
         <item>data</item>
         <item>dalvik-cache</item>
         <item>download</item>
diff -ur a/s2e/src/main/res/values/strings.xml b/s2e/src/main/res/values/strings.xml
--- a/s2e/src/main/res/values/strings.xml       2014-01-09 22:40:52.101303709 -0800
+++ b/s2e/src/main/res/values/strings.xml       2014-01-09 22:48:15.534267380 -0800
@@ -27,6 +27,7 @@
     <string name="apps">Applications</string>
     <string name="paid_apps">Paid apps</string>
     <string name="private_apps">Private apps</string>
+    <string name="app_lib">Application Libraries</string>
     <string name="app_data">Application Data</string>
     <string name="caches">Caches</string>
     <string name="dalvik_cache">Dalvik cache</string>
diff -ur a/s2e/src/main/res/values-de/strings.xml b/s2e/src/main/res/values-de/strings.xml
--- a/s2e/src/main/res/values-de/strings.xml    2014-01-09 22:40:52.097303709 -0800
+++ b/s2e/src/main/res/values-de/strings.xml    2014-01-09 22:51:40.350250601 -0800
@@ -26,6 +26,7 @@
     <!--MainScreen-->
     <string name="apps">Anwendungen</string>
     <string name="private_apps">Private Apps</string>
+    <string name="app_lib">Anwendungsbibliotheken</string>
     <string name="app_data">Anwendungsdaten</string>
     <string name="caches">Cache</string>
     <string name="dalvik_cache">Dalvik Cache</string>
diff -ur a/s2e/src/main/res/xml/main.xml b/s2e/src/main/res/xml/main.xml
--- a/s2e/src/main/res/xml/main.xml     2014-01-09 22:40:52.102303708 -0800
+++ b/s2e/src/main/res/xml/main.xml     2014-01-09 22:48:59.466263781 -0800
@@ -26,6 +26,12 @@
                 android:defaultValue="false"
                 android:key="app-private"/>
     </PreferenceCategory>
+    <PreferenceCategory android:title="@string/app_lib">
+        <CheckBoxPreference
+                android:title="@string/app_lib"
+                android:defaultValue="false"
+                android:key="app-lib"/>
+    </PreferenceCategory>
     <PreferenceCategory android:title="@string/app_data">
         <CheckBoxPreference
                 android:title="@string/app_data"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant