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

Search This thread

kornyone

Retired Recognized Developer
Aug 26, 2008
172
670
Mountain View, CA
github.com
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/2012/07/rooting-and-getting-hid-mouse-to-work.html#more
http://bliny.net/blog/post/How-to-Root-Nexus-Q-(Temporarily).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.
 
Last edited:

kornyone

Retired Recognized Developer
Aug 26, 2008
172
670
Mountain View, CA
github.com
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.
 
  • Like
Reactions: AllAboutAndroids

Smokuevo

Senior Member
Apr 26, 2008
791
48
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

Senior Member
Jun 15, 2010
55
5
Great work! Could you test the tablet remote app to control the q? Would be incredible if it worked. Thanks!
 

Paul22000

Senior Member
Jan 19, 2008
3,522
155
Does the Android Market work?

Are there any apps/limitations that don't work?
 

yokken

Senior Member
Dec 29, 2010
635
126
How is the responsiveness on the device, using the keyboard and mouse and loading up heavy websites? Can the processor keep up?
 
Last edited:

Mars11_

Senior Member
Apr 30, 2012
124
25
26
Utah
arthurtucker.me
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

Senior Member
May 25, 2010
55
8
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. :good:
 

kornyone

Retired Recognized Developer
Aug 26, 2008
172
670
Mountain View, CA
github.com
Great work! Could you test the tablet remote app to control the q? Would be incredible if it worked. Thanks!

I plan to play with more input devices, specifically Bluetooth soon. I have not had a chance to hack the Q since Saturday, but soon :) It's near the top of my list.

You say "app" -- is there one in specific you're referring to?

Does the Android Market work?

Are there any apps/limitations that don't work?

Yes, Google Play Market works. I don't have a screenshot of it, but I have one of play.google.com telling me my Q is not compatible with Github's new app (I saw it yesterday at work) -- http://dl.dropbox.com/u/44767242/images/google-play-cut.png.

I would say 75% of the apps of the apps I looked at in my history of downloaded apps were "Not Compatible" via Market. I am sure this is due to build.prop data and other build information. Sideloading "Not Compatible" apks proves most are compatible. Since the Market is so vast, many applications do show up as "Compatible" with the Q, and will install natively.

How is the responsiveness on the device, using the keyboard and mouse and loading up heavy websites? Can the processor keep up?

Keyboard and mouse are quick. No issues there. Loading heavy websites is fine depending on the type of content on it, and browser chosen. I found some pages that brought it to a halt when using desktop browsing mode (like G+) in Browser.apk from my recent CM9 builds (there's not a Brwoser on the Q). However things I thought would bomb out, like heavy Flash video embedded pages or other pages were fine.

Putting it in Tablet DPI range (~213 or so) makes the Chrome browser use native tabs like you're used to on your PC. @1080p, this is sweet. It's a shame it requires a DPI hack to get this.

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.

It's not the defaults option, I did check this. I also installed third party apks to help remap it. I found it's embedded in the startup of the Q's hub activities, and I did not want to rip it out, since I have not found a Factory Restore Image from Google (yet).

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. :good:

I can whip that up. I will make sure it's the latest Nexus Q apk in the Market, which last I looked, had never been updated.

Also JB did drop for AOSP, depending on your device, you could have compatibility soon :)
 

thevaristy

Senior Member
Jun 15, 2010
55
5

kornyone

Retired Recognized Developer
Aug 26, 2008
172
670
Mountain View, CA
github.com
Oh yeah, I got a lot of feedback for this video. and I have more planned (as I am sure plenty others do!).

I created ##nexusq on Freenode, as I could not locate a pre-existing Freenode channel for Nexus Q haxxoring conversation. I am on there. I am not very good at checking XDA.
 

Antebios

Senior Member
Apr 29, 2004
320
34
Houston, TX
I'll give you a killer feature request: Play my own media either via (preferred) an attached network drive or a an directly attached drive.
 

auad

Member
Dec 20, 2010
24
6
I tried the entire Saturday to make the "Tablet Remote" to work on Q but I couldn't, for some reason the Q showed as connect to the Galaxy Nexus when I asked for the connection but the Gnex showed as declined.

There is something related to the pairing key that is not working, the logcat showed that was not giving the correct key as answer and also the key didn't show on the Q screen...

I'll keep digging it, and really hope that someone discover how to do it quickier than me, it's something that is killing me and it's now the matter of honor! :D

I'm not too skilled, but without keyboard and mouse I did a lot of tricks on my Q using the adb, waiting for the host cable to start to play hard on it! I hope to discover something that could help the community! :p
 

badxmaru

Member
Jul 21, 2010
7
3
thanks for getting the ball rolling!

Thanks so much for the groundbreaking work on this, I managed to reproduce all the steps excepting compiling CIFS.

To those that want to play networked stuff - I'm able to stream video via upnp over a network either through vplayer or upnp + mxplayer. Able to play angry birds, etc. Although Google Play movies aren't showing the free transformers one I got from Google I/O. Maybe cause it's locked to my Nexus 7?

Sideloading helps a lot, take advantage of adb over the network. Installing gapps from CM9 nightly works awesome. It would be nice to get trebuchet to autostart, I'm sure there's a way to do this, but I'm not knowledgeable enough to know if there's a way to start it via a run time / on boot level.

For keyboard and mouse, I'm using one of these: USB-Micro-Female-Male-Adaptor that I trimmed down with a knife to fit in the port.
I plug in a keyboard with a built in hub and a mouse goes into that. Works great, sort of like an Atrix docked.

If anyone is stuck I'm more than happy to help.
 

ace2die

Member
Apr 2, 2012
7
0
help

which program are you using on your sideshoot? I am trying to adb from my transformer prime and I guess I am not as much of an expert as I thought. Any help would be awesome.
 

badxmaru

Member
Jul 21, 2010
7
3
which program are you using on your sideshoot? I am trying to adb from my transformer prime and I guess I am not as much of an expert as I thought. Any help would be awesome.


Hey there

I'm sideloading on an ubuntu machine. I can't post links yet, but you basically need to follow
http:// xdaforums.com/showthread.php?t=1550414
That will put adb on your machine. Use a charging cable to connect to the back and use a Nexus 7 to put your Q in developer mode.
Download the fastboot image and follow the directions from there.

Then run the adb scripts from that pc.

You'll also need, as in the instructions, a way to get certain programs off ICS (Su and superuser) and some launcher (trebuchet, nova, etc).

Hope this helps!
 
  • Like
Reactions: Theme.Holo

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    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/2012/07/rooting-and-getting-hid-mouse-to-work.html#more
    http://bliny.net/blog/post/How-to-Root-Nexus-Q-(Temporarily).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.
    4
    Since people are having issues with the CIFS module, I made sure my explanation was sound, and confirmed it. I documented the instructions per my verification below.


    Code:
    git clone https://android.googlesource.com/kernel/omap -b android-omap-steelhead-3.0-ics-aah
    cd omap
    cp arch/arm/configs/steelhead_defconfig .config
    make -j<X> -C . ARCH=arm CROSS_COMPILE=<ANDROID_AOSP_HOME>/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- menuconfig

    Enable CIFS module under File Systems -> Network File Systems -> CIFS. Make sure it's a module [M]. It will call on md4 automatically.
    Save out your config.

    Code:
    make -j<X> -C . ARCH=arm CROSS_COMPILE=<ANDROID_AOSP_HOME>/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- modules

    Code:
    adb push ./crypto/md4.ko /mnt/sdcard ; adb push ./fs/cifs/cifs.ko /mnt/sdcard

    Code:
    adb shell
    insmod /mnt/sdcard/md4.ko  ; insmod /mnt/sdcard/cifs.ko 
    busybox mount -t cifs //<HOST>/SHARE <LOCAL DIRECTORY> -o username=<USERNAME>,password=<PASSWORD>

    For my own usage, I use /data/smb/* for LOCAL DIRECTORY. I create links as need be. I also moved the modules to /system/lib/modules and set proper permissions.
    If you do not supply a username (even if you are authenticating as root), it will fail.

    Check dmesg for errors.

    md4.ko may be optional. On my home configuration, I need it, or I receive this in dmesg:
    Code:
    <3>[ 1410.460876] CIFS VFS: Error -2 during NTLM authentication
    <3>[ 1410.461029] CIFS VFS: Send error in SessSetup = -2

    On a rooted Q, you should be able to navigate to <LOCAL DIRECTORY> fine. Also, df and mount will see the partition. I have streamed 1080p mkv files this way.

    I have been busy, wanting to cook something for this thing, but I have not had a chance :( :(
    2
    You tube video (CAUTION IT SUCKS FOR SHAKINESS):

    http://youtube.com/watch?v=ejYNDt0EUuA
    1
    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.