5,606,588 Members 36,213 Now Online
XDA Developers Android and Mobile Development Forum

Using a sideloaded Launcher with USB HID and rooted system for profit

Tip us?
 
kornyone
Old
(Last edited by kornyone; 12th July 2012 at 06:50 AM.) Reason: Added info on pushing busybox and Browser.apk
#1  
kornyone's Avatar
Recognized Developer - OP
Thanks Meter 669
Posts: 172
Join Date: Aug 2008
Location: Mountain View, CA

 
DONATE TO ME
Tutorial Using a sideloaded Launcher with USB HID and rooted system for profit

How to make your Nexus Q awesome with built in Android ICS (using CyanogenMod Trebuchet Launcher per this example).

This is by popular demand on Youtube and other places to demonstrate how I love my Q at the moment, which I obtained from someone who attended IO 2012. I was playing with it to see how capable it is with stock OS and kernel at handling 1080 content. It took me longer to write these instructions than root the device. Much of what is noted here is scattered on the forums and internet, but more than one person told me they didn't see an explanation matching what they saw in the video.

WARNING WARNING WARNING:
If you proceed with these instructions, you will be unlocking your device. If you do not know what "fastboot oem unlock" means, you should research it FIRST and understand you are officially bypassing a disclaimer when running "fastboot oem unlock_accept". If you do not have Jelly Bean and got it off eBay (like me), you will need to hack the actual APK from Google some for core functionality. This document expects advanced understanding of Android, and many assumptions are made. I have tested it locally, but since my Q is already unlocked, I cannot go back to the beginning for complete testing. Proceed at your own caution.

Assumptions: You have a secksy Nexus Q. Also, if you have an ICS client device without Jelly Bean, or the Google Apps aren't doing enough for you, this document covers these areas. I run with the assumption you do not have a JB client device (I own a Note, Tablet S, and HTC Doubleshot all running ICS builds).

Pre-req:
*SKIP IF RUNNING JELLY BEAN ON CLIENT DEVICE* -- Somehow get the NexusQ client apk. I personally updated my SDK value to 16 in build.prop, and it showed up. Then adb pull the apk, use apktool to decompile it, edit the manifest to use SDK version 15 rather than 16, and use apktool/jarsigner to install it to an ICS client.
*SKIP IF YOU HAVE ENABLED USB DEBUGGING ON NEXUS Q* -- Use the Nexus Q Client app (installed above if in ICS) as owner, enable USB Debugging in Advanced. This (should) magically enable ADB Network mode too (it did for me). Via nmap, I found it listening on port 4321.
fastboot is installed on PC.
adb is installed on PC (and can see the Q).

Sources:
http://droidcloudshare.blogspot.com/...work.html#more
http://bliny.net/blog/post/How-to-Ro...rarily%29.aspx

For kernel (modules): git clone https://android.googlesource.com/kernel/omap. Branch is android-omap-steelhead-3.0-ics-aah.

Steps:
Connect PC to Q via USB.
Run 'adb reboot bootloader'
Run 'fastboot oem unlock'. Then (Within 5 seconds run this to confirm): 'fastboot oem unlock_accept'.
Download this file -- http://www.bliny.net/downloads/nexusq-boot.img. It is a Nexus Q boot.img with ro.secure=0, allowing us to remount /system and root device.
Setup USB Debugging in Nexus Q via client app all over again (may require clearing data from client device Nexus Q app).
Run 'adb reboot bootloader'
Run 'fastboot boot nexusq-boot.img'. Your Nexus Q will now boot up unlocked, allowing:
Run 'adb remount'
Push 'su' and 'Superuser.apk' from a good source. I use nightly CM9 su/Superuser from my HTC Doubleshot. Put su in /system/xbin/, put Superuser in /system/app. chmod the su binary 06755. (There's many pages documenting how this is done).
*OPTIONAL BUT RECOMMENDED* -- adb push busybox binary from a known good source (I also use recent CM9 binary). Busybox will allow you to do things like remount /system and other necessary shell commands after the temporary ro.secure=0 boot up. This might also be a good time to push bash, or whatever linux utilities you'd like to have.
*OPTIONAL BUT RECOMMENDED* -- adb install the default Browser.apk from your good source, such as CM9. No browser is on the Q by default. Chrome will work, so will Firefox. Adobe Flash works (very well) with the CM9 Browser.apk in stock ICS on the Q.
*OPTIONAL* -- Install gapps, just like you would via clockworkmod. Hell CWM maybe out there for all I know. I did it manually, pushing the libs/apks/etc to the right places on /system. Gmail/Play/Youtube all work.
Sideload/Install a Launcher, I choose Trebuchet, also from nightly CM9 Doubleshot. adb install the apk, it will work.
*OPTIONAL* -- Sideload as many apks as you like for testing. I was lazy, and grabbed my apps from my Doubleshot /data/app directory. I then did a simple scripted command to install them all. 'for i in *.apk ; do adb install $i ; done'.

Profit.

How I profit:
From a PC or phone (I personally use ssh on my HTC Doubleshot), adb into the device again (I use adb connect network), and run:
'am start com.cyanogenmod.trebuchet/.Launcher'
This starts Trebuchet, and you now have a Launcher. Not everything works (wallpapers and home button mapping), but you have it up. If using USB keyboard like I am, ALT+TAB gets you around well.

Use a USB Micro USB dongle with USB wifi keyboard/mouse combination. I have two of them (adapters and keyboards), they all work. It makes navigation neato.

Install CIFS module: Grab android-omap-steelhead-3.0-ics-aah branch from https://android.googlesource.com/kernel/omap, and compile the CIFS and md4 modules. Push these to the Q via adb. Install them in /system optionally. Load them via insmod. I scripted it: 'for i in /system/lib/modules/* ; do insmod $i ; done'.
EDIT -- See Page 3 for instructions verbose on making a cifs module and loading it.

I map the IP in /etc/hosts on my PC, so "nexusq" is the network address, making adb connect simply 'adb connect nexusq:4321').

I know there's more. I love this thing. Highlights include Netflix and Youtube HQ, Vplayer playing 1080 mkvs of 17gb in size across CIFS, games working (Angry Birds, etc), Apollo music working, G+ is neat, etc.


And there's much more hacking to do, I did this with limited time.
The Following 17 Users Say Thank You to kornyone For This Useful Post: [ Click to Expand ]
 
kornyone
Old
#2  
kornyone's Avatar
Recognized Developer - OP
Thanks Meter 669
Posts: 172
Join Date: Aug 2008
Location: Mountain View, CA

 
DONATE TO ME
You tube video (CAUTION IT SUCKS FOR SHAKINESS):

http://youtube.com/watch?v=ejYNDt0EUuA
The Following 2 Users Say Thank You to kornyone For This Useful Post: [ Click to Expand ]
 
mejdam
Old
#3  
Senior Member
Thanks Meter 26
Posts: 134
Join Date: May 2008
Quote:
Originally Posted by kornyone View Post
You tube video (CAUTION IT SUCKS FOR SHAKINESS):

http://youtube.com/watch?v=ejYNDt0EUuA
i have that youtube shakiness issue even with the stock build when using my galaxy nexus to play the files on the q
 
kornyone
Old
#4  
kornyone's Avatar
Recognized Developer - OP
Thanks Meter 669
Posts: 172
Join Date: Aug 2008
Location: Mountain View, CA

 
DONATE TO ME
Quote:
Originally Posted by mejdam View Post
i have that youtube shakiness issue even with the stock build when using my galaxy nexus to play the files on the q
I actually meant my recording was shaky, as in I was moving all over the place and more focused on showing off stuff than keeping the camera pointed at the TV. I also rambled. It was late. I planned to re-record the video on Youtube, but it picked up popularity over night.

As for Youtube on the Q to the TV via HDMI -- as you can see in the video I am playing Radiohead Coachella HD, and it looks/works great. I have watched quite a bit of content on YouTube without issue.
The Following User Says Thank You to kornyone For This Useful Post: [ Click to Expand ]
 
Smokuevo
Old
#5  
Smokuevo's Avatar
Senior Member
Thanks Meter 29
Posts: 622
Join Date: Apr 2008
Location: Schaumburg
I got my Q today. Can't wait to modify it to make it more capable of stuff

Sent from my Galaxy Nexus using xda premium
 
thevaristy
Old
#6  
Member
Thanks Meter 5
Posts: 40
Join Date: Jun 2010
Great work! Could you test the tablet remote app to control the q? Would be incredible if it worked. Thanks!
 
Paul22000
Old
#7  
Paul22000's Avatar
Senior Member
Thanks Meter 136
Posts: 3,469
Join Date: Jan 2008

 
DONATE TO ME
Does the Android Market work?

Are there any apps/limitations that don't work?
 
yokken
Old
(Last edited by yokken; 10th July 2012 at 06:40 AM.)
#8  
yokken's Avatar
Senior Member
Thanks Meter 125
Posts: 610
Join Date: Dec 2010
How is the responsiveness on the device, using the keyboard and mouse and loading up heavy websites? Can the processor keep up?
 
Mars11_
Old
#9  
Mars11_'s Avatar
Senior Member
Thanks Meter 25
Posts: 124
Join Date: Apr 2012
Location: Utah
I saw in your video that when you press home on the keyboard it takes you to the Nexus Q's "home". Would it be possible to go to your apps on the settings screen and remove all the defaults from the Nexus Q's launcher, then when you press home it should ask you about which home do you want to go to and have a check-box for if you want to set one as default? I'm not sure if that would work, but it's an idea.
 
bobukcat
Old
#10  
Member
Thanks Meter 7
Posts: 54
Join Date: May 2010
Would it be possible for you to post the modified apk that works on ICS devices for those that are unfamiliar with the apktool? I promise a quick and generous donation for your time and effort if you can.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes