Hello,
I recently needed to force an update to my Chromecast but couldn't find any way how to do it.
I'm sorry if it has been already posted here but Google couldn't find anything about it.
Most of you probably know the HTTP interface to various Chromecast settings, but it seems like nobody has found the way how to force it to check for an update.
Normally you can request a restart by sending a POST message like this:
Code:
curl -X POST -H "Content-Type: application/json" -d '{"params": "now"}' http://<chromecastIp>:8008/setup/reboot -v
If you want it to actively check for an update and download it you have to send the following (notice the "ota foreground"):
Code:
curl -X POST -H "Content-Type: application/json" -d '{"params": "ota foreground"}' http://<chromecastIp>:8008/setup/reboot -v
{
"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"
}
If there's an update available it should shortly start to increase the percentage of the download, otherwise it will just stay at 0%.
The download itself took probably half an hour to complete for me.
When the download is finished it is necessary to force a reboot with the first command.
PS: That's where I found out about it: https://chromium.googlesource.com/c...st/+/master/server/cros/sonic_client_utils.py
Greetings
Hagn
Hagn99 said:
Hello,
I recently needed to force an update to my Chromecast but couldn't find any way how to do it.
I'm sorry if it has been already posted here but Google couldn't find anything about it.
Most of you probably know the HTTP interface to various Chromecast settings, but it seems like nobody has found the way how to force it to check for an update.
Normally you can request a restart by sending a POST message like this:
Code:
curl -X POST -H "Content-Type: application/json" -d '{"params": "now"}' http://<chromecastIp>:8008/setup/reboot -v
If you want it to actively check for an update and download it you have to send the following (notice the "ota foreground"):
Code:
curl -X POST -H "Content-Type: application/json" -d '{"params": "ota foreground"}' http://<chromecastIp>:8008/setup/reboot -v
If there's an update available it should shortly start to increase the percentage of the download, otherwise it will just stay at 0%.
The download itself took probably half an hour to complete for me.
When the download is finished it is necessary to force a reboot with the first command.
PS: That's where I found out about it: https://chromium.googlesource.com/c...st/+/master/server/cros/sonic_client_utils.py
Greetings
Hagn
Click to expand...
Click to collapse
How do i run these commands ?
tharmor said:
How do i run these commands ?
Click to expand...
Click to collapse
You need some way to send HTTP POST requests with a body. My example uses the curl command which should be already available in most Linux environments.
Under Windows you need to download it first. You can find some precompiled binaries here: curl.haxx.se/download.html
Starting from line 199 has the commands for this, such as setting a OTA flag and update & factory reset.
Today I read that there were a new update for chromecast and test this method and it works like a charm. Upgraded from 26653 to 27946 at first try.
As stated in OP it takes a lot of time to download, and seems to be stuck at 100% but I don't need to manually reboot, I just wait several minutes and it was auto rebooted and everything was fine.
Code:
$ curl -X POST -H "Content-Type: application/json" -d '{"params": "ota foreground"}' http://192.168.1.15:8008/setup/reboot -v
* Hostname was NOT found in DNS cache
* Trying 192.168.1.15...
* Connected to 192.168.1.15 (192.168.1.15) port 8008 (#0)
> POST /setup/reboot HTTP/1.1
> User-Agent: curl/7.37.1
> Host: 192.168.1.15:8008
> Accept: */*
> Content-Type: application/json
> Content-Length: 28
>
* upload completely sent off: 28 out of 28 bytes
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers:Content-Type
< Cache-Control:no-cache
< Content-Length:0
<
* Connection #0 to host 192.168.1.15 left intact
I'm having problems running this command. I always get a HTTP Bad Request error. Anyone know how to fix it?
Code:
curl -X POST -H "Content-Type: application/json" -d '{"params":"ota foreground"}' http://192.168.2.96:8008/setup/reboot -v
* Trying 192.168.2.96...
* Connected to 192.168.2.96 (192.168.2.96) port 8008 (#0)
> POST /setup/reboot HTTP/1.1
> User-Agent: curl/7.41.0
> Host: 192.168.2.96:8008
> Accept: */*
> Content-Type: application/json
> Content-Length: 25
>
* upload completely sent off: 25 out of 25 bytes
< HTTP/1.1 400 Bad Request
< Access-Control-Allow-Headers:Content-Type
< Cache-Control:no-cache
< Content-Length:0
<
* Connection #0 to host 192.168.2.96 left intact
bozzykid said:
I'm having problems running this command. I always get a HTTP Bad Request error. Anyone know how to fix it?
Click to expand...
Click to collapse
In your curl execution it's only sending 25 bytes of data:
Code:
> Content-Length: 25
>
* upload completely sent off: 25 out of 25 bytes
In my execution it's sending 28 bytes of data:
Code:
> Content-Length: 28
>
* upload completely sent off: 28 out of 28 bytes
There are 28 bytes in the command {"params": "ota foreground"}.
Firstly try the command with an space after ”params”:
If it doesn't work try to run it under bash (if you are using another shell).
The other difference is the curl version. I'm using 7.37.1 while you are using a newer one, 7.41.0.
Hope it helps.
CURL Settings 720p
Hi there,
ontopic: Your commands run great
Just copy and paste in the mac terminal and it works. Of course change your Ip address
a little bit oftopic:
Is it possible to set the output of the chromecast to 720p via curl POST?
If so, then this could be the end of my long search-trip on the internet
Kind regards,
Vincent
not working anymore
Hi there,
Previously it worked, but now I can't update:
27946 -> May 8, 2015 (Cast SDK release 2.6.1)
Any ideas?
vincentcox said:
Hi there,
Previously it worked, but now I can't update:
27946 -> May 8, 2015 (Cast SDK release 2.6.1)
Any ideas?
Click to expand...
Click to collapse
Are you sure there is any newer version than 27946? I don't know if the SDK is always directly linked to a Chromecast update.
My Chromecast is currently also at 27946 and the update screen comes up just like before. It just can't find any update.
There isn't any newer update then 27946, so method is probably still working.
This is the latest firmware 31432 u have it too
bozzykid said:
I'm having problems running this command. I always get a HTTP Bad Request error. Anyone know how to fix it?
Code:
curl -X POST -H "Content-Type: application/json" -d '{"params":"ota foreground"}' http://192.168.2.96:8008/setup/reboot -v
* Trying 192.168.2.96...
* Connected to 192.168.2.96 (192.168.2.96) port 8008 (#0)
> POST /setup/reboot HTTP/1.1
> User-Agent: curl/7.41.0
> Host: 192.168.2.96:8008
> Accept: */*
> Content-Type: application/json
> Content-Length: 25
>
* upload completely sent off: 25 out of 25 bytes
< HTTP/1.1 400 Bad Request
< Access-Control-Allow-Headers:Content-Type
< Cache-Control:no-cache
< Content-Length:0
<
* Connection #0 to host 192.168.2.96 left intact
Click to expand...
Click to collapse
I had a problem just like this but fortunately I was able to fix it myself. I was using curl for windows and it gave me this exact error. You'll have to use cygwin with curl
astrit1 said:
This is the latest firmware 31432 u have it too
Click to expand...
Click to collapse
can't get it to update to that version. Has it been pulled or is it region specific?
lalo_lalo said:
can't get it to update to that version. Has it been pulled or is it region specific?
Click to expand...
Click to collapse
I live in Germany I Don't know if it is region specific
Just turned my chromecast on and saw that version
astrit1 said:
I live in Germany I Don't know if it is region specific
Just turned my chromecast on and saw that version
Click to expand...
Click to collapse
Spain; received too.
I issued the command and it was stuck at 0%. But after a reboot I got the latest update (31432). So it seems to still work.
Isn't it easier to restart by chromecast-app? I do so... after reboot ota gets installed automaticly..
written in stone
Droehnemeier said:
Isn't it easier to restart by chromecast-app? I do so... after reboot ota gets installed automaticly..
written in stone
Click to expand...
Click to collapse
The rollout of OTA updates are staged, so you don't have to received update even after restat app or the CC itself.
chromecast die after force update
Hi ,
yesterday i test this command , its start from 34% after 100% just wait about 30 minute (to auto reboot), then i run force reboot command.
after reboot it's show installing 10% 20% .... 100% after reboot it goes to black screen,
i tried connecting it to power multiple times, when I do the light goes red light.
i try to factory reset by holding button about 25+ second but nothing happened,
When plugged into the TV all it ever shows is either a pure black screen, or a black screen with Chromecast ... at the bottom.
any solution ?
Related
Photo by Logxen (aka not my trash!)
{
"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"
}
No warranties, no guarantees. If this ruins your device, your fault, not mine. Consider this a test build, backup important stuff manually to your PC for now (photos etc)
This requires an sdcard installed
[Image]
http://download.cunninglogic.com/cwr_ventana_2.img
39b5557cf3802d677e33cce76047ef60 *cwr_ventana_2.img
[Source]
https://github.com/CunningLogic/android_device_lenovo_ventana
[Instructions]
Code:
adb push cwr_ventana_2.img /data/local/
adb shell
su
mount -o rw,remount /system
echo "#!/system/bin/sh" > /system/etc/install-recovery.sh
dd if=/data/local/cwr_recovery_2.img of=/dev/block/mmcblk0p1
[Credits]
djrbliss - For rooting the thinkpad
utkanos - walking me through the device config setup
CM, Koush and everyone who has worked on CWR
FIRST
yea, FIRST!
J/K, space reserved for future use.
Yo second!!!!!
Indeed. Thanks jcase and everyone else..
thanks!
Will check every hours this thread for image link
Thats fantastic! will try this as soon as an image file gets posted! Hopefully it wont be long till it will be running ICS!
Can confirm root as I'm currently running it on my tablet. Bliss did it himself and is going to package it and release it in a couple of hours.
Thanks to everyone for their hard work with this.
quyTam said:
thanks!
Will check every hours this thread for image link
Click to expand...
Click to collapse
Same here.
TS
Umm, I can't find a "HOW-TO-ROOT" thread.
Where is it??
yirsung said:
Umm, I can't find a "HOW-TO-ROOT" thread.
Where is it??
Click to expand...
Click to collapse
its not released yet waiting for confirmation for bounty collection
Sent from my ThinkPad Tablet using Tapatalk
Thanks for sharing this it worked great, except for the instructions I needed to use
dd if=/data/local/cwr_ventana_2.img of=/dev/block/mmcblk0p1
rather than
dd if=/data/local/cwr_recovery.img of=/dev/block/mmcblk0p1
to match the name of your file.
Thanks again for sharing, CWR seems to be running perfectly.
Also for those looking for root the exploit has been posted here.
Hello, can't install CWM. Made everything as in first post (but changed filename). After reboot tried to enter recovery mode, there was text on screen entering recovery or something but device booted to system and nothing happend. Whats wrong. Here is output of instalation:
c:\Program Files (x86)\Android\android-sdk\platform-tools>adb push cwr_ventana_2
.img /data/local/
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
1298 KB/s (4452352 bytes in 3.347s)
c:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
$ su
su
# mount -o rw,remount /system
mount -o rw,remount /system
# echo "#!/system/bin/sh" > /system/etc/install-recovery.sh
echo "#!/system/bin/sh" > /system/etc/install-recovery.sh
# dd if=/data/local/cwr_ventana_2.img of=/dev/block/mmcblk0p1
dd if=/data/local/cwr_ventana_2.img of=/dev/block/mmcblk0p1
8696+0 records in
8696+0 records out
4452352 bytes transferred in 1.903 secs (2339648 bytes/sec)
#
CWR test
did not seem to work . doesn't reboot in recovery but straight in normal boot
what info do you need to help debugging
redbaron said:
Hello, can't install CWM. Made everything as in first post (but changed filename). After reboot tried to enter recovery mode, there was text on screen entering recovery or something but device booted to system and nothing happend. Whats wrong. Here is output of instalation:
c:\Program Files (x86)\Android\android-sdk\platform-tools>adb push cwr_ventana_2
.img /data/local/
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
1298 KB/s (4452352 bytes in 3.347s)
c:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
$ su
su
# mount -o rw,remount /system
mount -o rw,remount /system
# echo "#!/system/bin/sh" > /system/etc/install-recovery.sh
echo "#!/system/bin/sh" > /system/etc/install-recovery.sh
# dd if=/data/local/cwr_ventana_2.img of=/dev/block/mmcblk0p1
dd if=/data/local/cwr_ventana_2.img of=/dev/block/mmcblk0p1
8696+0 records in
8696+0 records out
4452352 bytes transferred in 1.903 secs (2339648 bytes/sec)
#
Click to expand...
Click to collapse
have you tried usiing rom manager? ¿? I have not had the chance if not I would test currently backing up using titanium backup
Sent from my ThinkPad Tablet using Tapatalk
I installed it. It works. Though /sdcard cannot be found and backup doesn't work. But I'm sure these will be figured out in the near future
I've got it installed just fine and even got the back up files
Gonna do a clean install and then see about dumping the images
ClockworkMod Recovery boots for me and was backing up but failed while it was backing up /data for me (I have tried twice now). It seems to backup /system just fine though, I don't know why it would fail during the /data backup. Has anyone else successfully made a backup yet?
failed to restart in recovery for me (exactly as redBaron)
Try to install CWM 3 times
OK, booting in recovery works fine, but NOT via Rom Manager !
(only by pressing and releasing vol+ button when booting)
jhankinson said:
Thanks for sharing this it worked great, except for the instructions I needed to use
dd if=/data/local/cwr_ventana_2.img of=/dev/block/mmcblk0p1
rather than
dd if=/data/local/cwr_recovery.img of=/dev/block/mmcblk0p1
to match the name of your file.
Thanks again for sharing, CWR seems to be running perfectly.
Also for those looking for root the exploit has been posted here.
Click to expand...
Click to collapse
Yes ... one has to take great care with naming files ... I did something similar and used Root Explorer to rename the cwr file correctly.
recovery
still not workign for me.
tried to re-install it a few times
when i boot in recovery with Vol++ i see the booting into recovery message and then after a second or so vibrate again and start normal boot
I am very excited to see this news - though i'm going to wait until there is a semi-stable, well establish path for Root. Hopefully this achievement leads to the Thinkpad Tablet getting much more attention, its a pretty badass tablet and should prove to be a pretty good performer once all the Lenovo crapware is tossed out. Glad I remained faithful and patient!
I've seen you haven't been able to unpack the boot images so I investigated a bit on this "weird format" Moto used. This is what I could figure out by looking at the image and the bootstub code Motorola released:
Code:
0x00000000 kernel CMDLINE, filled with zeroes where unused
0x00000400 bzImage size
0x00000404 initrd size
0x00000408 SPI UART suppression
0x0000040B SPI type (0: SPI0, 1: SPI1)
0x00001000 future stack for bootstub (?)
0x00002000 actual bzImage start
On the boot image I grabbed from the root post, using the awesome "hexdump" tool we can see at 0x400
Code:
60 a8 46 00 90 6c 1a 00
Which means (remember x86 is Little Endian) bzImage size 0x0046A860 (~4.5MB) and initrd size of 0x001A6C90 (~1.65MB)
So let's go to the practical side:
0x00002000 + 0x0046A860 = 4638816
Code:
$ dd if=razr_i_boot.img of=ramdisk.cpio skip=4638816 bs=1
$ zcat ramdisk.cpio|cpio -i
gzip: ramdisk.cpio: decompression OK, trailing garbage ignored
8927 blocks
$ ls
android.fstab dev init.moto.usb.rc init.sc1.rc init.wifi.rc ramdisk.cpio system ueventd.smi.rc
charger init init.moto.usb.sh init.sdcard1.rc init.xmm.rc res ueventd.goldfish.rc xbin
data init.goldfish.rc init.nfs.rc init.sdcard2.rc lib sbin ueventd.rc
default.prop init.moto.rc init.rc init.sdcard.rc proc sys ueventd.sc1.rc
Code:
$ dd if=razr_i_boot.img of=bzImage skip=8192 count=4630624 bs=1
$ file bzImage
bzImage: Linux kernel x86 boot executable bzImage, version 3.0.8-g229e199 ([email protected]) #1 SMP PREEMPT Sat Sep, RO-rootFS, root_dev 0x806, swap_dev 0x4, Normal VGA
Ta-da! Unpacked. It wasn't that hard really
Now, is there interest on a tool to repack/unpack these images? I don't own the phone (and probably won't, no $$ ) but if there's enough interest I can make one, it should be relatively easy.
EDIT: Okay, so I wrote a pair of tools to unpack existing images and package new images, you can get them at
https://github.com/turl/razr-i-boot-tools
Just run "make" to build the tools, the usage is really simple
Code:
$ ./pack
Usage: ./pack <valid image> <bzImage> <ramdisk> <output>
From left to right, an already existing boot image (to copy bootstub from, it could be built from source on the future), the kernel, the gzipped cpio ramdisk and the output filename
Code:
$ ./unpack
Usage: ./unpack <image to unpack> <bzImage out> <ramdisk out>
From left to right, the image you want to unpack, and the destination files for bzImage and ramdisk. You can then unpack the ramdisk with something like
Code:
$ mkdir ramdisk-unpack
$ cd ramdisk-unpack
$ zcat ../ramdisk.cpio.gz|cpio -i
And then repack it with something like
Code:
$ find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
turl1 said:
Ta-da! Unpacked. It wasn't that hard really
Now, is there interest on a tool to repack/unpack these images? I don't own the phone (and probably won't, no $$ ) but if there's enough interest I can make one, it should be relatively easy.
Click to expand...
Click to collapse
Making it look so simple
I really appreciate you taking the time to look at this, especially since you don't even have the device. I definitely have interest in a tool if at all possible. I'd donate and encourage others to as well
I agree with everything he said. Awesome job
Okay, so I wrote a tool to package images, check the edit on the first post and let me know how it works. I'll make another one to unpack current images when I get some more time
turl1 said:
Okay, so I wrote a tool to package images, check the edit on the first post and let me know how it works. I'll make another one to unpack current images when I get some more time
Click to expand...
Click to collapse
Been working all day yesterday to get up and running on Linux again, time to redouble my efforts and try a new distro so I can get packin'!
EDIT:Got everything set up besides ramdisk I believe. First attempt is progress, instead of error booting into fastboot it sticks on the boot logo, then reboots and loops that. I'm pretty sure its because I did ramdisk wrong but we'll see if anyone else can get it further.
File includes ramdisk folder, boot.img, and my compiled bzImage. http://d-h.st/Cyn
mattlgroff said:
Been working all day yesterday to get up and running on Linux again, time to redouble my efforts and try a new distro so I can get packin'!
EDIT:Got everything set up besides ramdisk I believe. First attempt is progress, instead of error booting into fastboot it sticks on the boot logo, then reboots and loops that. I'm pretty sure its because I did ramdisk wrong but we'll see if anyone else can get it further.
File includes ramdisk folder, boot.img, and my compiled bzImage. http://d-h.st/Cyn
Click to expand...
Click to collapse
What did you use to repackage the ramdisk? Something like this should work
Code:
$ cd ramdisk
$ find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
Then use the generated 'newramdisk.cpio.gz' when calling pack; something like
Code:
$ ./pack boot.img bzImage newramdisk.cpio.gz newboot.img
turl1 said:
What did you use to repackage the ramdisk? Something like this should work
Code:
$ cd ramdisk
$ find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
Then use the generated 'newramdisk.cpio.gz' when calling pack; something like
Code:
$ ./pack boot.img bzImage newramdisk.cpio.gz newboot.img
Click to expand...
Click to collapse
Getting a 4.6 MB boot.img with this, trying to boot now.
mattlgroff said:
Getting a 4.6 MB boot.img with this, trying to boot now.
Click to expand...
Click to collapse
Yes, a smaller boot.img is to be expected, the dumped one you guys got has garbage on its tail
turl1 said:
Yes, a smaller boot.img is to be expected, the dumped one you guys got has garbage on its tail
Click to expand...
Click to collapse
Same bootloop issue, looping the bootlogo and phone reboots
Well, it turns out I fail when programming on the late AM
https://github.com/turl/razr-i-boot-tools/commit/34f618b5cb2d6fb4b4c7d8affb194113a0b11270
Update/reclone your tools repo, rebuild it and try again. Rebuild your ramdisk image too, just in case the tool corrupted it.
turl1 said:
Well, it turns out I fail when programming on the late AM
https://github.com/turl/razr-i-boot-tools/commit/34f618b5cb2d6fb4b4c7d8affb194113a0b11270
Update/reclone your tools repo, rebuild it and try again. Rebuild your ramdisk image too, just in case the tool corrupted it.
Click to expand...
Click to collapse
Updated tools, rebuilt tools, rebuilt ramdisk....
6.5 MB newboot.img now.
Boot animation....
Booted!
{
"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"
}
Where's your donation link?
mattlgroff said:
Updated tools, rebuilt tools, rebuilt ramdisk....
6.5 MB newboot.img now.
Boot animation....
Booted!
[image]
Where's your donation link?
Click to expand...
Click to collapse
Awesome! I just wrote the unpack tool by the way, same repo. Check the first post for more info and let me know if you have any issues with it.
I also completed the "donate to me" box on the XDA profile for those looking for it
turl1 said:
Awesome! I just wrote the unpack tool by the way, same repo. Check the first post for more info and let me know if you have any issues with it.
I also completed the "donate to me" box on the XDA profile for those looking for it
Click to expand...
Click to collapse
OMG, I sure won't make use of it but I know how important it is to build Custom Recovery and Custom Roms sooo I'll make a donate soon as I can.
Make boot.img
Hi,
I can't manage to make the boot.img with my compiled kernel for Razr I. Anyone can make the boot.img for me please :victory:
Thank you
"Direct booting from floppy is no longer supported...Please use a boot loader program instead...Remove disk and press any key to reboot..."
WTF?!
open your bzImage with a hex editor, the first lines
Hai mattlgroff, I have switch from your homemade 40002 to 31006 with RST & then OTA auto update to 40002 & then do root & CWM but now the kernel version is older (Sept 2012), so can i copy the recovery.signed in 31006 & change the file name to recovery.img & put into the CWM folder & ADB/Fastboot.
Can i have this better matt-desktop #1 too.Thks.
Daniel 9999 said:
Hai mattlgroff, I have switch from your homemade 40002 to 31006 with RST & then OTA auto update to 40002 & then do root & CWM but now the kernel version is older (Sept 2012), so can i copy the recovery.signed in 31006 & change the file name to recovery.img & put into the CWM folder & ADB/Fastboot.
Can i have this better matt-desktop #1 too.Thks.
Click to expand...
Click to collapse
Its not better, worse actually because things are broken.
Sent from my MB886 using Tapatalk 2
mattlgroff said:
Its not better, worse actually because things are broken.
Sent from my MB886 using Tapatalk 2
Click to expand...
Click to collapse
However,thanks Mattlgroff, For you & all info.,I take your 40002 boot.img & Fastboot flash boot boot.img after RSDlite 31006 & got back the newest Nov,2 kernel. It really run very smooth & fast ( I overwrite your ADB file to a newer ADB from android-sdk folder as dont know why ADB devices cant read/see).Cheers.
mat have you got this to complied because iv only got cgywin or could you build my boot.img to unlink data/media
http://batakang.com/ftp/incoming/boot.img
Having some troubles with this Jellybean boot.img. Anyone want to take a stab at it?
Introduction
CyanogenMod 11 is a custom firmware used on android phones and tablets. But, you already know that, chances are you've used it. Building ROMs may seem scary and confusing at first because of the code and terminals, but in reality, it's not that difficult. In this thread, we're going to be discussing how to build CyanogenMod on a VPS or dedicated server. I say a server and not a desktop machine because this is going to be geared towards keeping things simple. When you have only one shell to work with, it's usually easier.
Vocabulary
A couple words you may be unfamiliar with will be described here.
- shell: where you type in the commands on your VPS/dedicated server
- VPS: Virtual Private Server, a type of server that is virtualized from physical hardware
- Dedicated Server/dedi: a dedi is a physical server, it can be an old computer, or (recommended) a server from a server host/data center like Incero or Colocrossing
- Linux: the operating system in which we will build android
- SSH: Secure SHell, the world-standard protocol used to control Linux servers
- bash: the shell we're going to use
Linux Commands
In order to control our server, we won't be using a GUI (Graphical User Interface) where you can click things to make things happen, we will be using SSH. SSH sessions are just a prompt where you type in commands. This is where people get scared but calm the f*ck down. It's not as scary as movies make it seem. Here's a rundown of some basic commands we'll be using.
- cd: change directory, change the folder we are working in, equivalent of changing folders in windows explorer
- mkdir: make directory, makes folders
- cp: copy, it copies files
- mv: move, it moves files
- rm: remove, it deletes files
- ls: list files, it's like dir for windows
- curl: downloads files from URLs
- adduser: adds users, linux has users just like windows
- apt-get: package manager, it's used to install things. In Windows, you usually install things from .exe or .msi files. In Linux, you generally use a package manager. This will be explained more later.
- nano: our text editor of choice for this tutorial. I chose nano because it's very simple and easy to use for a beginner.
Basic Intro to Linux
A few things that I'm going to discuss about Linux are directory structure as well as file structure. In Windows, we have our C: drive, which is where pretty much everything stays. In Linux, we have /, it's the same thing, except it's represented as a slash. If I wanted to edit C:\cookies\morecookies.txt in Linux, the same file path would be /cookies/morecookies.txt. A couple other things about Linux are that the file system is case sensitive, meaning I can have two files named Android and android in the same directory and they won't conflict, whereas in Windows it would. Linux also uses / (forward-slash) instead of \ (backslash) in the directory structures.
Now, our shell is interactive, meaning it's not just a box we type things into, we can use it in different ways. One of the things you should know about bash is ~ (the tilda). ~ in Linux refers to our home directory. Every user has their own home directory (by default at least). Standard users' homes are stored in /home. If my username is tanmay, my home directory would be /home/tanmay/. If I'm logged in as tanmay, ~/android refers to a file at /home/tanmay/android. If I'm logged in as bob, ~/android refers to /home/bob/android. If you don't understand all this completely, I don't expect you to, don't worry. This was just to give you a brief introduction to Linux.
Buying a VPS
I'm guessing most of you already know how to do this, so I'll put it in a spoiler for those who don't need it loading loads of images.
For this tutorial, we're going to use a DigitalOcean VPS, you can sign up here: https://www.digitalocean.com/?refcode=2050223a4edc
After you sign up for DigitalOcean, head to the billing tab and enter in credit card info or put some money in through PayPal to get yourself some credits. Once done, click the big green Create button. The hostname can be anything you want, I usually just make it "android" or "build". Now, you have a choice here, you can spend less and wait longer for builds, or spend more and wait less. I recommend one of these:
{
"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"
}
Any lower and the build will likely just fail, and any higher is just unnecessary. 16GB is plenty, and 8GB will work just fine. You can go with 4GB if you really can't afford it, but I don't recommend it.
In Select Image, choose Ubuntu 12.04.4 x64 and click Create Droplet. Wait for it to spin up, and check your email. You'll have an email like this:
We'll use these details later.
Getting into our server with SSH
In order to SSH into our server, we need a client. The most common client for Windows is PuTTY. PuTTY is free and open source, it can be downloaded here: http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe (direct link). Open it and you should see this:
Under IP, type in your server's IP. If you used DigitalOcean, it should be in your email. Click Open and when it says login as:, enter "root" without quotes, and then when it asks for password, use the one supplied in the email.
If you're on Mac or Linux, you can open a terminal and type in:
Code:
ssh [email protected] # replace server.ip with the IP of your server, if you used DigitalOcean, it's in the email
Use the password supplied in the email.
Installing The Necessary Packages
Once we're in, we need to update the server's current packages to the latest ones, we can do so with the following commands.
Code:
apt-get update # update the package sources list
apt-get -y upgrade # upgrade all the current packages
Now that that's done, we can install the libraries and packages we need.
Code:
apt-get -y install git gnupg flex bison gperf \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
apt-get -y install build-essential schedtool screen python-software-properties
Android relies on many libraries and compilers, so we can't build it without them.
Oracle Java is closed source, so we have to do some other things to install it.
Code:
add-apt-repository -y ppa:webupd8team/java # add third party source to the package manager's list
apt-get update # refreshes the sources list to include the one we just added
apt-get -y install oracle-java6-installer
While installing oracle-java6-installer, you will be prompted to accept the Oracle Sun Java license agreement whatever, use your arrow keys to select accept then click enter.
Adding Swap
Even with 8GB of RAM, you'll probably run out of memory, so we use swap. Swap is hard drive space that acts as if it's memory for things that aren't important to the host at the current time. We'll need this, because android takes a LOT of RAM to compile.
Code:
fallocate -l 8G /swapfile # create an empty file that's 8GB in size called /swapfile
mkswap /swapfile # format the file to be swap
swapon /swapfile # turn the swapfile on
Adding a User
Now that we have all the required packages to build, let's add a user to build under.
Code:
adduser tanmay # replace tanmay with your username of choice, must be lower case
Enter the password when it prompts for one, then do
Code:
login tanmay # replace tanmay with the username above and enter the password
You should see something like this:
Note: Disregard the system restart message, it's not necessary for our purposes.
You may have noticed that the prompt changed from "[email protected]:~#" to "[email protected]:~$". This shows we're in our new account.
Setting up repo and Downloading the CyanogenMod 11 Source
repo is the tool supplied by Google used to manage the android source code. Since it's used by AOSP, pretty much every ROM uses repo to manage their source. To install repo, we need to make a folder called bin (binary), where we'll store it. This is mainly for organization purposes. After that, we'll download repo to that folder.
Code:
mkdir ~/bin # create a folder called bin in our home directory
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo # download repo and store it in ~/bin/repo
chmod +x ~/bin/repo # mark the file as executable, so we can run it
export PATH=$PATH:~/bin # explained below
The last line may seem scary, but all it does is take the current PATH variable and add ~/bin to it. If you do
Code:
echo $PATH
you get
Code:
[email protected]:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/tanmay/bin
You can see /home/tanmay/bin at the end of it. This allows us to use the repo command anywhere in the filesystem, not only in the ~/bin directory.
Now let's make a folder for our source code.
Code:
mkdir cm-11.0 # make a folder called cm-11.0
cd cm-11 # move into the directory we just made
You should see your shell prompt change like so:
Code:
[email protected]:~/cm-11.0$
This shows us what directory we are in for reference. Now, let's initialize repo in this folder with the CyanogenMod 11 repo.
Code:
git config --global user.name "Your Name" # Necessary for repo to init
git config --global user.email [email protected] # same as above
repo init -u https://github.com/CyanogenMod/android.git -b cm-11.0
When you get prompted if you want color or not, type "y" then press enter.
Now we need to actually download the source.
Code:
repo sync
This takes... a long time. Sit back and relax. If you're using a server, it'll probably take around 10-15 minutes, if you're on a home line, expect a few hours as the source is around 8GB large.
Getting Proprietary Blobs
Since every phone has different hardware, each one requires different drivers. The Nexus 4 (or mako) has it's own, along with every other phone. We need to download these so that CyanogenMod can compile properly. We can incorporate these into our local build using the local_manifests folder.
Code:
cd ~/cm-11.0/.repo # cd into our repo folder
mkdir local_manifests # make a folder called local_manifests
nano local_manifests/roomservice.xml
On the last line, you'll see an editor (nano) open up, this is editing ~/cm-11.0/.repo/local_manifests/roomservice.xml. The name roomservice.xml is just a formality, it can be anything you want. Anyways, inside the file, paste in the following:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<manifest>
<project name="TheMuppets/proprietary_vendor_lge" remote="github" revision="cm-11.0" />
</manifest>
Once you enter that in, press CTRL + X, Y, then enter. This will save and exit the file.
Next run
Code:
cd ~/cm-11.0/ # bring us back to the parent directory of the source
repo sync # sync again to download the new project we added
Don't worry, this sync won't take hours like the last one, this shouldn't take more than a minute or two.
Getting Prebuilts and Building!
We're getting to the actual build! What we have to do now is get the prebuilt apps that CyanogenMod comes with. We can do this with the following command.
Code:
~/cm-11.0/vendor/cm/get-prebuilts
Once those download, run the following.
Code:
export USE_CCACHE=1 # ccache is compiler cache, it makes future builds MUCH faster, this is not necessary if you're only going to build once
source build/envsetup.sh # load the commands supplied by CyanogenMod used to build
lunch cm_mako-userdebug # generate the Makefile, the instructions for the compiler on how to build the ROM
ARE YOU READY?! THIS IS IT.
Code:
mka bacon # yes, bacon
Aaaaaaaaaaaaand wait. Wait a lot. This is going to take a LONG time.
Downloading the ROM
To download your ROM, download WinSCP from here: http://winscp.net/eng/download.php
Once installed (or just downloaded), open it and enter in the same credentials that you used in PuTTY except use the username and password we added ("tanmay" in my case) instead of root. Click login, and click Okay for messages that you get prompted for. Once you're in, open the cm-11.0 folder, then out/product/target/mako/. Inside that folder, you should see a zip called cm-mako-something.zip. Drag this file onto your desktop or a folder of your choice and then flash it.
CONGRATULATIONS YOU BUILT CYANOGENMOD 11 FOR THE NEXUS 4
Wasn't so bad, was it?
I hope this guide has helped you, if it has, please press the Thanks button below.
Thanks for reading!
awesome guide bt can u help me regarding mtk ........how can i add device tree and vendor manually
Nice tutorial. Just want to add that if your going with DigitalOcean you have the choice of deploying an instance that has Docker preinstalled on Ubuntu. In that case following this tutorial is much simpler and easier.
http://forum.xda-developers.com/showthread.php?t=2650345
Thanks !
[email protected] said:
awesome guide bt can u help me regarding mtk ........how can i add device tree and vendor manually
Click to expand...
Click to collapse
Hi bro @[email protected]! Check it may be useful:
https://github.com/axet/android_device_mt6592
https://github.com/axet/android_vendor_mt6592
Regards.
hyperion70.
PHP:
/*
* Your warranty is now void.
*
* We're not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/
Devices Confirmed working.
SCL-L21
{
"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"
}
Work:
Cellural
3/4G
WiFi
BT
GPS
And other
Not work:
Camera
On first boot not work WiFi and BT
Download: https://yadi.sk/d/UZE7mX1735WJrp
Installation:
1. Flash TWRP if not flashed yet
2. Flash CM-12.1 From tis thread http://forum.xda-developers.com/android/development/rom-unoffical-cm12-1-huawei-y6-t3404674
3. Flash Sailfish OS
Sources here: https://github.com/sailfishos-huawei-y6
Self build instructiion
Build only on Ubnutu
1. Setup evenroment:
Code:
cat <<'EOF' > $HOME/.hadk.env
export MER_ROOT="$HOME/mer"
export ANDROID_ROOT="$MER_ROOT/android/droid"
export VENDOR="huawei"
export DEVICE="y6"
export PORT_ARCH="armv7hl"
EOF
cat <<'EOF' >> $HOME/.mersdkubu.profile
function hadk() { source $HOME/.hadk.env; echo "Env setup for $DEVICE"; }
export PS1="HABUILD_SDK [${DEVICE}] $PS1"
hadk
EOF
cat <<'EOF' >> $HOME/.mersdk.profile
function hadk() { source $HOME/.hadk.env; echo "Env setup for $DEVICE"; }
hadk
EOF
2. Download MerSDK
Code:
export MER_ROOT=$HOME/mer
cd
TARBALL=mer-i486-latest-sdk-rolling-chroot-armv7hl-sb2.tar.bz2
curl -k -O https://img.merproject.org/images/mer-sdk/$TARBALL
sudo mkdir -p $MER_ROOT/sdks/sdk
cd $MER_ROOT/sdks/sdk
sudo tar --numeric-owner -p -xjf $HOME/$TARBALL
echo "export MER_ROOT=$MER_ROOT" >> ~/.bashrc
echo 'alias sdk=$MER_ROOT/sdks/sdk/mer-sdk-chroot' >> ~/.bashrc
exec bash
echo 'PS1="MerSDK $PS1"' >> ~/.mersdk.profile
cd
3. Entering into Mer SDK and update it
Code:
exec bash
sdk
# IN SDK
sudo zypper ref
sudo zypper up
sudo zypper ar http://repo.merproject.org/obs/home:/sledge:/mer/latest_i486/ curlfix
sudo zypper ref curlfix
sudo zypper dup --from curlfix
sudo zypper in android-tools createrepo zip
4. In MerSDK download Android build SDK
Code:
hadk
TARBALL=ubuntu-trusty-android-rootfs.tar.bz2
curl -O http://img.merproject.org/images/mer-hybris/ubu/$TARBALL
UBUNTU_CHROOT=$MER_ROOT/sdks/ubuntu
sudo mkdir -p $UBUNTU_CHROOT
sudo tar --numeric-owner -xvjf $TARBALL -C $UBUNTU_CHROOT
ubu-chroot -r $MER_ROOT/sdks/ubuntu
5. Setup repo comand and update repos
Code:
sudo mkdir -p $ANDROID_ROOT
sudo chown -R $USER $ANDROID_ROOT
cd $ANDROID_ROOT
mkdir $ANDROID_ROOT/.repo/local_manifests -p
cd $ANDROID_ROOT
curl https://storage.googleapis.com/git-repo-downloads/repo > repo
chmod a+x repo
sudo mv repo /usr/bin/repo
repo init -u git://github.com/mer-hybris/android.git -b hybris-12.1
6. Setup local_manifest for our device
Code:
cd $ANDROID_ROOT/.repo/local_manifests/
curl -O https://raw.githubusercontent.com/sailfishos-huawei-y6/droid_repo_local_manifests/master/y6.xml
cd $ANDROID_ROOT
7. Download sources (~13 Gb)
Code:
repo sync --fetch-submodules
8. Build android part
Code:
hadk
source build/envsetup.sh
export USE_CCACHE=1
breakfast $DEVICE
make -j4 hybris-hal
9. Download SB2 target
Code:
exit
cd $HOME
SFE_SB2_TARGET=$MER_ROOT/targets/$VENDOR-$DEVICE-$PORT_ARCH
TARBALL_URL=http://releases.sailfishos.org/sdk/latest/targets/targets.json
TARBALL=$(curl $TARBALL_URL | grep "$PORT_ARCH.tar.bz2" | cut -d" -f4)
curl -O $TARBALL
sudo mkdir -p $SFE_SB2_TARGET
sudo tar --numeric-owner -pxjf $(basename $TARBALL) -C $SFE_SB2_TARGET
sudo chown -R $USER $SFE_SB2_TARGET
cd $SFE_SB2_TARGET
grep :$(id -u): /etc/passwd >> etc/passwd
grep :$(id -g): /etc/group >> etc/group
sb2-init -d -L "--sysroot=/" -C "--sysroot=/"
-c /usr/bin/qemu-arm-dynamic -m sdk-build
-n -N -t / $VENDOR-$DEVICE-$PORT_ARCH
/opt/cross/bin/$PORT_ARCH-meego-linux-gnueabi-gcc
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R rpm --rebuilddb
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper ar
-G http://repo.merproject.org/releases/mer-tools/rolling/builds/$PORT_ARCH/packages/
mer-tools-rolling
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper ref --force
10. Create droid-hal rpm packages
Code:
cd $ANDROID_ROOT
rpm/dhd/helpers/build_packages.sh
11. Create KS file for sailfish rootfs
Code:
mkdir -p tmp
HA_REPO="repo [email protected]@"
KS="[email protected]@[email protected]@.ks"
sed -e "s|^$HA_REPO.*$|$HA_REPO --baseurl=file://$ANDROID_ROOT/droid-local-repo/$DEVICE|" $ANDROID_ROOT/hybris/droid-configs/installroot/usr/share/kickstarts/$KS > tmp/$KS
12. Create root_fs
Code:
cd $ANDOROID_ROOT
hybris/droid-configs/droid-configs-device/helpers/process_patterns.sh
RELEASE=2.0.5.6
EXTRA_NAME=-my1
sudo mic create fs --arch $PORT_ARCH --debug --tokenmap=ARCH:$PORT_ARCH,RELEASE:$RELEASE,EXTRA_NAME:$EXTRA_NAME --record-pkgs=name,url --outdir=sfe-$DEVICE-$RELEASE$EXTRA_NAME --pack-to=sfe-$DEVICE-$RELEASE$EXTRA_NAME.tar.bz2 $ANDROID_ROOT/tmp/[email protected]@[email protected]@.ks
After that we will get zip file for TWRP flash
Gold work
Thanks for this good work, do you think it is possible to fix camera?
I use scl-l21 with cm 12.1 and it works even the camera.
Sorry for my bad english.
dasder said:
Thanks for this good work, do you think it is possible to fix camera?
I use scl-l21 with cm 12.1 and it works even the camera.
Sorry for my bad english.
Click to expand...
Click to collapse
In cm camerafix you just replace custom kernel to default.
I think it possible and we work on camera fix. Now we can get image but can`t get focus and white balans.
Thank's will wait of the fix. [emoji106]
Hello I am just curious how the work goes on, thanks in advance
i always wanted an Selfish OS on my device what is the possibility to port Sailfish to other Huawei devices ?
for me this reboots straight int o fastboot mode and i cannot get out unless manual to recovery then reflash known working rom any help would be appreciated
dunryc said:
for me this reboots straight int o fastboot mode and i cannot get out unless manual to recovery then reflash known working rom any help would be appreciated
Click to expand...
Click to collapse
I get a bootloop
I have an error 7 while instalilng the zip, removing the device model line in updater_script changes nothing. My model is SCL-L01
KrysRom said:
I have an error 7 while instalilng the zip, removing the device model line in updater_script changes nothing. My model is SCL-L01
Click to expand...
Click to collapse
only SCL-21
Uh ok
Wysłane z mojego SCL-L01 przy użyciu Tapatalka
neochapay said:
only SCL-21
Click to expand...
Click to collapse
But on scl-l02 it got stuck on a boot loop
---------- Post added at 09:31 PM ---------- Previous post was at 09:29 PM ----------
KrysRom said:
I have an error 7 while instalilng the zip, removing the device model line in updater_script changes nothing. My model is SCL-L01
Click to expand...
Click to collapse
Which twrp are u using u need to use 2.8 and remove the the line from update script and flash twrp 2.8
Is there any way to port it/run it on SCL-L01?
Sailfish for Huawei Y5
I need Sailfish OS for huawei Y5
sirfmoyo said:
I need Sailfish OS for huawei Y5
Click to expand...
Click to collapse
build it i post instructions
Any news about SCL-L01 port?
Updated 7.30.20
I have a server up and running and thought it would be perfect to go back to this. I noticed some problems with the original code. After a while, the oem unlock command would hang, so I made it reboot the bootloader ever 1024 keys. I also added an initial oem unlock check because the first time you do the command it asks are you sure. This script should work forever.
I did notice that the screen will get burn in if left on for a long time. I cannot seem to find a way around this, no fastboot command can turn the screen off and keep fastboot running. I figured a $40 screen is worth reviving a $700 phone. This phone has been sitting in a box for years because verizon's anti everyone policies on bootloaders. I will be running this until it cracks the bootloader.
There is an automatic saving/restoring feature in case the computers gets turned off or I need to restart it. I also made the script not repeat characters more than 3 times in a row. I know chances are this won't work, but to me it's worth a try considering I don't have to do anything.
Code:
#!/bin/bash
restore() {
echo "Restoring Previous Session..."
crunch 20 20 ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -d 3 -s "${file}" | while read line; do
iter=$((iter + 1))
echo "Testing key ${line} - ${iter}"
line2=$((sudo fastboot oem unlock "${line}") 2>&1)
check=$(echo "${line2}" | sed -n 2p)
echo "${check}"
if [ "${check}" != "(bootloader) Code validation failure" ]; then
echo "${line}" >> key
finished
fi
echo "${line}" > current
if [ $iter -eq 1024 ]; then
echo "--------------------"
echo "Rebooting to bootloader"
echo "--------------------"
sudo fastboot reboot bootloader
echo "--------------------"
echo "Sleeping 5 seconds"
echo "--------------------"
sleep 5s
iter=0
echo "--------------------"
echo "Running initial oem unlock"
echo "--------------------"
sudo fastboot oem unlock aaaaaaaaaaaaaaaaaaaa
fi
done
}
new() {
echo "Running New Session..."
crunch 20 20 ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -d 3 | while read line; do
iter=$((iter + 1))
echo "Testing key ${line} - ${iter}"
line2=$((sudo fastboot oem unlock "${line}") 2>&1)
check=$(echo "${line2}" | sed -n 2p)
echo "${check}"
if [ "${check}" != "(bootloader) Code validation failure" ]; then
echo "${line}" >> key
finished
fi
echo "${line}" > current
if [ $iter -eq 1024 ]; then
echo "--------------------"
echo "Rebooting to bootloader"
echo "--------------------"
sudo fastboot reboot bootloader
echo "--------------------"
echo "Sleeping 5 seconds"
echo "--------------------"
sleep 5s
iter=0
echo "--------------------"
echo "Running initial oem unlock"
echo "--------------------"
sudo fastboot oem unlock aaaaaaaaaaaaaaaaaaaa
fi
done
}
finished() {
echo ""
echo "------------------------------------"
echo ""
echo "A different output was given, probably bootloader key found"
echo "Last checked key was"
echo "${line}"
echo "Key is also stored in a file called key"
echo "${line}" >> key
chmod 555 key
echo ""
echo "------------------------------------"
echo ""
echo "Press enter to close the terminal"
read var
exit 1
}
testresult() {
if [ -f "current" ]; then
file=$(cat current)
if [ "${file}" == "" ]; then
rm current
new
else
restore
fi
else
new
fi
}
testkey() {
if [ -f "key" ]; then
file=$(cat key)
if [ "${file}" == "" ]; then
chmod 775 key
rm key
testresult
else
echo "Key from last run was found, it is"
echo "${file}"
echo "Backing up to key.old"
chmod 775 key
cat key >> key.old
rm key
testresult
fi
else
testresult
fi
}
iter=0
sudo fastboot oem unlock aaaaaaaaaaaaaaaaaaaa
testkey
Knuxyl said:
I wrote a script for linux to bruteforce the bootloader unlock key on the Verizon model Motorola Moto Z2 Force.
Since I do not use my Force I figured I would run a bruteforce on the bootloader to hopefully one day get it unlocked. I am using an ASUS Tinkerboard with Debian 2.0.7 to run this code.
Requirements
Linux (Ubuntu do sudo apt-get install crunch sed, if your using anything else get crunch and sed)
Time
What it does
Generates alpha-numerics keys 20 characters long in order starting at AAAAAAAAAAAAAAAAAAAA.
It creates a file called "current" that will save your spot in case you want to resume later.
It will stop when bootloader response does not says validation failure and save the last used key to a file called "success"
Code (create a .sh file with this, do chmod +x thisfile.sh, then run it with ./thisfile.sh)
Code:
restore() {
crunch 20 20 ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -s "${file}" | while read line ; do echo "Testing key below ${line}" && line2=$((sudo fastboot oem unlock "${line}") 2>&1) && check=$(echo "${line2}" | sed -n 2p) && echo "${check}" && if [ "${check}" != "(bootloader) Code validation failure" ]; then echo "${line}" >> success && finished ; fi && echo "${line}" > current ; done
}
new() {
crunch 20 20 ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 | while read line ; do echo "Testing key below ${line}" && line2=$((sudo fastboot oem unlock "${line}") 2>&1) && check=$(echo "${line2}" | sed -n 2p) && echo "${check}" && if [ "${check}" != "(bootloader) Code validation failure" ]; then echo "${line}" >> success && finished ; fi && echo "${line}" > current ; done
}
finished() {
clear
echo "A different output was given, probably bootloader key found"
echo "Last checked key was"
echo "${line}"
echo "Key is also stored in a file called success"
echo "${line}" >> success
echo ""
echo "Press enter to close the terminal"
read var
exit 1
}
if [ -f "current" ]; then
file=$(cat current)
if [ "${file}" == "" ]; then
rm current
new
else
restore
fi
else
new
fi
I am running this now, I will post back if I ever get the key. Started 1700 on 23-July-2018.
I am on AAAAAAAAAAAAAAAAAUAA as of 1743 for a time/speed reference.
Click to expand...
Click to collapse
If it works, it might one day, unlock bootloaders for other phones as well. Good luck, first person I found to even try such a thing...
You'd have much better odds winning the lottery than getting a brute force answer in your lifetime. It is really folly. Let's assume you are doing just numeric characters instead of alpha numeric. That gives you 10 to the 20th power number of combinations instead of 36 to the 20th power. So if you wrote really optimized code and could go through 1 billion combinations a second, that would be 10 to the 9th power. I billion seconds later you would have gone through 10 to the 18th power or just one percent of the possible combinations. A billion seconds is a little more than 31 years. So in 3100 years you would have gone though just the strictly numeric solutions. As I've said before, brute force isn't going to get you the answer and shouldn't even be considered a viable answer.
kingstu said:
You'd have much better odds winning the lottery than getting a brute force answer in your lifetime. It is really folly. Let's assume you are doing just numeric characters instead of alpha numeric. That gives you 10 to the 20th power number of combinations instead of 36 to the 20th power. So if you wrote really optimized code and could go through 1 billion combinations a second, that would be 10 to the 9th power. I billion seconds later you would have gone through 10 to the 18th power or just one percent of the possible combinations. A billion seconds is a little more than 31 years. So in 3100 years you would have gone though just the strictly numeric solutions. As I've said before, brute force isn't going to get you the answer and shouldn't even be considered a viable answer.
Click to expand...
Click to collapse
What's your solution? You seem to have all the answers.
Find an exploit.
Try
Code:
fastboot oem unlock nowait
This worked for the Moto 360 on Marshmallow, it MIGHT work.
To find an exploit would be quicker than brute forcing.
doubledragon5 said:
What's your solution? You seem to have all the answers.
Click to expand...
Click to collapse
I don't have all the answers but buying a bootloader unlockable version is what I would recommend. By showing how long it would take I save someone from waiting and waiting for a task that won't complete in his lifetime...
So the phone died like a day later while running the bruteforce. I have the powerpack moto mod so I'm going to have to plug that in to a charger, put it on the phone, and plug usb to phone and pc/tinkerboard... when I get around to it. But I will keep up with this thread.
I tried the nowait fastboot and Code Validation Failure.
Is it even possible for a mobile device to go through 1-billion combinations a second? What if the code was split up over like 10 devices, and the code had each device only working on a smaller section for the unlock code......
azreark1 said:
Is it even possible for a mobile device to go through 1-billion combinations a second? What if the code was split up over like 10 devices, and the code had each device only working on a smaller section for the unlock code......
Click to expand...
Click to collapse
The unlock has to be tested on the specific device so splitting the processing among multiple devices won't solve the problem since each has its own unique code. Just buy a device with an unlockable bootloader since if it was that easy to decode the device wouldn't be very secure and that would have me more worried...
Oh so it's not a generic unlock code, it would still only be device specific?! Yeah thats pretty useless.
The method was initially a failure, why was it laid out here?
08sv80 said:
The method was initially a failure, why was it laid out here?
Click to expand...
Click to collapse
this is really only for people who have a verizon moto z2 force that they do not use and a pc they keep running 24/7. the method is not a failure, it just takes a long time. this is the only solution we have so far, so its better than nothing, but if u dont like it then move on, dont waste time posting useless comments.
for anyone that was interested in this, i must note that while phone is on the bootloader (fastboot) the screen stays on at like max brightness the whole time, so it can easily cause screen burn in. until i find some fastboot command to turn the screen off this is highly not recommended. Mine started burning in so I stopped the process.
you write nonsense and make people believe it? take it easy. your method is initially a failure. Believe on 4PDA, we know all the working methods.
If it hasn't been done, I believe the only way to unlock these bootloaders is exercising some consumer rights through a legal battle, and good luck with that, not worth wasting the time and money. I would be happy to just have temp-root, even if I have to do it every time I boot the phone. That would be more productive to chase, but I believe all exploits have been tried.
Could somebody use IBM's quantum computer
What if somebody could rewrite the script and use IBM's quantum computer. I am not a developer or a script Kitty or anything but that idea crossed my mind. Could it be possible or is it possible. I do know IBM lets people use their old quantum computer so it's just an idea.
Fastlane81 said:
What if somebody could rewrite the script and use IBM's quantum computer. I am not a developer or a script Kitty or anything but that idea crossed my mind. Could it be possible or is it possible. I do know IBM lets people use their old quantum computer so it's just an idea.
Click to expand...
Click to collapse
It's the phone's response and process that takes time, not the computer running the script.
m4f1050 said:
It's the phone's response and process that takes time, not the computer running the script.
Click to expand...
Click to collapse
Ok I figured that there was so many combinations that the normal computer couldn't figure out the combinations that fastso I figured with a quantum computer it can do it in days instead of months or years. That is what I was thinking.
Fastlane81 said:
Ok I figured that there was so many combinations that the normal computer couldn't figure out the combinations that fastso I figured with a quantum computer it can do it in days instead of months or years. That is what I was thinking.
Click to expand...
Click to collapse
Trust me, even an 8-bit Atari can create random numbers fast enough for this task (not saying you can use one, because you need to store the numbers and compare the newly created one with the ones already used, which I would use SQL server for this and not memory.) It's the phone itself the one slowing this down when entering the number and waiting for the phone to respond and starting the process again.
Kindly give instructions.
If someone can kindly give me instructions on how to initiate this code that would be awesome I have Ubuntu 20.04.1 installed on my desktop. And I just need to know how to initiate this script. If you can email me at [email protected] that would be awesome thank you very much