Git Product home page Git Product logo

genyflash's Introduction

GenyFlash

Introduction

Genymotion is a great and fast Android emulator.

Unfortunately, its support for flashing ZIP archives is pretty limited. You can drag'n'drop files onto the emulator window, but that just copies the files contained in the system sub-folder of the archive to the /system partition. This result in wrong permissions (e.g. for executables) and other inconsistencies. In many cases, flashable archives contain more logic in their update-binary or updater-script, which is ignored by Genymotion.

This repository contains improved scripts that try to simulate custom recoveries better than that. After installing them, prepared archives should be installed properly when you drop them on emulator window.

How it works

Genymotion contains two scripts in /system/bin that are called on drag'n'drop:

  • check-archive.sh checks whether the dropped file is a flashable archive.
  • flash-archive.sh extracts the file and copies the files to the appropriate place.

The improved scripts check for META-INF/com/google/android/update-binary in the archive, which is executed by custom recoveries. If found, this file is executed in recovery mode. Any output is redirected to logcat (as it doesn't seem to be possible to send it back to the UI). This binary has to take care of all required steps, i.e. the default copying of /system files isn't done.

NOTE: Due to some traps described below, this logic is currently applied only to archives that contain a file called META-INF/com/google/android/genymotion-ready. You can use a template for this.

Installation

Simply start the virtual device and execute install.bat. If you want to return to the old behavior, you can execute uninstall.bat.

On Linux, change into the directory of this repository and execute install.sh / uninstall.sh.

Traps

The file update-binary can be any executable file. Most Android devices are running with an ARM processor, but Genymotion runs on x86. So there's a good chance that the binary isn't executable on Genymotion. The script will fail in this case.

Many archives contain a standard update-binary that interprets and executes another file called updater-script in Edify format. These scripts might contain commands that don't execute well on a running system (e.g. unmounting the system or data partition) or don't consider other special circumstances that might occur in the emulator.

It's also possible to use an ordinary shell script as updater-binary. That's a way to build archives that are flashable on different platforms. However, these scripts often refer to /sbin/sh, which is usually available in custom recoveries but not on Genymotion. The same might apply to /tmp and other files/directories.

Ideas to handle these traps can be found on https://github.com/rovo89/GenyFlash/issues.

License

The changes to the Genymotion scripts are released under the MIT license.

Additionally, I explicitly grant Genymobile (the company behind Genymotion) the permission to include these changes partly or completely in their VM images. I believe it would be a nice improvement if such support was available out-of-the-box.

genyflash's People

Contributors

maxiwell avatar rovo89 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.