• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[GUIDE] How to enable Chromecast Mirroring on Lollipop for the N7 2012

Search This thread
So this doesn't work outright on the new Lollipop build for the N7, but it can easily be made to work. Unfortunately the MirrorEnabler app doesn't work on Lollipop yet, and the SQLite Installer app that would make it work hasn't caught up; it installs a non-executable binary that even when set with the correct permissions doesn't run. Credit goes to @r3pwn for finding the initial method for doing this.

UPDATE: MirrorEnabler had been updated for 5.0, and i've seen reports it works now. You can try it Here. Don't forget to thank @r3pwn if it works for you! Otherwise, this method still works, so take your pick. [emoji2]

UPDATE 2: The update of the crhomecast app supposedly supports this natively now on ALL devices, so this may not even be needed anymore. If someone who has not applied this fix can test that out (Has to be chromcast v 1.9.6 or higher) and report back in this thread, that'd be great.

So because I wanted my screen mirroring back, I dove in and made it work. Yes, there are 20 steps, but they are all outlined precisely. If done correctly this shouldn't take more than 5 minutes.

Here's how:

1) Be rooted on Android 5.0 (L)
2) Install chromecast app from play store - Link
3) Open the chromecast app and set up your chromecast device
4) Install busybox (I prefer sterricson version) - Link
5) Open Busybox app and click Install.
6) Install SQLite Editor (not free, but works great on L and worth the money if you like to tinker) - Link
7) get adb shell and issue the commands:
Code:
[email protected]:/ $ su
[email protected]:/ # setenforce 0
[email protected]:/ # getenforce
Permissive
[email protected]:/ #
DO NOT EXIT ADB YET!
8) Open SQLite Editor on your device and navigate to "Google Services Framework"
9) Under google services Framework, select "gservices.db"
10) In gservices.db select "overrides"
11) Click "+ NEW RECORD"
12) In the name field put (exactly as shown):
Code:
gms:cast:mirroring_enabled
13) In the value field put (exactly as shown):
Code:
true
14) Click Save
15) Click "+ NEW RECORD" again
16) In the name field put (exactly as shown):
Code:
gms:cast:remote_display_enabled
17) In the value field put (exactly as shown):
Code:
true
18) Click Save
19) Exit SQLite Editor
20) In your adb shell ( you didn't close it, right? :p):
Code:
[email protected]:/ # am force-stop com.google.android.gsf
[email protected]:/ # am force-stop com.google.android.gms
[email protected]:/ # am force-stop com.google.android.apps.chromecast.app
[email protected]:/ #
If it worked you won't see any output from these three commands; You can now exit adb and disconnect your device.
If you see this:
Code:
Error type 2
android.util.AndroidException: Can't connect to activity manager; is the system running?
at com.android.commands.am.Am.onRun(Am.java:298)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:99)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)
You didn't do step 7 correctly. Repeat step 7 and then try this step again.


That's it! NO reboot required! You should now be able to stream screen mirror to a chromecast device from your N7(2012) using Lollipop! :)

To test it, you should now be able to use your quick settings "Cast Screen" button, or the "Cast Screen" option from within the chromecast app.

Enjoy!
 
Last edited:

donpippo

Senior Member
Jan 6, 2012
141
20
does this hack survive a Google Services Framework update, and is there really need to install chromecast app?

thanks
 
Last edited:
does this hack survive a Google Services Framework update, and is there really need to install chromecast app?

thanks
Theoretically yes. It's just a data change. Add for having to install the chromecast app, you can try without installing it but i do believe it's required.

Sent from my leanKernel 3.11.3 powered stock 4.4.2 (NF9) SM-N900T
 

theone_s_me

Senior Member
Jun 21, 2011
264
97
34
Jeddah
I would like to annonce that this method worked perfectly in the Moto X 2014 (Lollipop)... the only problem is, when i restart the phone it stops working and i need to do the whole process again..... Any way to fix that?

Thank you
 
Last edited:

theone_s_me

Senior Member
Jun 21, 2011
264
97
34
Jeddah
So this doesn't work outright on the new Lollipop build for the N7, but it can easily be made to work. Unfortunately the MirrorEnabler app doesn't work on Lollipop yet, and the SQLite Installer app that would make it work hasn't caught up; it installs a non-executable binary that even when set with the correct permissions doesn't run.

So because I wanted my screen mirroring back, I dove in and made it work. Yes, there are 20 steps, but they are all outlined precisely. If done correctly this shouldn't take more than 5 minutes.

Here's how:

1) Be rooted on Android 5.0 (L)
2) Install chromecast app from play store - Link
3) Open the chromecast app and set up your chromecast device
4) Install busybox (I prefer sterricson version) - Link
5) Open Busybox app and click Install.
6) Install SQLite Editor (not free, but works great on L and worth the money if you like to tinker) - Link
7) get adb shell and issue the commands:
Code:
[email protected]:/ $ su
[email protected]:/ # setenforce 0
[email protected]:/ # getenforce
Permissive
[email protected]:/ #
DO NOT EXIT ADB YET!
8) Open SQLite Editor on your device and navigate to "Google Services Framework"
9) Under google services Framework, select "gservices.db"
10) In gservices.db select "overrides"
11) Click "+ NEW RECORD"
12) In the name field put (exactly as shown):
Code:
gms:cast:mirroring_enabled
13) In the value field put (exactly as shown):
Code:
true
14) Click Save
15) Click "+ NEW RECORD" again
16) In the name field put (exactly as shown):
Code:
gms:cast:remote_display_enabled
17) In the value field put (exactly as shown):
Code:
true
18) Click Save
19) Exit SQLite Editor
20) In your adb shell ( you didn't close it, right? :p):
Code:
[email protected]:/ # am force-stop com.google.android.gsf
[email protected]:/ # am force-stop com.google.android.gms
[email protected]:/ # am force-stop com.google.android.apps.chromecast.app
[email protected]:/ #
If it worked you won't see any output from these three commands; You can now exit adb and disconnect your device.
If you see this:
Code:
Error type 2
android.util.AndroidException: Can't connect to activity manager; is the system running?
	at com.android.commands.am.Am.onRun(Am.java:298)
	at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
	at com.android.commands.am.Am.main(Am.java:99)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)
You didn't do step 7 correctly. Repeat step 7 and then try this step again.


That's it! NO reboot required! You should now be able to stream screen mirror to a chromecast device from your N7(2012) using Lollipop! :)

To test it, you should now be able to use your quick settings "Cast Screen" button, or the "Cast Screen" option from within the chromecast app.

Enjoy!
I would like to annonce that this method worked perfectly in the Moto X 2014 (Lollipop)... the only problem is, when i restart the phone it stops working and i need to do the whole process again..... Any way to fix that?

Thank you
 

boriznl

New member
Mar 17, 2007
2
0
On step 9) Under google services Framework, select "gservices.db" i get the error

An error occurred while opening the database. attempt to write a readonly database (code 776) while compiling: select * from sqlite_master where type in('table','view') order by name
How can i solve this?
 
I would like to annonce that this method worked perfectly in the Moto X 2014 (Lollipop)... the only problem is, when i restart the phone it stops working and i need to do the whole process again..... Any way to fix that?

Thank you
Unknown. Don't own that device. Only tested on the n7 2012.
On step 9) Under google services Framework, select "gservices.db" i get the error

An error occurred while opening the database. attempt to write a readonly database (code 776) while compiling: select * from sqlite_master where type in('table','view') order by name
How can i solve this?
No idea. You are rooted, right? Might see if remounting /system in read/write mode would help. Also make sure you granted root privileges to sqlite editor if it asked.

Sent from my SM-T320 using Tapatalk
 

r3pwn

Inactive Recognized Developer
Jul 11, 2012
1,745
2,046
Lakeland, FL
r3pwn.com
I didn't steal any source code, since it's a guide and not an application. I will, however, credit you for finding the method initially, although your app did not work in Lollipop at the time.
I know you didn't "steal the code", but parts of this guide are letter-for-letter in the code of my app. And don't worry, Lollipop-compatible version coming soon.

EDIT: Thanks for adding that to the OP, but I found the ActivityManager commands to kill the required processes, too. :p
 
Last edited:
I know you didn't "steal the code", but parts of this guide are letter-for-letter in the code of my app. And don't worry, Lollipop-compatible version coming soon.

EDIT: Thanks for adding that to the OP, but I found the ActivityManager commands to kill the required processes, too. :p

D'oh. My bad. Updated OP to be a bit more generic.

Also, when you get the Lollipop compatible version ready, let me know and I'll gladly update the OP to point people that way for those who don't want to manually do this ;)
 
  • Like
Reactions: r3pwn

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    So this doesn't work outright on the new Lollipop build for the N7, but it can easily be made to work. Unfortunately the MirrorEnabler app doesn't work on Lollipop yet, and the SQLite Installer app that would make it work hasn't caught up; it installs a non-executable binary that even when set with the correct permissions doesn't run. Credit goes to @r3pwn for finding the initial method for doing this.

    UPDATE: MirrorEnabler had been updated for 5.0, and i've seen reports it works now. You can try it Here. Don't forget to thank @r3pwn if it works for you! Otherwise, this method still works, so take your pick. [emoji2]

    UPDATE 2: The update of the crhomecast app supposedly supports this natively now on ALL devices, so this may not even be needed anymore. If someone who has not applied this fix can test that out (Has to be chromcast v 1.9.6 or higher) and report back in this thread, that'd be great.

    So because I wanted my screen mirroring back, I dove in and made it work. Yes, there are 20 steps, but they are all outlined precisely. If done correctly this shouldn't take more than 5 minutes.

    Here's how:

    1) Be rooted on Android 5.0 (L)
    2) Install chromecast app from play store - Link
    3) Open the chromecast app and set up your chromecast device
    4) Install busybox (I prefer sterricson version) - Link
    5) Open Busybox app and click Install.
    6) Install SQLite Editor (not free, but works great on L and worth the money if you like to tinker) - Link
    7) get adb shell and issue the commands:
    Code:
    [email protected]:/ $ su
    [email protected]:/ # setenforce 0
    [email protected]:/ # getenforce
    Permissive
    [email protected]:/ #
    DO NOT EXIT ADB YET!
    8) Open SQLite Editor on your device and navigate to "Google Services Framework"
    9) Under google services Framework, select "gservices.db"
    10) In gservices.db select "overrides"
    11) Click "+ NEW RECORD"
    12) In the name field put (exactly as shown):
    Code:
    gms:cast:mirroring_enabled
    13) In the value field put (exactly as shown):
    Code:
    true
    14) Click Save
    15) Click "+ NEW RECORD" again
    16) In the name field put (exactly as shown):
    Code:
    gms:cast:remote_display_enabled
    17) In the value field put (exactly as shown):
    Code:
    true
    18) Click Save
    19) Exit SQLite Editor
    20) In your adb shell ( you didn't close it, right? :p):
    Code:
    [email protected]:/ # am force-stop com.google.android.gsf
    [email protected]:/ # am force-stop com.google.android.gms
    [email protected]:/ # am force-stop com.google.android.apps.chromecast.app
    [email protected]:/ #
    If it worked you won't see any output from these three commands; You can now exit adb and disconnect your device.
    If you see this:
    Code:
    Error type 2
    android.util.AndroidException: Can't connect to activity manager; is the system running?
    at com.android.commands.am.Am.onRun(Am.java:298)
    at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
    at com.android.commands.am.Am.main(Am.java:99)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)
    You didn't do step 7 correctly. Repeat step 7 and then try this step again.


    That's it! NO reboot required! You should now be able to stream screen mirror to a chromecast device from your N7(2012) using Lollipop! :)

    To test it, you should now be able to use your quick settings "Cast Screen" button, or the "Cast Screen" option from within the chromecast app.

    Enjoy!
    2
    I know this isn't the place to be advertising my own stuff, but anyone who wants to test v7 of #MirrorEnabler (compatible with Lollipop), send me a PM and I'll send you a link.
    1
    Nice guide ! :)

    Gesendet von meinem GT-I9195 mit Tapatalk
    1
    Nice guide.

    Can confirm after following this guide casting from settings pull down is indeed working on lollipop N7 2012!!

    Cheers! :D
    1
    Its works great! thank you!
    I think Mirror Enabler only set the first one row, and it is the reason it stopped working on this tablet