{"id":251,"date":"2012-12-25T22:02:36","date_gmt":"2012-12-26T03:02:36","guid":{"rendered":"http:\/\/ahdesign.us\/blog\/?p=251"},"modified":"2013-01-12T11:12:24","modified_gmt":"2013-01-12T16:12:24","slug":"rooting-the-zealz-gk802","status":"publish","type":"post","link":"https:\/\/ahdesign.us\/blog\/rooting-the-zealz-gk802\/","title":{"rendered":"Rooting the Zealz GK802"},"content":{"rendered":"<p><a href=\"https:\/\/ahdesign.us\/blog\/rooting-the-zealz-gk802\/news_000_gk802\/\" rel=\"attachment wp-att-252\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-252\" alt=\"news_000_gk802\" src=\"https:\/\/ahdesign.us\/blog\/wp-content\/uploads\/2012\/12\/news_000_gk802.jpg\" width=\"300\" height=\"300\" \/><\/a>Right before Christmas, I ordered a quad core iMX6 based Android stick called the Zealz GK802 from <a title=\"Zeals GK802\" href=\"http:\/\/www.geekbuying.com\/item\/Unii-GK802-Fresscale-i-MX6-Quad-Dure-Cortex-A9-DDR3-1GB-RAM-8GB-ROM-TV-Box-Dongle----Black-312807.html\" target=\"_blank\">Geekbuying<\/a>. Apparently there is a copy out there called the HI802 and they appear to be identical. Geekbuying claims they&#8217;re the first, and it sounded like people were waiting a long time to receive their HI802, so I went with Geekbuying instead. Surprisingly, they ship via DHL for free from Hong Kong or wherever and the unit arrived in about a week. Anyway, it worked fine right out of the box and booted up in 720p (you attach it to a HDMI port on your TV\/monitor). I wanted to get going w\/ some apps that require root figuring a device like this would come rooted, but unfortunately, that&#8217;s not the case. It took a while to root this myself since ADB is disabled, but it is possible to do, and I&#8217;ll document how I did it along w\/ a bunch of downloadable stuff if you&#8217;d rather just get yours rooted.<\/p>\n<p><!--more--><\/p>\n<p>This little stick comes with Android 4.0.4 installed, has a quad core Freescale iMX6 CPU, 1GB RAM and a 8GB micro SD card that it boots from, along with another microSD card slot that allows you to add in another card up to 32GB in size.\u00a0 You can also replace the other card with something larger too if you know what you&#8217;re doing.\u00a0 I didn&#8217;t bother since I don&#8217;t have anything larger than a 8GB card laying around, and I plan on snagging all my media via the network anyway (this does have wifi and Bluetooth built in too).<\/p>\n<p>There are a couple of weird things with the GK802.\u00a0 Mainly, there isn&#8217;t a power button.\u00a0 I&#8217;m not sure if Android likes power being yanked while running, but w\/o root, that&#8217;s all you can do, unless the little hard to press reset button might provide that functionality.\u00a0 Then there is the USB cable.\u00a0 Supposedly it&#8217;s some special cable (same deal w\/ the 5V power adapter) that requires you to use their cable and power adapter to power the GK802 and have the USB host work as well.\u00a0 I haven&#8217;t tried other micro USB cables or power adapters to see if this is true, but I hope not.\u00a0 I don&#8217;t know what that accomplishes on their end.<\/p>\n<p>Next, ADB doesn&#8217;t work, or rather, is disabled.\u00a0 Since you power the GK802 from its micro USB port, the only way to connect it to the PC for ADB stuff is via that same port.\u00a0 My laptop powered the GK802 just fine, but it may be different for others. \u00a0 Anyway, just plugging the stick into the PC via USB results in the stick booting into MTP mode, which allows you to put stuff on the internal card.\u00a0 By going through a hub, Windows was busy enumerating stuff and the GK802 was fooled into booting normally.\u00a0 Still, no luck w\/ ADB, which means rooting becomes a pain in the butt.<\/p>\n<p>Ok last annoying thing.\u00a0 To get into recovery mode, you have to stick a paperclip in a tiny hole next to the micro USB connector (not the one between the USB host and micro connector as shown in the Geekbuying firmware update guide, that&#8217;s the LED hole) to press a little button inside, while trying to plug in the tight fitting micro USB power adapter.\u00a0 I ended up hooking up a power strip and switching power to the thing that way.\u00a0 Anyway, once you&#8217;re into recovery mode, you can &#8220;flash&#8221; updates to the device via the 2nd micro SD card.\u00a0 Select the last option in the list by moving the plugged in USB mouse &#8220;down&#8221; to last option, then left click to select.\u00a0 Oddly, the keyboard is useless in this mode.<\/p>\n<p>This is where rooting begins.\u00a0 Luckily, Geekbuying has released an &#8220;update&#8221; to Android, which includes the system.img, boot.img, recovery.img, and uboot.bin files.\u00a0 After reading about manually rooting, the system.img and boot.img files are of most interest.\u00a0 The system.img is mountable in linux, but the boot.img file is a specially packed file that requires some messing around to unpack what&#8217;s inside.\u00a0 If you want to skip all the stuff I&#8217;m going to talk about below on how to root the device and instead you&#8217;d just rather have the files to download and &#8220;flash&#8221;, you can grab the zip <a title=\"Zeals GK802 Rooted Firmware Update\" href=\"https:\/\/www.dropbox.com\/s\/8wfm31o6h3z9s3r\/GK802_rooted.zip\" target=\"_blank\">here<\/a> and follow the instructions <a title=\"Zealz GK802 Firmware Update Instructions\" href=\"http:\/\/blog.geekbuying.com\/index.php\/2012\/12\/15\/how-to-update-firmware-on-zealz-gk802\/\" target=\"_blank\">here<\/a> to install the &#8220;update&#8221;.\u00a0 I just used a FAT32 formatted, blank microSD card and the recovery mode was happy with that.<\/p>\n<p>The first step in the rooting process is getting the firmware update from Geekbuying.\u00a0 You can download that on their page <a title=\"Zealz GK802 Firmware Update\" href=\"http:\/\/blog.geekbuying.com\/index.php\/2012\/12\/15\/how-to-update-firmware-on-zealz-gk802\/\" target=\"_blank\">here<\/a>.\u00a0 It&#8217;s a password protected, 7Zip file, which is an odd, not too linux friendly format.\u00a0 Anyway, unzip that sucker and get boot.img and system.img to a linux machine.\u00a0 I used an ARM based box (a Dockstar\/GoFlex works great for this) to ensure everything would be ok ARM-wise, but using a x86 machine for this should be fine too.\u00a0 Be careful of endianness if you use a machine whose processor is not a little endian system.<\/p>\n<p>To mount system.img, make a directory somewhere (we&#8217;ll call it gk802_rooted), and run the following command (or run it as root omitting sudo):<\/p>\n<p><code>sudo mount -t auto system.img gk802_rooted<\/code><\/p>\n<p>If you don&#8217;t get any errors, you can &#8216;cd&#8217; into gk802_rooted and have access to the android system.\u00a0 All we need to do in here is put busybox and su into &#8216;bin&#8217; under &#8216;gk802_rooted&#8217; and Superuse.apk into the &#8216;app&#8217; directory under gk802_rooted (actually Superuser.apk may have already been there).\u00a0 You can get this stuff from the &#8216;Root_with_Restore_by_Bin4ry_v<span style=\"color: red;\">18<\/span>&#8216; script 7zip file <a title=\"Root with Restore by Bin4ry v18\" href=\"http:\/\/forum.xda-developers.com\/showthread.php?t=1886460\" target=\"_blank\">here<\/a> if you don&#8217;t know where to get those from on your own.\u00a0 Inside that 7zip file (bleh 7zip, what a pain), you&#8217;ll find su, busybox, and Superuser.apk in the &#8216;stuff&#8217; folder.\u00a0 Get su and busybox into gk802_rooted\/bin and put Superuser.apk into gk802_rooted\/app.\u00a0 Change the permissions on busybox and su with the following (2000 is the guid of the &#8216;shell&#8217; group in case you were wondering):<\/p>\n<p><code>sudo chmod 6755 su<br \/>\nsudo chown root:root su<br \/>\nsudo chmod 755 busybox<br \/>\nsudo chown root:2000 busybox<\/code><\/p>\n<p>do a ls -l and you should see the following for su and busybox:<\/p>\n<p>-rwsr-sr-x 1 root root \u00a0 64412 Dec 18 04:22 su<br \/>\n-rwxr-xr-x 1 root 2000 1634104 Sep 21 01:28 busybox<\/p>\n<p>Change the permissions on Superuser.apk as follows:<\/p>\n<p><code>sudo chmod 644 Superuser.apk<br \/>\nsudo chown root:root Superuser.apk<\/code><\/p>\n<p>Do a ls -l and you should see the following:<\/p>\n<p>-rw-r&#8211;r&#8211; 1 root root\u00a0\u00a0 996704 Dec 25 01:29 Superuser.apk<\/p>\n<p>I also modified build.prop under gk802_rooted, but this most likely gets updated by default.prop on bootup, which is contained in the boot.img file.\u00a0 Anyway, open up build.prop in some text editor like vim and add\/change the stuff after &#8216;#end build properties&#8217; so that it shows the following:<\/p>\n<p><code>ro.secure=0<br \/>\nro.allow.mock.location=1<br \/>\nro.debuggable=1<br \/>\npersist.sys.usb.config=mtp,adb<\/code><\/p>\n<p>Now unmount system.img:<\/p>\n<p><code>sudo umount gk802_rooted\/<\/code><\/p>\n<p>Next, make a new directory, say &#8216;android_4.0.4&#8217;.\u00a0 Download seandroid-4.0.4 from <a title=\"seandroid core download\" href=\"https:\/\/bitbucket.org\/seandroid\/system-core\/downloads\" target=\"_blank\">here<\/a> (click the Branches tab) and extract the contents into the folder you just created (nothing special about this version of Android, it just so happens the little bit of stuff you need is in these system core source downloads).\u00a0 Make sure your system is capable of compiling stuff, and follow the directions <a title=\"Mkbootimg and Mkbootfs Compiling\" href=\"https:\/\/gist.github.com\/1087757\" target=\"_blank\">here<\/a> or see below for the same:<\/p>\n<p>cd to android_4.0.4\/cm_system_core and run the following:<\/p>\n<p><code>cd libmincrypt<br \/>\ngcc -c *.c -I..\/include<br \/>\nar rcs libmincrypt.a *.o<br \/>\ncd ..\/mkbootimg<br \/>\ngcc\u00a0mkbootimg.c -o mkbootimg -I..\/include ..\/libmincrypt\/libmincrypt.a<br \/>\ncd ..\/cpio<br \/>\ngcc mkbootfs.c -o mkbootfs -I..\/include<\/code><\/p>\n<p>Make a new directory somewhere (we&#8217;ll call it bootimg_tools) and copy the compiled mkbootimg and mkbootfs binaries to that folder.\u00a0 Now, download the script zip from Step 2 <a title=\"Unpack and repack Android boot.img\" href=\"http:\/\/www.freeyourandroid.com\/guide\/extract-edit-repack-boot-img-windows\" target=\"_blank\">here<\/a> and extract that stuff into your bootimg_tools folder.\u00a0 Make sure the mkbootfs and mkbootimg binaries are at the same directory level as packboot and extractboot.\u00a0 Delete the .exe files.\u00a0 Also copy the boot.img file from the GK802 firmware update 7zip file from the beginning from this guide to this folder.\u00a0 Follow the directions on the page you downloaded the bootimg script from (you need perl installed).\u00a0 Since we&#8217;re in linux already, don&#8217;t do the cygwin stuff.\u00a0 You can simply run extractboot from the bootimg_folder (change permissions if needed)<\/p>\n<p><code>.\/extractboot boot.img<\/code><\/p>\n<p>If all went well, you&#8217;ll see a screen something like what is shown in the image in Step 4 in the link above.\u00a0 Now go into the bootimg_tools\/out\/ramdisk folder.\u00a0 Edit the &#8216;default.prop&#8217; file with root permissions and change the contents to match the following:<\/p>\n<p><code>#<br \/>\n# ADDITIONAL_DEFAULT_PROPERTIES<br \/>\n#<br \/>\nro.secure=0<br \/>\nro.allow.mock.location=1<br \/>\nro.debuggable=1<br \/>\npersist.sys.usb.config=mtp,adb<\/code><\/p>\n<p>Save, and go back to the bootimg_tools folder.\u00a0 Now run<\/p>\n<p><code>.\/packboot<\/code><\/p>\n<p>You&#8217;ll see very little output, but you shouldn&#8217;t see any errors.\u00a0 packboot automatically figures out where the base address was from boot.img, and sets the base address accordingly for the new boot image.\u00a0 If all went well, the new boot image file was created and is now called boot_new.img (under the bootimg_tools folder).\u00a0 Delete\/rename the boot.img file from the GK802 firmware update and copy\/paste the boot_new.img with the other files for the firmware update.\u00a0 Rename boot_new.img to boot.img.<\/p>\n<p>The last thing we need to do is generate new md5 sums for system.img and boot.img (dunno if Android recovery uses those or not).\u00a0 Do the following to create new md5sums:<\/p>\n<p><code>md5sum system.img &gt; system.md5<br \/>\nmd5sum boot.img &gt; boot.md5<\/code><\/p>\n<p>Inside the md5 files, make the formatting similar to the other original md5 files (all caps, no other text besides the sum).\u00a0 Again, I&#8217;m not sure if this matters, but it&#8217;s what I did and everything seemed to be happy.<\/p>\n<p>Once you&#8217;re done, copy all the firmware update files to a formatted microSD card (I used a FAT32 formatted card), and enter recovery mode on the GK802 as outlined in the beginning of this guide.\u00a0 The &#8220;flashing&#8221; takes a few minutes and then goes back to the android recovery menu.\u00a0 Choose reboot (you can leave in your microSD card).\u00a0 Get access to the Play store.\u00a0 Download busybox, run it, and allow it to update the system.\u00a0 Update the SuperSU app, and allow it to update the su binary.\u00a0 You should now be completely rooted.\u00a0 Download an app requiring root or checkroot to make sure that you are indeed rooted.<\/p>\n<p>This may also enable being able to use ADB, but I have yet to test that. I think you&#8217;ll need to plug the stick into your PC and find a way to prevent the stick from going into MTP mode (see how I accidentally got around that at the top of this guide).<\/p>\n<p>Enjoy your rooted GK802!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Right before Christmas, I ordered a quad core iMX6 based Android stick called the Zealz GK802 from Geekbuying. Apparently there is a copy out there called the HI802 and they appear to be identical. Geekbuying claims they&#8217;re the first, and &hellip; <a href=\"https:\/\/ahdesign.us\/blog\/rooting-the-zealz-gk802\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-251","post","type-post","status-publish","format-standard","hentry","category-zealz-gk802"],"_links":{"self":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts\/251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/comments?post=251"}],"version-history":[{"count":10,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts\/251\/revisions"}],"predecessor-version":[{"id":263,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts\/251\/revisions\/263"}],"wp:attachment":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/media?parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/categories?post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/tags?post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}