2

Web Developer here. Normally, I don't have a problem with new technologies but Android (specifically marshmallow) has been the exception. It seems the search results I'm getting are garbage...muddied with all kinds of Windows-Android tools that I don't want to use, and on top of that, old makeshift processes for extracting files. It seems there isn't "one way" to edit an android files/firmware...whatever and that seems crazy.

Background:

  • I try to develop on OSX
  • Using Cordova, so I'm not developing natively.
  • I inherited a client with flashed Android TV box with custom firmware (Probox2 Air Amlogic s905x)
  • On boot, the device goes right to our apk (after initial setup), no android loading screen or anything.
  • I made an update to the devices main apk (v2) that requires me to update the existing .img backup (v1) to incorporate those changes.
  • Existing backup (v1) is a .img file (That is supposed to be able to flashed to the box using Amlogics USB_BURNING_TOOL) - F*$% that...I can't get my box to connect to my PC plus I'd rather not.
  • With the modded devices, I have never been able to connect them to my computers OSX or Windows. (no device connected notifications)
  • 'adb shell' never finds the "connected" device (I should spend more time on this)
  • I've been able to flash from (stock device) > (TWRP update) using this csx tutorial but now that same sd card doesn't reinstall...TWRP boots
  • I've tried using these tools to aid my process without much success (as far as I can remember):
  • https://ibotpeaches.github.io/Apktool/documentation/
  • http://newandroidbook.com/tools/imgtool.html
  • I tried mounting the original .img file (v1) using OSXFuse to create a EXT4 partition on my mac to view the files but I wasn't able to get that working either. It couldn't partition correctly, i believe.
  • I tried mkbootingimg_tool it just moves the boot.img i extracted from TWRP to the build directory I specify.

My Goal: Create an SD Card that it can be used to flash new devices. I want to be able to insert the SD Card into the box, hold the reset button, and it flashes itself.

Current situation: I was able to construct a sd card that fit my goal and flashed successfully from (stock probox2 air device) -> (v1). I used this csx tutorial to do it.

That worked, my app launched fine and I used TWRP to make a back-up, just because.

But I cant unpack that original .img file (v1) because I can't tear it apart to make changes to my apk successfully, I've tried many things....

So then I started working with the TWRP backup files (I was able to update those apk files and repack most of the way back up) but I can't get a new working .img (v2) that flashes when its supposed to like it did when flashing v1 (it just boots to TWRP).

I can export this back-up to a sd card and view the files on my computer by renaming system.ext4.win to system.ext4.tar as described here and double clicking to extract. Then using http://www.javadecompilers.com/apk to open the custom apk that I need to change and repack (v2).

From what I gather, the process should go like this. extract .img > extract the android partition (system.img or in this case system.ext4.win) > swap out apk then repackage in reverse order.

I just need some guidance. Where am I going wrong? I feel like android studio should be all I need to do this...

adamlucia
  • 21
  • 1
  • 3

0 Answers0