1

I have recently started running Android-x86 version 6.0-RC1 on my iMac, and I am considering making it on of my several daily drivers. There is one major issue however that is casting some doubt: I cannot seem to find a way to install flashable zip files. I have looked into a custom recovery, however apparently the directory structure of Android-x86 is too different from that of its mobile-device counterpart to run or even install one directly. I have attempted to use Chainfire's FlashFire, however it unsurprisingly does not work for similar reasons to the last method.

I've read on a very short conversation in the XDA-Developers forum discussing this topic that a recovery would be relatively unnecessary because "you could simply use a lightweight Linux distro as a recovery". I am assuming from the wording that you would do this by booting a small Linux distro on the same machine, mounting the main image for Android-x86, extracting the flashable zip and running the install script contained within, however I am entirely unsure as to whether or not this method would work in practice, as I cannot find any more info on it.

I need the ability to flash a flashable zip file as it is the only way as of current aside from using a custom recovery to install the Xposed framework on android, upon which I rely heavily for everything from personal conveniences to more manually configurable security functions to ease of development. Given Android-x86's inherent compatibility with virtually anything compiled to run on an Intel Atom or Celeron based android device the lack of Xposed is the one factor stopping me from being able to attempt custom ROM development, as well as starting to port several already under development projects that have been until now exclusive to BSD/Debian distros over to rooted Intel based android devices.


UPDATE: I've managed to mount the Android-x86 fs from a live GParted CD, and chroot to it, but when running flash-script.sh it starts the installer, and output the following error log:

******************************
Xposed framework installer zip
******************************
-Mounting /system and /vendor read-write
/tmp/META-INF/com/google/android/flash-script.sh[102]: can't create /dev/null: No such file or directory
/tmp/META-INF/com/google/android/flash-script.sh[103]: can't create /dev/null: No such file or directory
/tmp/META-INF/com/google/android/flash-script.sh[104]: mount: not found
/tmp/META-INF/com/google/android/flash-script.sh[105]: can't create /dev/null: No such file or directory
-Checking Environment
/tmp/META-INF/com/google/android/flash-script.sh[112]: head: not found
/tmp/META-INF/com/google/android/flash-script.sh[112]: sed: not found
/tmp/META-INF/com/google/android/flash-script.sh[114]: cut: not found
*Continues till line 121*
 Xposed version:
! Wrong platform: arm
! This file is for:
! Please download the correct package
! for your platform/ROM

Now I'm assuming the reason this happened is that the Linux version I'm using is too lightweight and doesn't include the required programmes, however that does not explain the fact that the error log reports the system as ARM and claims the x86 version is incorrect for my platform given that I'm running a copy of Android-x86, so if anyone has insight, please supply!

  • I have a question for you: if you booted from a live media, would you be able to see Android-x86' entire filesystem (root directory included)? – Death Mask Salesman Jul 14 '16 at 15:10
  • Yes, Android-x86 uses a single .img file in which is stored the entire root filesystem, as well as the /storage/emulated/0/ user directory, however to emulate an SD card you have to create a 'data.img' file, store it in the same location as the system.img and specify it to be used in grub.cfg. It is also noteable that Android-x86 comes pre rooted, with Superuser embedded into the SecSettings.apk, so I already have full Read-Write root access from within the OS itself. Also that Xposed only has to be installed via zip, not overwrite sys files, so I could do it manually, I just don't know how. – Alison E.E. Jul 15 '16 at 1:45
  • Thanks for the clarification. Did you already try to extract the contents of the flashable ZIP and examine the syntax and operations performed by the update-binary and updater-script? – Death Mask Salesman Jul 15 '16 at 5:01
  • I just did so, it seems that the updater-script file is a dummy file, and it infact relies on flash-script.sh in the same directory, however the files contained look to be specific to Xposed, no system files appear to be overwritten, and the flash-script.sh file seems to rely on the zip first being extracted to a specific location, so I'm assuming my best bet (after confirmation that no sys files are overwritten) is to move the files manually, reboot and see what happens. Will do that and update with result. – Alison E.E. Jul 15 '16 at 7:13
  • Upon looking a second time it appears several system files are overwritten during installation. – Alison E.E. Jul 15 '16 at 7:22
2

This is caused by the install script incorrectly detecting your platform as ARM.

In order to fix this issue, which is specific to the Xposed ZIP file, you must hack edit flash-script.sh.

Search for:

if [ -z $XVALID ]; then
  echo "! Please download the correct package"
  echo "! for your platform/ROM!"
  exit 1
fi

Comment out the exit command, by adding a # before it.
At least in the current version of Xposed (v86), this is line 162 of the flash-script.sh file.

The resulting block will be:

if [ -z $XVALID ]; then
  echo "! Please download the correct package"
  echo "! for your platform/ROM!"
  #exit 1
fi


Source: How to Install Xposed on MEmu Lollipop Beta


[Edit] Since you are having a great deal of trouble, I'm going to provide detailed fool-proof steps for successfully installing Xposed on Android-x86:

  1. Download Xposed to your computer
  2. Extract the contents of the compressed file somewhere
  3. From your file manager (Finder | Windows Explorer | Nemo | Some other), open the directory where the file contents have been extracted to and browse to: META-INF \ com \ google \ android
  4. Select the entire contents of this directory and Control + C
  5. Go back to the directory containing the resulting files (same as Step 3) and then Control + V
  6. Among the files you have just copied is flash-script.sh. Now you must edit this file with a text editor of your choice, according to the previous part of this answer.
  7. Save and close the file. Make sure it is actually saved.
  8. Make a new .zip file with the updated contents, including of course the flash-script.sh file which you have edited.
  9. Send this new (make sure!) zip file to your Android-x86 environment with a method of your choice. ADB, e-mail to yourself, some anonymous temporary file upload service, etc.
  10. From Android-x86, extract the contents of this new zip file.
  11. Launch Terminal Emulator.
  12. Type in su and hit Enter
  13. If you are asked for Super User privilege, confirm (i.e. hit "Allow")
  14. Type sh "flash-script.sh" and hit Enter
  15. Reboot your phone and launch the Xposed APK to confirm whether it's been successfully installed.
  • I have tried doing the above and it still failed with the same error, I even seached for and changed every related variable to ensure that the install would work, to no avail. – Alison E.E. Sep 26 '16 at 18:04
  • @AlisonE.E. The proposed solution does not prevent the error messages from appearing. Instead it makes the script run to the end in spite of the error. You should see Placing files and Done after the error messages. Did that happen? If yes, just reboot your phone and then install the Xposed APK to make sure it's enabled. – Marc.2377 Sep 28 '16 at 17:00
  • No, I did not see either of those messages. It is also notable that as stated above this is not a copy of Android running on an ARM handheld device, it is a copy of Android 'x86' running on a Mac, and using a live Linux disc to run the script with the mounted Android 'x86' filesystem set to the root directory via 'chroot', so in the event that it is for some reason installing ARM binaries it will break/bootloop the installation. The real problem however is that it is the 'x86' binary, so it shouldn't be stating that is it meant for ARM devices, it should just install. – Alison E.E. Sep 28 '16 at 17:10
  • @AlisonE.E. I know, I'm also an Android-x86 user (I use it in VMware, however). The error message is due to an apparent bug in the install script, and I managed to successfully install Xposed on my system by following the steps provided. The only difference is, I'm running sh install-script.sh from the Terminal Emulator. No need to boot from a live Linux environmnent. In fact, this is probably the reason why it's not working for you. – Marc.2377 Sep 28 '16 at 21:31
  • I can certainly try this again, I don't believe I had tried running it directly in the terminal. One final note just in case it makes a difference: I am currently running the x86_64 build of Android x86, not the 32-bit version. I had heard talk of rovo89 compiling/releasing a version of Xposed for 64-bit, and had even volunteered to test it for him, however I never heard back, and have no idea whether or not this was released or incorporated into new versions. – Alison E.E. Sep 30 '16 at 18:30
0

Why can't you unzip the file on Windows and simply do

adb push apk\purenexus-gapps-mm-mr1-x86-leanback-20160202-signed\system\. /system

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.