Is wiping the data partition totally unnecessary after this adb fail and stock restore?


Question

I uninstalled this version of Xposed, because I wanted to try this one. Note: Thanks to this comment I was actually able to flash the latter too, but it gave me a bootloop. So I would caution others against that package.



So the procedure for the latter was adb, but it turns out adb doesn't work for flashing Xposed on my device. (Zenfone 2) I had only managed to install my previous version of Xposed using recovery flashing.



But when I tried the adb script, though, I got this output. However, the phone didn't reboot or anything. Just like last time. (Even though I waited a fair amount of time.)



Even though there is no evidence of it, I figured there may be a small chance that this failed adb script had done some sort of damage to my firmware. So I decided to flash the stock firmware again "just because". Why not? Anyway, that's already done.




  1. Is there any potential use to also wipe the data partition?

  2. Was there any potential benefit to restore the firmware like I did?



(I'm gonna root again and install the same Xposed Framework I initially had.)


Answer

Analyzing the InstallXposedFramework.bat script tells us the reason behind the script failure. The content of the script follows:


@echo off

set adb=files\adb.exe

echo '
echo '
echo ' Connecting ZenFone ..
echo '
echo '
%adb% wait-for-devices

echo '
echo '
echo ' Pushing files ..
echo '
echo '
%adb% push assets\xposed-sdk21-x86\system /data/local/tmp/system
%adb% push files\installer /data/local/tmp
%adb% shell "su -c chmod 755 /data/local/tmp/installer"

echo '
echo '
echo ' Installing Xposed Framework ..
echo '
echo '
%adb% shell "su -c /data/local/tmp/installer"

echo '
echo '
echo ' Done, rebooting ..
echo '
echo '
%adb% reboot



Reason behind the failure


Above, the script proceeds flawlessly until it hits:


%adb% shell "su -c chmod 755 /data/local/tmp/installer"

, whose arguments haven't been formatted correctly. Specifically, chmod, 755 and /data/local/tmp/installer are intended as three separate arguments to be supplied to su -c, which accepts one mandatory argument (that is, the command to be executed), an optional login id and an optional and arbitrary number of arguments at the end.




Patch for the script


To make the script work, the line:


%adb% shell "su -c chmod 755 /data/local/tmp/installer"

has to be edited to resemble:


%adb% shell "su -c 'chmod 755 /data/local/tmp/installer'"

, since chmod 755 /data/local/tmp/installer is an unique command (chmod) with two arguments of its own (755 /data/tmp/installer). The whole of it will then be supplied as the only argument to su -c and be executed with root permissions, allowing the script to proceed its execution.




If the phone bootloops


Then the Xposed version supplied alongside the script is somehow incompatible. The bootloop is independent from the installer script.




Should I wipe the Data partition and reflash the firmware, if I execute the original InstallXposedFramework.bat?


Absolutely not, and there's why: the commands that push Xposed to your device are the following:


%adb% push assets\xposed-sdk21-x86\system /data/local/tmp/system
%adb% push files\installer /data/local/tmp

. Since, as explained before, the command:


%adb% shell "su -c chmod 755 /data/local/tmp/installer"

is buggy and therefore makes the script hang, nothing is in fact installed. The only thing to do, is to check if the folder /data/local/tmp is empty, and delete anything inside it if it's not.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes