First:
You need a ROOTED phone!, I didn't try this on a non-rooted phone, and I don't think it'll work on a non-rooted phone. However, you can do it on a custom recovery like TWRP.
Second:
You have to mount system and data partitions using this command:
Code:
adb shell
su
mount /system
mount /data
Third:
Now you can edit system time using this command:
Code:
date MMDDhhmmYYYY.ss
Where MM = month, DD = day, hh = hours, mm = minutes, YYYY = year, .ss = seconds;
example:
date 061422362017.00
Fourth:
You can now set the hardware clock using this command:
Code:
hwclock -w
Fifth:
using
Code:
date
alone will display your current system date.
using
Code:
hwclock -r
will display you current hardware clock.
make sure your time zone is -1 or your hardware clock will be incorrect!
______________________________________________________
This method is used when you can't access the system, or can't set time regularly.
Related
Apparently, some firmwares seem to disable "adb" service on the Galaxy S.
So in case you run into this problem (adb unable to see the device) what you will need is to modify /default.prop on the SGS.
Here is what I had originally:
Code:
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=1
ro.debuggable=0
persist.service.adb.enable=0
To enable ADB on SGS
1. Run on the device: setprop persist.service.adb.enable 1 to temporarily switch it on.
2. pull /default.props with adb and modify the "ro.secure=0" and "persist.service.adb.enable=1"
2. mount -o remount,rw rootfs /
3. push modified default.props back to /
It's what I'd need, but the guide it's not quite clear to me:
1. Run on the device, means on terminal emulator?
2. How to pull? And please, specify better what to change...
I assume the rest of commands must be issue on the device via terminal emulator...
Let me know and thanx so much!
details
In more detail:
1. Root your device (see FAQ sticky post)
2. Install shell emulator on the device
3. In shell emulator, enable ADB (not sure if you need to run "su" before that):
setprop persist.service.adb.enable 1
4. Now, you should be able to connect to the device with ADB (temporarily). If not, make sure your udev rules (for Linux: /etc/udev/rules.d/51-android.rules) are smth like:
SUBSYSTEM=="usb|usb_device", ATTRS{idVendor}=="04e8", MODE="0666"
5. To make the change permanent:
adb pull /default.props .
(this will copy default props to local directory)
6. Modify the two properties as follows:
ro.secure=0
persist.service.adb.enable=1
7. Re-mount the root filesystem on the device in read-write mode (requires "su" before that):
mount -o remount,rw rootfs /
8. Now overwrite the /default.props on the device with modified one:
adb push default.props /default.props
I recently came across a couple of threads in which it seems it was desirable (for some) to run the stock kernel, but with the ice glacier ROM. There were a couple of methods that I saw, neither of which seemed to work for me (one was an update kernel zip file package to be applied from recovery mode from the sdcard, and the other was more involved (see THISthread). The kernel provided in that thread is actually not the true STOCK kernel, as best as I can tell. It is likely equivalent, but uname -r still returns a Gr8gorilla lable.
So I decided to try the following method. First, if you have a nandroid/clockwork recovery backup of your device before installing ice, then you already have everything you need to revert to the stock kernel. Here is the procedure.
1) reboot phone into recovery
2) go into backup and restore
3) select advanced restore
4) select the very first backup set (the stock, probably first rooted one).
5) select restore boot partition
After this completes, you'll have ice but with stock kernel. However, your wireless will not work until you place the correct kernel module file corresponding to your kernel (bcm4329.ko) in the /system/lib/modules directory. In your nandroid backup set, there is a system.img file. Transfer this file to your computer, and use unyaffs to extract its contents and look for lib/modules/bcm4329.ko
6) while in recovery mode, make sure to mount /system
7) remove or rename the /system/lib/modules/bcm4329.ko file
8) adb push bcm4329.ko /system/lib/modules/bcm4329.ko
9) unmount /system from recovery, and reboot.
That's it. I tested this and ended up seeing:
Code:
Linux localhost 2.6.32.21-g899d047 #1 PREEMPT Tue Oct 26 16:10:01 CST 2010 armv7l GNU/Linux
and my wireless was working just fine. I have attached the wireless kernel module corresponding with stock kernel, and I have attached the boot.img from stock, in case you're reading this, and by some strange reason, you don't actually have an original backup.
I don't personally plan on running stock kernel, I just wanted to see if I _could_ if I wanted to.
Hope you find this useful.
Kambiz
One thing I noted btw, is that after doing this, when I did adb shell, it dropped me into a non-root shell by default, and I had to type "su" or "su - " to gain root. The other thing to note, is that the stock initrd, has the following default.prop entry:
ro.secure=1
whereas ice has:
ro.secure=0
What does this mean?! (besides double rainbow all the way across the sky)?
Setting ro.secure=0 allows adb root functions to work.
My MyGlacier 4G MINE!!!
grankin01 said:
Setting ro.secure=0 allows the "adb remount" command to work.
My MyGlacier 4G MINE!!!
Click to expand...
Click to collapse
Right. That's what I thought. But I have to say, it seemed to work anyway, because I did:
$ su -
# mount -o remount,rw /system
and then
# cd /system/lib/modules
# mv bcm4329.ko bcm4329.ko.ice
# cp /sdcard/stock-bcm4329.ko bcm4329.ko
# chmod 644 bcm4329.ko
# cd /
# mount -o remount,ro /system
Then I rebooted, and the "stock" driver file that I just put in place was persistent. So I'm not sure if clockworkmod is doing something to ensure ro.secure=0 ... I'm not sure.
No, it means that "adb root" and "adb remount" and any of the other adb root functions will have root access to your device through Android Debug Bridge (adb) by default. My adb shell always comes up with a $ prompt and I have to "su" for root. Setting this to 0 should let you type "adb root" or " adb remount" from your command shell on your desktop and allow you a root prompt device shell or rw access to system without having to "su" or "mount -o remount,rw /dev/block/mmcblk0p25 /system".
My MyGlacier 4G MINE!!!
so this is the true stock kernel?
tiger013 said:
so this is the true stock kernel?
Click to expand...
Click to collapse
Yes. I made a clockworkmod backup (nandroid backup) after rooting my phone with visionary+, but didn't alter anything else. So once I overwrote everything with Ice Glacier, I still have stock (post OTA update to 2.2.1) kernel and wireless drivers. (attached to OP).
I don't know how to convert them to a flashable update.zip, but I was able to load them using the procedure above.
EDIT:
Notice that the output of "uname -a" when run from adb shell is:
Linux localhost 2.6.32.21-g899d047 #1 PREEMPT Tue Oct 26 16:10:01 CST 2010 armv7l GNU/Linux
The Gorilla kernels have EXTRAVERSION strings added (the kernel version follows after "Linux localhost" in that string)
thank you! I added it to my thread
thanks for this peeps
Having dropped my desire and cracked the screen I would like to perform a factory wipe via ADB before I take it in for repair (I've backed it up).
I have the clockwork recovery which doesn't have the su/format commands and I am unable to find information on the other functions.
Any tips?
Many thanks!
Clockwork recovery offers all wipe and factory reset functions. 2.5.0.7, unless I'm missing something
He has no screen man, so gui is Wortes
Anyway, try this
Code:
adb shell
#wipe data
just a question, can you go from rooted desire with custom rom to stock by just wiping everyting in clockwork recovery?
I thought you needed to run a RUU update to put everything back to stock?
swimon said:
I thought you needed to run a RUU update to put everything back to stock?
Click to expand...
Click to collapse
That's right. But even if wipe all is not back to stock, it's better than leaving a rooted rom if you want to give it for repair i think.
try;
adb shell
wipe all
you need to add ./ to the start of adb if using a mac or linux
./adb shell
wipe all
Thanks for all the help guys!
I tried the *wipe* command, but I didn't have superuser mode set up.
To get into superuser, which was denied repeatedly I read that a popup usually shows on the phone requesting access. I think I managed to click that by tapping the screen on the left where "yes/accept" usually shows.
When I tried with superuser:
Code:
adb shell
su
wipe system
I got an long list of files that it was unable to delete.
At this point, I needed to leave and thought maybe the phone needed charging or something.
Coming back to it now, the phone is not recognised by ADB.
I've done a lot of searching and I think I must have unchecked the "usb debugging" from the notifications menu somehow.
So I have a new problem...
q) Is it possible to enable usb debugging with a cracked screen or otherwise get into the phone?
I connect the phone and just get android disk device/usb disk drive in windows manager.
I can reboot the phone into bootloader (with volume down held) and when I connect the phone I get bootloader interface appearing instead of disk drive but I just don't know where to go from there.
All I want is to clean the phone before I send it in for repair!
If anyone is able to help, I greatly appreciate it, if not thanks for your time.
In recovery you have full adb acces and can do all!
I would say, you try to make a nandroid backup and than flash the ruu
You take out your sd card and send than the device to them.
They wont to a forensic dataanalys, and most of the personal stuff is on the sd ;-)
Ps.: as far as i know you can flash ruus over fastboot(needs s-off)
And when you get your phone back, you root it and restore the last backup!
Pps.: if you haven't done a backup in the closer past you can sync, with htc sync with your pc! So you have atleast your contacts
Edit: when everything fails just keep the sd :-( they should be professional enough to keep your privacy! And i dont think your emails, sms and contacts are that different from all others :-D
Ah thanks, I thought I might be able to do that as I was mulling it over this morning. When I get home I'll give it a try and see if I succeed. I'll let you know how it goes!
Thanks for the tips and the advice on the nandroid backup - I do have a backup already - I did it when I cracked the screen as a pre-emptive, because at first I could see everything and I assumed it was just a crack but overnight the screen blacked out totally.
Ok, it's in recovery mode but doesn't seem to recognise wipe command. I added a directory listing of /sbin
Code:
C:\Program Files\Android\android-sdk\platform-tools>adb devices
List of devices attached
HT0XWPLXXXXX recovery
C:\Program Files\Android\android-sdk\platform-tools>adb shell
~ # wipe data
wipe data
/sbin/sh: wipe: not found
~ # wipe all
wipe all
/sbin/sh: wipe: not found
~ # wipe
wipe
/sbin/sh: wipe: not found
~ # ls
ls
cache etc res sdcard
data init root sys
default.prop init.rc sbin system
dev proc sd-ext tmp
~ # cd sbin
cd sbin
/sbin # ls
ls
[ erase_image mkswap sort
[[ expr mktemp split
adbd false mkyaffs2image stat
amend fdisk modprobe strings
ash fgrep more stty
awk find mount swapoff
basename flash_image mountpoint swapon
bbconfig fold mv sync
bunzip2 free nandroid sysctl
busybox freeramdisk nandroid-md5.sh tac
bzcat fuser nice tail
bzip2 getopt nohup tar
cal grep od tee
cat gunzip patch test
catv gzip pgrep time
chgrp head pidof top
chmod hexdump pkill touch
chown id printenv tr
chroot insmod printf true
cksum install ps tty
clear kill pwd tune2fs
cmp killall rdev umount
cp killall5 readlink uname
cpio killrecovery.sh realpath uniq
cut length reboot unix2dos
date less recovery unlzop
dc ln renice unyaffs
dd losetup reset unzip
depmod ls rm uptime
devmem lsmod rmdir usleep
df lspci rmmod uudecode
diff lsusb run-parts uuencode
dirname lzop sed watch
dmesg lzopcat seq wc
dos2unix md5sum setsid which
du mkdir sh whoami
dump_image mke2fs sha1sum xargs
echo mkfifo sha256sum yes
egrep mkfs.ext2 sha512sum zcat
env mknod sleep
/sbin #
su rm -rf *
Does that work? :/
Yep, that's done the trick. Thanks.
try a straight
adb shell wipe all
all on one line sometimes the shell boots incorrectly
1. How can I root my phone?
1.1 General information/Basic adb-commands
Rooting a phone enables you to do things, which normally aren't possible for the average user like:
- Removing apps which were preinstalled by the provider (like Orange, Vodafone, etc.). My Tattoo had Vodafone apps for buying music and other sh*t, which was installed on the system partition (to which a "normal" user has no rights to write to, including deleting).
The Tattoo was successfully rooted by a bunch of guys here, namely -bm-, mainfram3 and Coburn64 (maybe, I don't remember quite correctly ). Also the Tattoo was the first phone having a security mechanism hindering a user to mount the filesystems as read/write, which had to be overridden by remapping the read only memory region to a read/write one. This is done by the module Tattoo-hack.ko, also made by mainfram3. He also created the first boot.img, which enabled su directly from adb and loading Tattoo-hack directly from boot on.
A few words about adb:
ADB is a tool for communicating from the PC with the mobile phone. For this a service is running on the phone enabling the communication via Terminal Emulator. Here are the most useful adb-commands:
Code:
adb push localFileFromPC /path/on/mobilephone
-> pushes a file "localFileFromPC" to a specified location on the phone
adb pull /path/to/file pathFromPC
-> receives a file from the phone and stores it to "pathFromPC"
adb remount
-> This is only possible in custom ROMs, remounts the file system to r/w automatically
adb shell "command"
-> executes "command" and returns to the computer shell
adb shell
-> opens a shell session on the phone (from here on you have to be very careful! Also you can execute now normal linux commands like rm, mv, ls, chmod and so on, but not cp (this can done through busybox)). You will have to use this more often, so get used to it
1.2 Do I have to create a goldcard?
I read this question quite often. For rooting, you don't need it, but for SIM-locked phones you can't flash custom unbranded ROMs (I think).
A guide to create a goldcard follow this link: http://forum.xda-developers.com/show...88&postcount=1 (thanks to MiSSigNNo to this point)
1.3 Tools you need
A complete set of tools can be found here Feel free to mirror it:
http://rapidshare.com/files/403766494/Tattoo.rar.html
Mirror(s):
http://www.bild-ton.net/Tattoo.rar
http://www.megaupload.com/?d=CI9AW83F
This package contains:
- adb binaries for Windows (sorry Linux users )
- su (Please note: use the su-binary attached in this post, not the one in the archive!!!!!)
- m7 exploit
- Amon_RA recovery.img
- mainfram3 boot.img
- flash_image binary
- tattoo-hack.ko
1.4 The automated way
This method was created by maverixx and can be found here. This basically consists of a package doing everything you need by itself. It roots the phone and flashes maverixx recovery.img, which (no offense) I don't like as much as I like Amon_RA's one!). Just click the batchfile and it does the rest (you have to connect your phone via USB to your PC though ).
If you want to use the automated way, but flashing Amon_RA's recovery, just replace the recovery.img from maverixx' package with the recovery.img provided in my archive file (see 1.3 for the link).
In my time here I noticed quite a few users experiencing problems either with a fully functional su or with the recovery image not flashing certain update.zip packages. It seems to be a matter of luck.
1.5 The manual way (recommended by the author)
I personally like what is done when and how, that's why I recommend the manual way. So let's get down to business Let's see if you know all the adb-commands I wrote here:
1. Let's say you have everything unpacked into C:\Tattoo
2. In your terminal (on your PC) type:
- adb shell "mkdir /data/local/bin" (if it returns an error it means that the directory already exists, just proceed)
- adb push m7 /data/local/bin/
- adb push su /data/local/bin/
- adb push flash_image /data/local/bin/
- adb push tattoo-hack.ko /data/local/bin/
- adb push recovery.img /sdcard
- adb push boot.img /sdcard
3. We have every needed file on the phone now. Type now (we are still in your terminal):
- adb shell
$ cd /data/local/bin
$ chmod 766 m7 (I don't retain this step as mandatory, so if this process fails, just proceed)
$ while ./m7 ; do : ; done
lots of text until you see something like "wrote shell code", press enter 2 or 3 times enter to see:
#
4. Then perform this:
- # export LD_LIBRARY_PATH=/system/lib
- # export PATH=/system/bin
- # insmod ./tattoo-hack.ko
- # mount -o rw,remount /dev/block/mtdblock5 /data
- # mount -o rw,remount /dev/block/mtdblock3 /system
- # cat ./su > /system/bin/su
- # chmod 4755 /system/bin/su
- # chmod 755 ./flash_image
Questions?
1.6 Problems and (hopefully good) solutions
Q: How do I execute my command line tool?
A: On your Windows host, go to Start->Run...->type "cmd"
Q: Where is my adb? When I type it in my shell it says that it was not found!
A: The adb binary is found in the archive I supplied above or in the Google SDK. As my archive-file is quite smaller than the Google SDK you should take mine. Let's suppose your adb binary is unpacked in C:\Tattoo, then type:
Code:
Your\Current\Location> cd C:\Tattoo
C:\Tattoo> adb <command>Q: adb says "error: device not found" when I try to launch the shell on the phone!
A: Connect the phone with the usb cable and make sure the sd card is not mounted as drive on your PC!!!
Q: When I want to copy something the phone returns that "cp" is not found! Also when I try to move a file, it says "cross-link device".
A: Well, copying from one partition to another is only possible either via busybox or via
Code:
cat file > /location/filename
Example:
cp /data/su /system/bin
is realized by typing
cat /data/su > /system/bin/suAlso make sure that system is r/w!!!
Q: flash_image returns write errors when flashing recovery/boot image!
A:
For boot: Try to redo the flash procedure
For recovery: Note that you can't flash the same recovery.img as the one already installed, so install another recovery.img first (like maverixx) and then Amon_RA's again. If it still doesn't work reboot, remount the partitions r/w, insmod tattoo-hack.ko and retry flashing.
Q: How can I unroot my device?
A: Just delete su from /system/xbin and restore the old boot.img. Alternatively see here for retrieving a stock ROM to flash it on your phone.
i hope someone try this i don't have time
Hello,
I was browsing many topics for over 5 hours until I decided to ask this question so I hope it will not be obvious.
I'm having an Marvell PXA1920 CPU based Android 4.3 phone - Lenovo A788t.
It was rooted using some one-click application, so I did have access to superuser, SuperSU installed etc.
After some modifications done in /etc/permissions and rebooting, phone's entering an infinite loop.
All I need to do now is undo those changes, deleting those files and copying files from backup in another folder. However, for that I need access to /etc with /system remounted in rw mode.
I can access my phone using adb in "Product mode" (phone turned on with lower-volume button pressed), however it seems that from there I don't have root access, so:
I've tried following commands:
1. adb root
result: adbd cannot run as root in production builds
2. adb remount
result: remount failed: Operation not permitted
3. adb shell mount -o rw,remount /system
result: mount: Operation not permitted (in general, no matter what I'm trying to mount/remount)
4. adb shell su
result: the same as echo "su" - prints "su", but does not cause entering su
5. adb shell su -c 'mount -o rw,remount /system'
result: prints command, but does not execute proper action
6. adb shell busybox ...
result: causes the same as all above (operation not permitted)
It seems that phone doesn't support fastboot (adb reboot bootloader doesn't work)
I know that I can do hard reset, but I don't really want to lose all my data and configuration.
Is there anything else what I can do?
Thanks for help in advance