Thursday, May 23, 2019

cyanogenmod - data/app folder showing wrong folder names


After messing around with the xposed framework and installing lots of modules, I got into a bootloop (classic !), but I knew the solution was to add a disabled file in data/app/de.rovb.android.xposed.installer/conf/ to disable xposed and uninstall the faulty modules.


The thing is, most of the time when I access this folder, I don't see the correct folder names, which are supposed to look like this : com.xyz.app.*. Instead, I see com.xyz.app.*-1 folders, containing a lib folder and the app's .apk file. I have to reboot into recovery a dozen times before I can access the actual folders.


I'm running CyanogenMod 12S (5.0.2) on a (rooted) OnePlus One.


I have no idea what's happening, and I couldn't find any info on that. Does anyone know why this is happening?


Thanks in advance !




Answer



Let's clear up some confusion. Things to always remember:




  • /data/app contains the APK of an app.


    (PACKAGE → package name of an app)




    • Android 4.x: if the app is installed using Package installer of Android the file name would be PACKAGE-*.apk where * is often a positive integer.


      /data/app isn't supposed to have any directory inside it.




    • Android 5.x: if the app is installed using the Package installer, a directory would be created for the app with name PACKAGE-* where * is often a positive integer. This directory contains the APK of the app with name base.apk.




  • For both Android 4.x and 5.x, /data/data contains only the data of the apps. All the apps are allotted a directory with name strictly the package name of the app.




  • For both Android 4.x and 5.x, /data/lib contains only the library (optional) of the apps. All the apps are allotted a directory with name PACKAGE-* where * is often a positive integer.





Now let's head towards the real issue.




When dealing with boot issues caused by an Xposed module, do not wander here and there.


Note:



  • Device requires to be booted into a custom recovery, data partition mounted there and setup in PC.

  • PACKAGE → package name of the Xposed module here

  • Unless explicitly mentioned otherwise, the solution would work on Android versions 4.2.1 - 5.1.1.



When you know which module is causing the boot issue


Go to /data/app and remove the APK of the troublesome module. This can be done from GUI on TWRP.


You can use command-line as an alternative


adb shell rm /data/app/PACKAGE*.apk

A less-extreme approach is to disable the Xposed module but not remove it. Head over to data directory of Xposed Installer /data/data/de.robv.android.xposed.installer, go inside conf, and remove the entry for your module from modules.list. It is up to you how you remove the line.



  • You can pull the file into PC, make changes and push it back.


  • I'd go for command-line though


    adb shell sed -i '/.*PACKAGE.*/d' /data/data/de.robv.android.xposed.installer/conf/modules.list


    sed is a stream editor and it is removing any line which contains module's package name from modules.list.




When uncertain about the exact module causing the boot issue




  • Go to to data directory of Xposed Installer /data/data/de.robv.android.xposed.installer, go inside conf, and remove or rename or revoke read permission from modules.list.




  • Alternatively, create a blank file named disabled (not disable) inside conf directory. This would cause Xposed Framework to not activate any module during boot. You can create the file using command-line



    adb shell touch /data/data/de.robv.android.xposed.installer/conf/disabled


  • Another alternative, per the framework's developer rovo89 is



    [It is] possible to disable Xposed by repeatedly pressing one of the hardware buttons during early startup. The phone will vibrate twice when the first key press has been detected. Then you have five seconds to press the same button four more times. Each key press will be confirmed with a short vibration; the final one with a long vibration. It creates /data/data/de.robv.android.xposed.installer/conf/disabled, which prevents most of Xposed's actions (e.g. ... no modules are loaded). There's no 100% guarantee that this will get you out of a bootloop, but in most cases it should.



    (Emphasis mine)






Android 4.2.x - 4.4.x


Use the file Xposed-Disabler-Recovery.zip located at /sdcard/Android/data/de.robv.android.xposed.installer/files. Flash that file from recovery mode to disable Xposed Framework. It doesn't delete the Installer app.


Download the file from official thread, if you don't have one.


That archive, in essence, changes /system/bin/app_process.orig to /system/bin/app_process. You can make those changes on your own using adb in recovery mode.


Android 5.x


The official thread hosts an uninstaller file. Download the one relevant to your CPU's architecture and flash it from recovery mode.


If you're not using the official Xposed Framework then the uninstaller may not work for you. It may even cause unforeseen issues. Best is to search the web for the uninstaller.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...