Access Chrome DevTools / Remote Debugging - Google Chromecast

Hi,
I'm interested in hacking some of the existing apps to see how they tick, since most of them are just HTML + CSS. I've been sleuthing around trying to find how to enable the remote debugging port of Chrome which is usually available (and even officially for apps that you actually register yourself). I've found
Code:
/data/chrome/.eureka.conf
contains a enable_remote_debugging flag which is currently set to false, is it as simple as modifying the file to say true? Does anyone know if this file is checksummed or have any other checking preventing me from modifying it? I normally would go right ahead but I don't want to brick the device, so I'm posting here for some reassurance/guidance.
Cheers,

Did it.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Posting it here in case someone is trying to achieve the same/similar things with their own Chromecast.
HOW TO: Add (any?) Chrome command-line argument to the Chromecast shell / Get the remote DevTools working.
Note: You will need root access to your Chromecast to perform these steps. This guide assumes you have busybox installed and on your PATH
SSH into your Chromecast, this is usually just ssh [email protected], although you may need to specify an IP address in place of Chromecast if your router does not automatically create a DNS entry for it.
Optional: once in your SSH session type busybox sh to get a terminal that supports history and tab completion.
Copy the process.json file somewhere you can modify it and make it readable for the 'chrome' user:
Code:
busybox cp /system/chrome/process.json /data/chrome/process.json
chown chrome:chrome /data/chrome/process.json
Modify the process.json file to add "enable-remote-debugging" and "remote-debugging-port" (or whatever other flags you want to use) to the cast_shell external_flags JSON array and save the file. The only editor I found on the device was busybox's vi, so you'll need to know the basics to modify that file, or use adb and modify it elsewhere.
Extract the environment variables from the running cast shell process
Code:
ps | grep cast_shell # take note of the PID
busybox xargs -0 busybox echo < /proc/1234/environ # where 1234 is the PID from the previous step
Copy that line for later, the output should something look like: (you can most likely copy this, but it may change depending on your firmware version)
Code:
LD_LIBRARY_PATH=/system/lib PLAYREADY_STORE_DIR=/data/netflix/AACS/ CAST_CLIENT_CERT=/factory/client.crt CAST_CLIENT_PRIVKEY=/factory/client.key.bin CAST_CLIENT_CERT_CHAIN=/system/etc/cert_chain.pem HOME=/data/chrome/
Switch to the 'chrome' user (the groups may be different for your firmware, check by reading /init.rc and looking under groups for cast_receiver service)
Code:
sudo -u chrome -g chrome:graphics:wifi:net_mgr:watchdog:log:panel:metrics /bin/busybox sh
Now paste that line on ENV vars and on the same line type:
Code:
/system/chrome/cast_cli stop cast
Your TV may turn off at this step. You can safely turn it back on.
Paste the line of ENV vars again and then again on the same line type:
Code:
/system/chrome/cast_cli --process-json-path=/data/chrome/process.json --enable-remote-debugging --remote-debugging-port=9222 start cast
If you are running adb logcat in another window, you should start to see cast_shell starting up. If it crashes, be sure to read the log to find out what's going wrong. It normally takes 10-30 seconds to show the backdrop again on the screen.
Now that the cast shell is running in debug mode, you should be able to navigate to http://chromecast:9222 and inspect your browser window remotely (or replace chromecast with your IP address).
Enjoy!

Related

Adb root showing, but not on phone?? - fyodor rom - help please

Hi,
i have rooted my phone and applied newest recovery following every instruction on this site to the letter.
also installed and using fyodor's excellent rom since it's first release.
when i use adb i always obtain root # and have done so since flashing and entering commands
but when i try to access root on my phone (root explorer for example) i am now unable to mount rw/ro?? and cannot browse files. i also use cachemate which appears to gain root access and do its job
any help much appreciated as to how to solve this issue and allow my phone to recognise root
thank you for any help
Hi huetson2:
Try to execute the command below(on PC):
Code:
adb shell ls -l /system/sbin/su
If you get this output, I think rootExplorer and others(e.g.: Autostarts, setCPU) will work properly.
Code:
-rwsr-sr-x root root 76232 2008-08-01 20:00 su
cn.fyodor said:
Hi huetson2:
Try to execute the command below(on PC):
Code:
adb shell ls -l /system/sbin/su
If you get this output, I think rootExplorer and others(e.g.: Autostarts, setCPU) will work properly.
Code:
-rwsr-sr-x root root 76232 2008-08-01 20:00 su
Click to expand...
Click to collapse
-rwsr-sr-x root root 76232 2008-08-01 13:00 su
but still no root on phone!, got an error message on handset telling me su cannot be found?
setcpu not working either,
I have a similar problem. I'll post a screenshot.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
EDIT: adding some info... If I type "su" from terminal emulator, it says something like "access granted, courtesy of magicandroidapps.com.
Root explorer works ok...
Chackemate and SetCPU work...

Boot Animation

After a little looking around, I found a great boot animation by another guy from the xda forums, and I modded it a bit for the G Tablet.
Here's a preview:
(All credit goes to ASimmons for making this AWESOME animation.)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
To install it,
adb push bootanimation.zip /logodata
Click to expand...
Click to collapse
Use 7zip to extract the zip file.
I love this! Can I install it without adb? I haven't gotten it working properly on my XP x64 machine.
Mine boots up so quickly, I never get to see the entire automation. Thanks!
I used RootExplorer to copy this over, since I don't have the SDK stuff loaded.
Thanks for the animation but it does not seem to work with VEGAn Beta 4 ROM image I recently loaded. I see it is the same size but cant get it to show - it just shows the normal VEGAn Android animation. Is there something I am doing wrong. Here is output of my what is in my logodata directory:
# ls -l
-rw-rw-rw- root root 16610683 2010-12-29 09:33 bootanimation.zip
-rwxr--r-- adb compass 2359350 2010-09-28 02:43 boot2.bmp
drw-rw-rw- root root 2010-12-30 12:38 lost+found
-rwxr--r-- adb compass 620888 2009-07-14 04:52 Tulips.jpg
Is it a permissions thing - I even set it to executable with chmod and still no different animation.
Anagin thanks for the animation - is there something I am doing wrong?
powerx86 said:
Thanks for the animation but it does not seem to work with VEGAn Beta 4 ROM image I recently loaded. I see it is the same size but cant get it to show - it just shows the normal VEGAn Android animation. Is there something I am doing wrong. Here is output of my what is in my logodata directory:
# ls -l
-rw-rw-rw- root root 16610683 2010-12-29 09:33 bootanimation.zip
-rwxr--r-- adb compass 2359350 2010-09-28 02:43 boot2.bmp
drw-rw-rw- root root 2010-12-30 12:38 lost+found
-rwxr--r-- adb compass 620888 2009-07-14 04:52 Tulips.jpg
Is it a permissions thing - I even set it to executable with chmod and still no different animation.
Anagin thanks for the animation - is there something I am doing wrong?
Click to expand...
Click to collapse
I have heard of some people saying that they find the bootanimation under a media directory instead of the logodata, is it possible that for the Vegan ROM that this zip must be put somewhere else?
Take a look at this post, perhaps it will help?
http://forum.xda-developers.com/showthread.php?t=878143&highlight=bootanimation
It didn't work the first time I install because androzip extracted damage zip file. I had to unzip it from my computer then transfer it over to the tablet. Use root explorer to copy it over to system/media.
If you get time can you post a step By step for us total newbs. I assume I just unzip and transfer via a USB cable but that's about it. (wouldnt insoluble exactly where to abstract it and if any other steps are involved)
I logged back on to the shell and did not see any other bootanimation other an executable bootanimation in the following folder:
/system/bin/
So I looked in the /system/media folder and no bootanimation.zip just the following:
# pwd
/system/media
# ls -l
drwxr-xr-x root root 2010-12-29 21:26 audio
I copied the bootanimation.zip file to that directory after reading multiple posts about the file being located in /system/media.
Here is the link that directs you to do the same.
http://forum.xda-developers.com/show...=bootanimation
I finally got this to work and at least for the VEGAn 4, the bootanimation.zip must reside in the /system/media folder.
Basic instructions are as follows and done in Linux:
Requirement: a way to copy data to /system folder (like adb tool). Here are the steps I used.
a) Enter the Android Shell using: ./adb shell
b) At the # prompt enter: mount
c) You should see the following as a READ-Only
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0
d) Now you need to make this Read/Write to do this use the following commands:
mount -o rw,remount -t ext2 /dev/block/mtdblock3 /system
e) validate the mount is now read/write by re-executing the mount command - enter the following:
mount
f) You should see the following if everything worked to make this folder read/write:
/dev/block/mtdblock3 /system yaffs2 rw,relatime 0 0
g) Now lets exit the shell type the following:
exit
h) Now push the bootanimation.zip to the android device using the following command:
./adb push bootanimation.zip /system/media
i) Now lets reboot the Android device - execute the following:
./adb reboot
This worked and I have tried a few others. Thanks to all the tips to help me figure this out!
>>>>>>>>>>>>>>>>>>>>>>>>: (
>>>>>>>>>>>>>>>>:V
i wanted to use a gif that is around 40 mb 35 seconds long is that something that is possible to do or will i have to shorten it
is it possible to even use a gif
Is there anyway to have sound go along with the bootanimation?
Some phone bootani's have sound -- but I've never been able to get it to work properly after changing the stock...
Thank you for this boot animation. I have been presented with so many choices for customization, that it is hard to choose. I love this little tablet.

[Tutorial] Turn on WiFi via adb! Locked out of phone with wifi off?

Hello all, i just want to make this little "tutorial" since this happend to my brother
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
As you see the phone is locked out with no wifi.
And to get into the phone with your google account you need a data connection (ofc).
1: You need to have USB debugging on or else this guide is nothing for you.
2: Get adb and install your phones drivers.
3: Open up cmd and navigate to the adb folder.
Code:
cd c:\user\folder(s)\
4: Make sure adb recognises your phone by typing
Code:
adb devices
5: Type this one by one
Code:
adb shell
su
svc wifi enable
6: Wait for wifi to connect and log in to your google account as you would do normally.
And don't forget to hit that thanks button if it worked, Thank you.​
Tried it but I get a "Killed" response after the svc wifi enable command. I'm using a stock ROM from Cherry Mobile, which is a Karbonn A21. Thanks for your help.
Permission denied error
tried but when i ente "su" command it gives me an error . Permission Denied what shoul i do ?
When I type "su" it says "/system/bin/sh: su: not found"
albourcin said:
When I type "su" it says "/system/bin/sh: su: not found"
Click to expand...
Click to collapse
What are you trying to do mate??
Same issue as the OP??
SU is for super user
the
cd c:\user\folder(s)\
is an example, are you pointing to your ADB folder?
So i have mine on the root of C:
So mines:
C:\ADB
Then once in, i would type the commands.
You would need USB Debugging to be on for this to work and SU? I would have imagined that you would have to be rooted? Superuser?
Never used this command without root so not sure.
Try this instead of the command above.
Again via ADB, via CMD or powershell whilst the path is your adb folder, eg: C:\ADB
adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
update secure set value=1 where name='wifi_on';
OR, if you have TWRP installed, then try this.
Remove /Bypass Lockscreen With Recovery
Recently when i restored my data using TWRP i faced a problem at lock screen. I was not able to unlock my phone with the pin i set Earlier..So after so many attempts i was able to find a solution for that problem.(works with pattern,pin etc)...
forum.xda-developers.com
Hey
YAORA NA
i discover this, this very day ...
5: Type this one by one (NO ROOT NEEDED)
To enable/disable the Wi-Fi,
please use the following adb commands:
5/1. To launch the Wifi option on Settings
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
5/2. To disable or enable the wifi mode,
following command will toggle the button to opposite mode.
adb shell input keyevent 19 & adb shell input keyevent 19 & adb shell input keyevent 23
ET VOILA
Happy New Year
There is also this...
Set up wifi to never turn off
Android 12 Developer options adb "Wireless debugging" option keeps turning off
The Android 12's new features for 'Developer options' 'Wireless debugging' is fantastic because you never need a USB cable anymore to connect between the PC and the Android phone using adb (e.g., when using Vysor or scrcpy). However, I am...
forum.xda-developers.com
adb shell settings put global cw_disable_wifimediator 1
Turn wifi on and off
How to turn on and off the WiFi through ADB (no root)?
I found I can use these ADB commands to turn on and of the WiFi of a rooted phone: adb shell su -c 'svc wifi enable' adb shell su -c 'svc wifi disable' However, I'm interested in doing it without having to root the phone for an automatic...
forum.xda-developers.com

[App][4.0+] CM App Installer

CM App Installer will pull the latest versions of the apps available that CyanogenMod exclusively develop, and give you the option to install them to your system either rooted or non-rooted. I cannot guarantee success with this, I don't develop the application, my job is simply to make it easier for you guys to get your favourite CyanogenMod apps on your own ROMs!
Use carefully! As ever, I do not take responsibilty for any damage done to your device as a result of this! The root features use the code specified in "code" in the options menu, or it's listed below. If you're paranoid, please give it a read
I have to emphasise, please try the non-root method first!. The root method is designed as a last ditch attempt to get it working, it does backup and restore your old versions but errors do happen, expect this as a possibility if you're rooted!
The list of apps available in the application are:
Apollo
Calculator
CM File Manager
Torch
Messaging
DSP Manager
Voice+
News and Weather Widget
Trebuchet Launcher
cLock Widget
Movie Studio
CM Wallpapers
Let me know if you have any more suggestions to add!
Code
This information is also available from within the application.
There are a number of commands that this application uses, it executes certain processes through the code to copy apps to the system directory.
These commands are ran as if they were ran inside the terminal emulator, and always consist of
process, remount to read-write, transfer/copy/rename, remount to read-only, close. (In this order).
I use a Process to get a SU Runtime instance
Code:
Process p = Runtime.getRuntime().exec("su");
And then I use a PrintStream to issue the commands listed below to it.
Remount the system partition as read-write
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Rename an app (use move command to move with a different extension - Creating backups)
Code:
mv /system/app/AppOfChoice.apk /system/app/AppOfChoice.bak
Copy an app from SD card to System directory
Code:
cat /sdcard/CMApps/AppOfChoice.apk > /system/app/AppOfChoice.apk
Remove an app from system partition
Code:
rm -r /system/app/AppOfChoice.apk
For permissions, I use chmod
Code:
chmod 644 /system/app/AppOfChoice.apk
Remount the system partition as read-only
Code:
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
And that is it. The process commands get pushed over the course of about two seconds, and should work. Again, I can't promise everything.
Credit also goes to the Reddit member /u/wchill, his code helped with the system code (shown in the Code section above)
Similarly, I do not take any responsibility if this app causes your phone to be bricked, corrupted, broken, or to encounter an unfortunate case of spontaneous combustion. Use at your own risk.
In the mean time, enjoy!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Source:
See this xda thread

[GUIDE] Not registered on network fix - EFS failed to mount - NO IMEI or Zero IMEI

Today i got an issue for my N960F after flashing a custom ROM. I'm not sure till now what've gone wrong, but after rebooting my device i faced an issue that my SIM card can not register on network.
Cellular network signal is full, but can not make any calls and can not connect to data.
Tried to restore through TWRP with a nand backup, but always fails as EFS partition can not be mounted. Eventually I managed to restore my EFS partition after following the hereunder steps.
I'll just leave it here if anyone faced the same in the future.
Disclaimer: You are doing this at your own risk. I shall not be held liable for any losses or bricked devices ( They already are )
Pre requisites:
- ADB on your PC, latest SDK is preferred.
- Custom recovery ( with ADB enabled )
- Better to have a previous EFS backup
Steps:
- Reboot into recovery and enable ADB ( in TWRP, ADB is enabled by default )
- Attach your device to your PC. and open your terminal or command prompt as an admin.
- Type the following commands:
- Navigate to your ADB folder ( in my case it is C:/ADB )
cd C:/ADB
- Ensure that your phone is readable in ADB mode
c:\ADB>adb devices[ATTACH type="full"]5610649[/ATTACH]
c:\ADB>adb shell
Your terminal handle should change into root ~ #
~ # cd /dev/block
/dev/block # ls
you should get an output like this
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
/dev/block # cd by-name
/dev/block/by-name # ls -la
you should see device partitions listed as this .. EFS partition is highlighted in yellow and is on sda3 as below
/dev/block/by-name # mke2fs /dev/block/sda3
and you should be prompted by a message to proceed or not. Press y then enter
Finally,
/dev/block/by-name # mount -w -t ext4 /dev/block/sda3
We successfully formatted and mounted EFS partition and now either to restore your old EFS backup or flash stock firmware through ODIN.
Resources:

Categories

Resources