samedi 20 avril 2013

Mele mobile phone remote control

Mobile phone remote control software
With this piece of software you can control your Mele device from your mobile phone (over wifi).
Install this apk on your mobile phone, and you will have thie following controls (slide at the bottom of the screen):




MeLE_A10_SDK1.6_V2.0.1 img+sdcard version


This firmware is particular with its frontend looking like Windows 8.

Original thread: Mele brand new Win8 GUI v2.0.1 update
This is an update from 1.3.1 firmware but I generated a new firmware image (less issues with previous state).

From what I saw:
- mp4 seek fixed
- network issues after suspend seem to have been fixed

Here are the modified versions:

Reminder:
PhoenixCard image is flashed using this: PhoenixCardV306
dd-able img is flashed using:
  - under linux: bzip2 -cd Mele_4.0_V1.3BETA_revised_en_us_4.ddimg.bz2|dd of=/dev/sdx bs=4096
  - under Windows: uncompress the archive before, and then use WinImage
The SDCard version is something like a "live-sdcard". You can run it without affecting the flashed image.
sdcard version, under linux only, run: cd sdcard/; make DEV=/dev/sdx (where sdx is the sdcard device number).

This time I chose to not include APEX launcher.
You can download it freely from here: Apex Launcher

<not tested>: To get google apps, from the installed Mele firmware, use the Internet navigator and download this:
http://goo.im/gapps/gapps-ics-20120429-signed.zip
This will put the file in /mnt/sdcard/Download/, where the init script looks at.

Reboot, wait for the device to reboot and you are done.
The details of what is modified in this firmware from the original version:
- boot defaults to en_US
- deactivated /system/lib/hw/sensors.exDroid.so (fixes 100% system_server bug)
- added /etc/init.d capability
- added capability to install gapps if zip present in /mnt/sdcard, by a /etc/init.d script
- removed the Chinese applications (you can still find them in the original update.zip in system/preinstall and system/vendor/app, I kept Flash Player).
- added xpad.ko module (found here: MELE A1000 Hacking - XBOX 360 controller support in 3.0.8 kernel)

jeudi 7 février 2013

Mele_HTPC_20121220_V1.3.1 en_US img+sdcard version

Another firmware.
the changelog is here: http://www.mele.cn/download/show/21.htm

Here are the modified versions:
Phoenixcard image: Mele_HTPC_20130116_V1.3.1_en_US_Apex.img
dd-able img: Mele_HTPC_20130116_V1.3.1_en_US_Apex.ddimg.bz2
sdcard version: <TBD>

To get google apps, from the installed Mele firmware, use the Internet navigator and download this:
http://goo.im/gapps/gapps-ics-20120429-signed.zip
This will put the file in /mnt/sdcard/Download/, where the init script looks at.

Reboot, wait for the device to reboot and you are done.

Original firmware: http://www.mele.cn/download/show/21.htm

I applied the same things as in my previous post:
Mele_HTPC_20121220_V1.3 en_US img+sdcard version

dimanche 3 février 2013

Keeping Google Play device entry over firmware flashes: Android ID

Edit: *DOES NOT WORK* Useless. The device is still duplicate... perhaps /data/misc/radio/imei.conf needs to be copied too?

To keep the same device entry in Google Play after a firmware flash, you must keep the "Android ID" intact.

This key is a unique identifier used by Google Play to address your device.
After each firmware flash, this unique identifier is re-generated by default, and this leads to a new device entry in Google Play (I have around 20 duplicate entries in my Play account->Parameters).

This Android ID is stored in the system database, and it is easy to change it.
First, you have to retrieve the Android ID you want to keep over the firmware flashes:
adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
SELECT * FROM secure WHERE name = 'android_id';
.quit

The "SELECT" command will display the Android id, like this:
34|android_id|123456789abcdef0

After a firmware flash, you just have to update this Android ID. Do that at early stage (before installing Google Applications for example), so that all applications will take into account the updated ID:
adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
UPDATE secure SET value = '<your preferred ID>' WHERE name = 'android_id';
.quit

With <your preferred ID> the one you got initially with the SELECT command (i.e. 123456789abcdef0 in my example).
Just reboot to be sure that any running application gets the new ID.

Source: http://forum.xda-developers.com/showthread.php?p=37218521

samedi 5 janvier 2013

Mele_HTPC_20121220_V1.3 en_US img+sdcard version

2 versions:
- 1 flasheable using PhoenixTools here: Mele_HTPC_20121220_V1.3_en_US_Apex.img
         or dd-able image: Mele_HTPC_20121220_V1.3_en_US_Apex.ddimg.bz2
- 1 SDCard version: sdcard_Mele_HTPC_20121220_V1.3.tar.bz2.
Choose your flavor...

Next, you can install gapps.
You just have to put in /mnt/sdcard the gapps .zip file found here: gapps-ics-20120429-signed.zip, and reboot (download from a PC, put it on a external sdcard, copy with the file manager).

The script in /etc/init.d (here: 10update_gapps) will scan at boot and install gapps if present.

In the case of SDCard version, you have to put the gapps zip file in the last partition (named UDISK, /dev/sdx10)

In details, what is modified in this firmware from the original version (Mele_HTPC_家庭版_20121220_正式版_v1.3):
- boot defaults to en_US
- deactivated /system/lib/hw/sensors.exDroid.so (fixes 100% system_server bug)
- added /etc/init.d capability
- added capability to install gapps if zip present in /mnt/sdcard, by a /etc/init.d script
- added APEX Launcher as default launcher (found here: Apex Launcher)
- added Andrew patch 2.0.apk as preinstalled app (found here: http://bbs.mele.cn/showtopic-855.aspx)
- added ES Explorer as preinstalled app (found here: Download)
- added xpad.ko module (found here: MELE A1000 Hacking - XBOX 360 controller support in 3.0.8 kernel)

Specifically in the SDCard version:
- tuned /etc/vold.fstab so that sdcard is correctly mounted.
- in first partition, you will find uEnv_recovery.txt that boots on the SDCard, recovery mode. Just replace in the first partition uEnv.txt by uEnv_recovery.txt and you will boot into recovery. Replace by uEnv_normal.txt and you will boot in normal mode.
- added recovery partition (/dev/sdX7)

samedi 22 décembre 2012

Mele_HTPC_20121220_V1.3 SDCard version

I managed to automate the creation of a SDCard bootable version from a stock Android image, under linux.
Of course you will lose your data on SDCard, and you may lose data from your computer if you don't care enough about this infamous X letter!

As an example, here is the latest firmware from Mele (20 December 2012) on which I just modified the partition names (SDCard instead of NAND), changed the default language, and added the /etc/init.d stuff :
- get this: sdcard_Mele_HTPC_20121220_V1.3.tar.bz2
- get a 8GB SDCard (not less, the partitions are created depending on this minimal size)
- uncompress the above archive,
- as root, check the SD-Card device number (/dev/sdX), and perform: make DEV=/dev/sdX
- Optionally, mount /dev/sdX1 to edit uEnv.txt that contains the MAC address. Set it to your usual MAC address if needed.
- Once done, put this SDCard into your device, power-on and enjoy.

The original firmware is here: Mele_HTPC_家庭版_20121220_正式版_v1.3

Notes:
- A slow SDCard gives slow boot process. A Class 10 SDCard gives good results.
- This SDCard image won't modify the flashed firmware, you can revert to your NAND image simply by removing the SDCard, and rebooting.

The details on what it does
The process is quite simple:
1/ create partitions on SDCard
2/ format partitions
3/ fill the partitions with the interesting things (extracted from the Mele firmware).
Mandatory modifications from the original firmware are the nandX->mmcpblk0pX stuff in order to work properly, and to avoid this SDCard firmware to corrupt the flashed firmware .
You can easily modify the created partitions' content for customization.

dimanche 25 novembre 2012

Booting the Android ICS system from SDCard

Update: from the information below, I recently added the "recovery" partition, so it shifts partition numbers.
The mele flash kitchen_v2 contains scripts to generate the sdcard version, look here:
Mele A2000: my own Linux flash kitchen

Testing new firmwares could be a pain since everything is wiped out at each update.
My idea (an I see some people had the same idea before) is to write the Android partitions on sdcard and boot from it.

There are already Linux distributions that boot from SDCard, like ArchLinux:
http://archlinuxarm.org/platforms/armv7/mele-a100
I have taken this Linux distribution as the base system.

The principle is quite easy: take a SDCard u-boot, give it the Android kernel, create the Android partitions on SDCard, fill them to make Android happy, change all "nandx" references by "mmcblk0px" in init scripts.

The Android system boots and does not need any access to NAND, a good point since I can test firmwares without affecting my flashed one.

Partitioning

Under linux, I have partitioned the SDCard (SDHC class 10, for boot speed) with fdisk.
Here is the resulting partitions:

Note that a free space of 16MB is kept at start of sdcard, it embeds the spl bootloader
I put 4GB for "data" and 10GB for /sdcard (16GB SDCard gives lot of space).
Exact size doesn't matter; if you set to 15,95MB one partition, that's not a big issue. The important thing is the number of partitions, see below.

So the matching nand-sdcard partitions are:

-nand- -sdcard-   -name-      -format-
nanda  mmcblk0p1  bootloader  vfat
nandb  -N/A-      env
nandc  mmcblk0p2  boot        ext4
nandd  mmcblk0p3  system      ext4
nande  mmcblk0p5  data        ext4
nandf  mmcblk0p6  misc        ext4
nandg  -N/A-      recovery
nandh  mmcblk0p7  cache       ext4
nandi  mmcblk0p8  private     vfat 
nandj  -N/A-      sysrecovery
nandk  mmcblk0p9  UDISK       vfat

Note: I just found out that link: http://linux-sunxi.org/Android/partitions
Almost same thing...
Note(2): under linux, mmcblk0p1 is /dev/sdb1, mmcblk0p2 is /dev/sdb2, ...

Filling partitions

Then I formatted partitions using mkfs.vfat for FAT partitions, and mkfs.ext4 for ext4 partitions that need to be formatted (look at the above table for the ones that need to be formatted, the others will be formatted by Android).
Then, from ArchlinuxARM/Mele-Bootloader I did:
# write SPL
dd if=sun4i-spl.bin of=$DRIVE bs=1024 seek=8
# write mele u-boot
dd if=mele-u-boot.bin of=$DRIVE bs=1024 seek=32
where DRIVE is /dev/sdb is sdcard is on sdb.

In the bootloader partition, I put the Mele's script.bin, and the Mele's kernel (the 3.0.8+ one), transformed into a u-boot image using this:
mkimage -A ARM -C none -T kernel -O linux  -a 40008000 -e 40008000 -d zImage uImage
I added uEnv.txt:
boot_mmc=fatload mmc 0 0x43000000 ${fexfile}; fatload mmc 0 0x48000000 ${kernel}; bootm 0x48000000
extraargs=rootwait init=/init mac_addr=00:BA:D0:MA:C0:FF
fexfile=script.bin

The "boot" partition contains the initrd contents of root.fex, and must be in mmcblk0p2 (default root partition of the spl u-boot, you can change it with root=xxx in extraargs variable)

The "system" partitions contents the files of the /system partition (system.fex mounted partition)
That's all.

Changing init scripts

In "boot" partition, you need to edit init.sun4i.rc and uevent.sun4i.rc, to change all "nandX" references into "mmcblk0pN" references conforming to the above table.
grep -r nand * shows you all the files that need to be modified.

In the same manner, change /system:
bin/sop.sh
bin/preinstall.sh
bin/data_resume.sh
etc/vold.fstab

The proof

Here is the mount table from my functional system:
root@android:/ # busybox mount                                                                                                      
rootfs on / type rootfs (rw)                                                                                                        
/dev/root on / type ext4 (ro,relatime,user_xattr,barrier=1,data=ordered)                                                            
devtmpfs on /dev type devtmpfs (rw,relatime,size=156796k,nr_inodes=39199,mode=755)                                                  
tmpfs on /dev type tmpfs (rw,nosuid,relatime,mode=755)                                                                              
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)                                                                  
proc on /proc type proc (rw,relatime)                                                                                               
sysfs on /sys type sysfs (rw,relatime)                                                                                              
tmpfs on /mnt type tmpfs (rw,relatime,mode=777,gid=1000)                                                                            
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)                                                                       
tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000)                                                                        
/dev/block/mmcblk0p3 on /system type ext4 (ro,relatime,user_xattr,barrier=0,data=ordered)                                           
/dev/block/mmcblk0p5 on /data type ext4 (rw,nosuid,nodev,noatime,user_xattr,barrier=0,journal_checksum,data=ordered,noauto_da_alloc)
/dev/block/mmcblk0p7 on /cache type ext4 (rw,nosuid,nodev,noatime,user_xattr,barrier=0,journal_checksum,data=ordered,noauto_da_alloc
)                                                                                                                                   
/dev/block/mmcblk0p8 on /mnt/private type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=ascii,sh
ortname=mixed,errors=remount-ro)                                                                                                    
/dev/block/vold/179:1 on /mnt/extsd/179_1 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1023,fmask=0702,dmask=0702
,allow_utime=0020,codepage=cp437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)                                            
/dev/block/vold/179:6 on /mnt/extsd/179_6 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1023,fmask=0702,dmask=0702
,allow_utime=0020,codepage=cp437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)                                            
/dev/block/vold/179:8 on /mnt/extsd/179_8 type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage
=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro)                                                                           
/dev/block/vold/179:9 on /mnt/extsd/179_9 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1023,fmask=0702,dmask=0702
,allow_utime=0020,codepage=cp437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)                                            

And the storage screenshot: