Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hacking with Alcatel OneTouch 6015X Fire E

739 views
Skip to first unread message

emeric....@gmail.com

unread,
Dec 16, 2015, 4:00:31 PM12/16/15
to mozilla-...@lists.mozilla.org
Hi community,

Feel free to redirect me if I'm on the wrong group.

I own an TCL-built Alcatel OneTouch 6015X Fire E phone. It comes preloaded with FXOS 1.3. Alcatel has released the source code [1], although it doesn't seem to match the installed binaries and provides no build configuration. Additionally the closed binary blobs aren't provided. FXOS 2.0 is delivered as FOTA by a specific German carrier's release channel but I don't think the source code has been released. BTW, who did the port to FXOS 2.0? TCL or the German carrier? License-wise, will/should the source code be released as for FXOS 1.3?

All in all, I would like to play with custom builds of FXOS, including my owns. But before breaking everything, I would like to first backup the original FXOS partitions and this is where problems begin.

With FXOS 1.3 loaded on the eMMC, I'm unable to boot TWRP recovery (to gain root access) from fastboot to back up the original FXOS 1.3 partitions. The phone kept stuck at the Alcatel splash screen and no more answer to adb nor fastboot. Unlocking the bootloader didn't help. However, flashing the TWRP recovery image to /recovery did the trick. Except that /recovery is no more the original one so I can't make a backup of FXOS 1.3 /recovery. To work around this, I also made a backup copy of the whole eMMC using dd on Linux (HDD Raw Copy on Windows is also helpful). The strange thing is that if I restore this backup copy to the eMMC, the phone kept stuck in download mode at the end of the restoration process: the screen is black (no Alcatel splash screen), the phone is detected as Qualcomm USB Storage and isn't recognized by adb nor fastboot. The only solution is to repair the phone using Alcatel's Mobile Upgrade Q software (takes _literally_ hours).

How do FXOS relate to this? Well, FXOS 2.0 behaves differently. Indeed, I've no problem restoring a FXOS 2.0 backup copy (still made with dd or HDD Raw Copy) to the eMMC. The phone reboots correctly at the end of the restoration process. I've also no problem booting TWRP recovery from fastboot to back up the FXOS 2.0 partitions, without needing to first flash it to /recovery as with FXOS 1.3. It's also noteworthy that with eMMC loaded with FXOS 2.0, Alcatel's Mobile Upgrade Q no more works (the phone is disconnected from USB right after the phone information is retrieved). And putting it in download mode is nearly impossible.

So, are these different behaviours between FXOS 1.3 and 2.0 related to FXOS itself or related to the phone's firmware/bootloader/something else? Are other 6015X owners experiencing the same issues? What other options do I have to make working backups of the original FXOS 1.3 partitions: direct extract from the dd image using the correct offset and byte count?

Thanks,

Émeric


[1] http://sourceforge.net/projects/alcatel/files/OT_FF_6015X_20150403.tar.xz

sylvain.joff...@gmail.com

unread,
Feb 17, 2016, 9:33:18 AM2/17/16
to mozilla-...@lists.mozilla.org
I'm interested in what you have found about this phone. I want to have FOS 2.5 on this phone and be able to get the SMS (French Free carrier) because it does'nt work well with alcatel build.

Thank you !

Alexandre Lissy

unread,
Feb 17, 2016, 9:34:44 AM2/17/16
to dev-...@lists.mozilla.org
Le 17/02/2016 14:50, sylvain.joff...@gmail.com a écrit :

[...]

>
> I'm interested in what you have found about this phone. I want to have FOS 2.5 on this phone and be able to get the SMS (French Free carrier) because it does'nt work well with alcatel build.
>
> Thank you !

SMS or MMS ? I would be surprised SMS are having issues.

emeric....@gmail.com

unread,
Feb 18, 2016, 11:26:58 AM2/18/16
to mozilla-...@lists.mozilla.org
Hi,

Le mercredi 17 février 2016 15:33:18 UTC+1, sylvain.joff...@gmail.com a écrit :
>
> I'm interested in what you have found about this phone. I want to have FOS 2.5 on this phone and be able to get the SMS (French Free carrier) because it does'nt work well with alcatel build.
>
> Thank you !

Allright, let's go.

There are two ways to get FxOS 2.5 running on Fire E: rebuilding everything from source or upgrading selected components. I'll detail this last approach now, as rebuilding everything from source requires information that I'm still lacking at the moment.

Prerequisite is that you _need_ OEM FxOS 2.0 build [1] installed and running before going further. There's _no_ way to go without it. Indeed, OEM FxOS 1.3 build is based on Android Jelly Bean 4.3 r3 (build JLS36C) whereas OEM FxOS 2.0 build is based on newer Android Kitkat (KK) 4.4.2 r2 (build KVT49L). The reason is that we'll upgrade Gecko/Gaia component whereas Gonk layer will be kept untouched. And since we'll be using Gecko/Gaia component from Mozilla Flame, we must ensure that we're running the same Gonk layer to prevent issues as much as possible.

But why use Gecko/Gaia component from Mozilla Flame, may you ask? Well, because as Mozilla's reference phone, Flame has probably the best FxOS support, with FxOS builds readily available. And also because, luckily enough, Flame and Fire E seem close siblings. Indeed, they're designed/manufactured by the same company: TCL. More exactly T2Mobile for Flame and TCT (standing for TCL Communication Technology) Mobile Limited for Fire E, both 100% subsidiaries of TCL. As another evidence of this close relationships, Flame is provided with Alcatel OneTouch-branded battery pack. And Alcatel OneTouch is the brand TCT-manufactured phones are sold under (e.g. Alcatel OneTouch 6015X for Fire E). So, I _think_ that Fire E can be seen as the consumer version of Flame (targeted at developers). Hardware seems very close too, with the exception of smaller 512MB (fixed) RAM on Fire E vs. 256MB-1GB (adjustable) on Flame, NFC support on Flame (none on Fire E) and bigger qHD (960x540 pixels) display on Fire E vs. FWVGA (854x480 pixels) on Flame. Here, we're lucky again as pixel ratio is the same (GAIA_DEV_PIXELS_PER_PX 1.5) between Flame and Fire E, so Gaia component from Flame can be used as-is.

Now, why KK-based Gonk is important? Well, because FxOS 2.x builds for Flame are KK-based. In fact, FxOS 2.0 v18D base image for Flame [2] was built on Dec. 15, 2014 while OEM FxOS 2.0 for Fire E was built on Dec. 12, 2014 so only 3 days earlier. And both are based on same Android KK KVT49L build. Pretty close, isn't it? BTW, size of /system partition on eMMC is exactly the same between Flame and Fire E, though located at different sectors. Additionally, partition names and numbering are also the same.

Ready for action? I assume that you have an external SD inserted in your Fire E. I assume that you're comfortable with Linux, familiar with adb and fastboot and that you know how to backup and unbrick your phone. I also assume that you already have backup copies of /boot, /system and /custpack partitions. For this, you need to get ClockWorkMod (CWM) recovery [3] of Alcatel OneTouch 6014X "Idol 2 Mini L" phone (Fire E's Android variant). Using CWM recovery, you can gain root access with adb when required. Upgrading Gecko/Gaia while keeping Gonk untouched will require altering /system and /custpack partitions (and /boot in one occasion). While most (all?) FxOS phones are hosting FxOS files on unique /system partition, these are spread across two distinct /system and /custpack partitions on Fire E, with symlinks from /system to /custpack for some of them. In short, Gonk/Gecko is hosted on /system on Fire E, whereas Gaia is hosted on /custpack. This is a major difference from FxOS standard layout, hence the reason I still don't have a working build configuration to rebuild everything from source and why we cannot use shallow-flash.sh script [4] as-is.

Disclaimer: Once upgraded to FxOS > 2.0, you'll lose time keeping between reboots or resume when SIM is locked and WiFi disconnected. You'll probably also lose A-GPS feature and probably other things that I didn't noticed yet ;-) Indeed, /system/b2g/distribution/bundles folder contains four... bundles: b2g_time, location, settings and telephony, the exact purpose isn't known to me. I know for sure that b2g_time bundle normally helps in keeping time while SIM is locked and WiFi disconnected. But on Fire E, this isn't sufficient: b2g_time bundle works in conjunction with telephony bundle to achieve this successfully. telephony bundle is probably used for other things telephony-related, but I don't know exactly what. location bundle is probably related to A-GPS. settings is perhaps related to customization in OEM FxOS build, such as integrated Application Manager, Torch webapp, etc. All these bundles rely on proprietary binaries by Qualcomm, compatible with Gecko 32 API only, as found in FxOS 2.0. As soon as you upgrade to FxOS > 2.0, these binaries won't work anymore as Gecko API evolves.

The upgrade procedure I'll now describe is adapted from shallow-flash.sh script. It doesn't require unlocking your device :-)

Warning: This procedure will wipe everything on your phone. So don't keep contacts, media or important data there. You've been warned.

Upgrade to FxOS 2.1 (Gecko 34):
- get Gecko/Gaia component from Flame KK device [5];
- get Fira font update [6];
- loop mount your OEM FxOS 2.0 /custpack partition image backup. This is MOUNT_DIR from now on;
- extract gaia.zip: this creates gaia folder with profile subfolder. gaia/profile is GAIA_DIR from now on;
- remove MOUNT_DIR/webapps folder and replace it with GAIA_DIR/webapps;
- overwrite MOUNT_DIR/b2g/defaults/pref/user.js with GAIA_DIR/defaults/pref/user.js;
- overwrite MOUNT_DIR/b2g/defaults/settings.js with GAIA_DIR/defaults/settings.js;
- overwrite MOUNT_DIR/b2g/user.js with GAIA_DIR/user.js;
- ensure that MOUNT_DIR/b2g and MOUNT_DIR/webapps are owned (recursively) by root:root;
- unmount the updated /custpack partition image in MOUNT_DIR.
That's all for Gaia. Now, go for Gecko:
- extract b2g-34.0.en-US.android-arm.tar.gz; it expands in b2g folder. This is B2G_DIR from now on;
- loop mount your OEM FxOS 2.0 /system partition image backup. This is MOUNT_DIR from now on;
- optionally remove MOUNT_DIR/b2g/distribution folder; as explained earlier, bundles therein won't work anymore with Gecko 34;
- overwrite (without erasing to keep the symlinks to /custpack partition untouched) MOUNT_DIR/b2g with B2G_DIR;
- extract Fira font update: it expands in fira-font-update folder. There's fonts subfolder therein. fira-font-update/fonts is FONT_DIR from now on;
- copy all files from FONT_DIR to MOUNT_DIR/fonts;
- ensure that MOUNT_DIR/b2g and MOUNT_DIR/fonts are owned (recursively) by root:root;
- optionally remove MOUNT_DIR/media/audio and MOUNT_DIR/media/video folders;
- unmount the updated /system partition image in MOUNT_DIR.
Let's flash everything to the phone:
- adb reboot bootloader to put Fire E in fastboot mode;
- sudo fastboot flash custpack custpack.img to update Gaia. I assume here that the OEM FxOS 2.0 backup copy of /custpack partition we've just updated was named custpack.img. Adjust accordingly if that wasn't the case;
- I never had luck flashing /system partition image with fastboot flash. So, still from fastboot mode, boot CWM recovery: sudo fastboot boot recovery.img. Wait until CWM screen is displayed on phone;
- send updated /system partition image to external SD card in phone: adb push system.img /sd-ext. I assume here that the OEM FxOS 2.0 backup copy of /system partition we've just updated was named system.img. Adjust accordingly if that wasn't the case;
- run adb shell and "flash" updated /system partition. This operation requires root access, that's why we've booted from CWM recovery: cat /sd-ext/system.img > /dev/block/platform/msm_sdcc.1/by_name/system;
- once done, chose factory reset/wipe all partitions from CWM recovery;
- still from CWM recovery, chose reboot system now.
Fire E should restart, happily running FxOS 2.1. Don't panic if FxOS boot animation logo hangs. You should ultimately be welcomed by FxOS first-launch customization process :-)

Upgrade to FxOS 2.2r (_not_ 2.2 it doesn't work on Fire E) (Gecko 37):
- get Gecko/Gaia component from Flame KK device [7];
- get mkbootimg tools [8];
- follow steps above to create updated /custpack and /system partition images;
Bluetooth has been put in a separate process between FxOS 2.1 and 2.2, so there's some work here:
- loop mount your /system partition image. This is MOUNT_DIR from now on;
- loop mount Flame's v18D /system partition image (you need to convert it from sparse image to image file format using simg2img first). This is V18D_DIR;
- copy V18D_DIR/bin/bluetoothd to MOUNT_DIR/bin. Ensure it's owned by root:2000;
- copy V18D_DIR/lib/libfdio.so to MOUNT_DIR/lib. Ensure it's owned by root:root;
- unmount both v18D /system partition image in V18D_DIR and updated /system partition image in MOUNT_DIR;
- extract Flame's v18D /boot partition image using mkboot from mkbootimg tools: mkboot boot.img boot. The created boot folder is FLAME_BOOT_DIR from now on;
- extract your OEM FxOS 2.0 backup copy of /boot partition using mkboot from mkbootimg tools: mkboot boot.img boot. I assume here that the OEM FxOS 2.0 backup copy of /system partition was named system.img. Adjust accordingly if that wasn't the case. The created boot folder is FIRE_BOOT_DIR from now on;
- copy FLAME_BOOT_DIR/ramdisk/init.bluetooth.rc to FIRE_BOOT_DIR/ramdisk; ensure it's owned by root:root;
- edit FIRE_BOOT_DIR/ramdisk/init.qcom.rc file, look for service hciattach section and replace root by bluetooth (user root -> user bluetooth; group bluetooth net_bt_admin root -> group bluetooth net_bt_admin bluetooth);
- edit FIRE_BOOT_DIR/ramdisk/init.rc file and add import /init.bluetooth.rc directive, just after import /init.trace.rc one;
- repack boot.img, still using mkboot from mkbootimg tools: mkboot FIRE_BOOT_DIR boot.img;
- adb reboot bootloader to put Fire E in fastboot mode;
- sudo fastboot flash boot boot.img to flash the updated /boot partition we've just created above;
- flash /custpack and /system partitions as described in FxOS 2.1 upgrade.
Fire E should restart, happily running FxOS 2.2. Frames of FxOS boot animation aren't sized correctly, so you'll now noticed a one-pixel white border in the top, bottom and right edges [9]. This is harmless functionally-wise, but may have an impact performance-wise.

Upgrade to FxOS 2.5 (Gecko 44):
- get Gecko/Gaia component from Flame KK device [10];
- steps are identical to upgrade to 2.2r above.

Upgrade to FxOS 2.6 (Gecko 46):
- get Gecko/Gaia component from Flame KK device [11];
- steps are identical to upgrade to 2.2r/2.5 above.

Hope this helps,

Émeric


[1] http://4pda.ru/forum/index.php?showtopic=656329
[2] http://cds.w5v8t3u9.hwcdn.net/v18D.zip
[3] https://github.com/cookiengineer/alcatel-6015x/blob/master/custom/recovery.img
[4] https://github.com/Mozilla-TWQA/B2G-flash-tool/blob/master/shallow_flash.sh
[5] http://ftp.mozilla.org/pub/b2g/nightly/2015/07/2015-07-24-00-12-07-mozilla-b2g34_v2_1-flame-kk/
[6] https://people.mozilla.org/~mwu/fira-font-update.zip
[7] http://ftp.mozilla.org/pub/b2g/nightly/latest-mozilla-b2g37_v2_2r-flame-kk/
[8] https://github.com/xiaolu/mkbootimg_tools.git
[9] https://groups.google.com/forum/#!topic/mozilla.dev.fxos/dzh6KxWTw7I
[10] http://ftp.mozilla.org/pub/b2g/nightly/latest-mozilla-b2g44_v2_5-flame-kk/
[11] http://ftp.mozilla.org/pub/b2g/nightly/latest-mozilla-central-flame-kk/

emeric....@gmail.com

unread,
Apr 15, 2016, 6:05:33 AM4/15/16
to mozilla-...@lists.mozilla.org
Hi,

For people hacking their Fire E device by following the steps in my previous post, I've just noticed that it's simply impossible to import/export and add/remove contacts with FxOS >= 2.5! Last working version is FxOS 2.2r. Don't know why.

Émeric

emeric....@gmail.com

unread,
Jun 12, 2016, 5:34:28 PM6/12/16
to mozilla-...@lists.mozilla.org
Le vendredi 15 avril 2016 12:05:33 UTC+2, emeric....@gmail.com a écrit :
>
> For people hacking their Fire E device by following the steps in my previous post, I've just noticed that it's simply impossible to import/export and add/remove contacts with FxOS >= 2.5! Last working version is FxOS 2.2r. Don't know why.

OK got it: OEM image holds an "empty" b2g/defaults/contacts.json file on custpack partition. Removing it fixed the problem.

Émeric

berni...@gmail.com

unread,
Dec 19, 2016, 4:24:08 PM12/19/16
to mozilla-...@lists.mozilla.org
Hi All, can someone Please tell me what Android-OS is best for the Alcatel one touch fire e. The FOS is no good and drops out connection to the carrier form time to time. Plus the app-store is just confusing. Most communication apps doesn't work or is named something completely different.

Bests regards
0 new messages