[Android 11] [GENERIC] [Tried and Tested on OP7T] [ROOT/TWRP/CWM/LOS-R] How to extract partitions as img containers. - OnePlus 7T Guides, News, & Discussion

Spoiler: Introduction
After recently facing trouble rooting my OnePlus 7T due to obsolete outdated guides, This thread aims to help anyone facing the same problems as me.
Prerequisites : ​
Platform Tools : Android Debug Bridge version 1.0.41 - 31.0.2-7242960 recommended. [DOWNLOAD HERE]
Your device's drivers for the corresponding Operating System, here, OnePlus' USB Drivers. [DOWNLOAD HERE AFH][DOWNLOAD HERE EXTERNAL]
A little information about adb, fastboot, recoveries and partitions.
FOR UNROOTED USERS ONLY : to *DUMP* the partition, you will need superuser access, in order to emulate root access we will temporarily boot in a custom recovery. [DOWNLOAD HERE FOR 1+7T] [DOWNLOAD FOR OTHER DEVICES]
WARNING : I AM NOT RESPONSIBLE FOR YOUR ACTIONS. FOLLOW THIS GUIDE AT YOUR OWN RISK. JUST BECAUSE IT WORKS FOR ME DOESNT MEAN IT WORKS FOR YOU. USE YOUR HEAD.
Procedure & Explanation : ​
Setting up ADB​
Go to Settings > About Phone & Tap on Build Number Repeatedly 5-7 times. A toast message should pop up informing you about the developer status unlock on your phone.
Find Developer Options > USB Debugging in the settings app and Enable it by turning on the switch next to it.
Extract platform-tools to any desired location on your computer, open the directory containing the binaries and start a PRIVILEGED (run as admin/root) Terminal/CMD/Powershell in this location. OR. Alternatively, you can also navigate to the directory using CLI commands if you see fit.
Connect your Android device to your workstation using a USB cable.
Run ./adb[.exe] devices. (.exe is for windows only, please check the executable's name for this command). A popup should open on your device asking you to allow USB Debugging, tick "Always Allow" and allow the USB Debugging request. A device should popup on your workstation terminal thus indicating that ADB has connected to your device successsfully. [REFER SCREENSHOTS]
{
"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"
}
Finding the Corresponding Partition to dump.​
In order to extract any or all of the above partitions, we must first discover the corresponding memory addresses symlinked to the partitions. This, is usually the most difficult part, "Finding the partitions", as different devices tend to have different file structures and can also be updated via OTA updates. The OnePlus 7T, being an A/B Device launching with Android 10, Dynamic Partitions have been implemented.
For devices launching with Android 10, create a partition called super. The super partition handles A/B slots internally, so A/B devices don't need separate super_a and super_b partitions. All read-only AOSP partitions that aren't used by the bootloader must be dynamic and must be removed from the GUID Partition Table (GPT). Vendor-specific partitions don't have to be dynamic and may be placed in the GPT. (Read More : source.android.com)​
Click to expand...
Click to collapse
​Thus, the following partitions are included in the OnePlus 7T :​
For the sake of convenience, I will illustrate how to dump the boot_a/boot_b partition, any other partitions can be dumped similarly following the same procedure.
The system partition table on Android 11 is a plethora of Symbolic Links that can be found in the by-name directory generally under \dev\block. Since the placement of this directory might change according to the subject device, a generalized method to discover the location is using the find command. Enter the following commands to find the partition.
Code:
./adb[.exe] shell
Code:
find /dev -name 'by-name' 2>/dev/null
You may or may not get multiple results, in theory, any of these directories should contain what we're looking for, I prefer /dev/block/by-name since it is the exact container that defines the symbolic links to these partitions. Next, you will have to list the files in the directory in order to get each and every symlink sorted by its name. To do so, use ls -a <path_to_by-name>. In this case :
Code:
ls -a /dev/block/by-name
This lists all the partitions in the file-system ranging from modem drivers to kernel specific partitions, hopefully, this contains what you're looking for, as shown in the screenshot above, the A/B device OnePlus 7T has boot_a and boot_b boot partitions. For a widespread explanation, I'll be dumping them both. To do so, we must find the actual memory addresses these symbolic links lead to, to do this, ls -l <path_to_symlink> is to be used. In this case :
Code:
ls -l /dev/block/by-name/boot_*
"boot_*" matches both boot_a and boot_b, thus making it simpler for us.
Click to expand...
Click to collapse
As shown in the screenshot, this will list the corresponding directories these symlinks lead to, boot_a is stored under /dev/block/sde11 and boot_b is stored under /dev/block/sde38. Now that we've discovered the location of the data we need to dump, we can proceed to dumping the contents of these directories.
Dumping the required partitions as .img files​
THIS PART WILL REQUIRE ROOT ACCESS, NO ROOT? KEEP READING​
Click to expand...
Click to collapse
For ROOTED users :​
You're in luck, its wayy easier for you. Firstly, to gain superuser access in adb shell, type su, hit enter and grant superuser access on whatever root provider you're using, probably Magisk. The shell echo character should change to a # thus indicating superuser access.
To dump the partitions, the dd if=<path_to_input_block> of=</sdcard/partition_name.img> is to be used, in this case :
Code:
dd if=/dev/block/sde11 of=/sdcard/boot_a.img && dd if=/dev/block/sde38 of=/sdcard/boot_b.img
Commands in linux can be chained together using the && operator.
Click to expand...
Click to collapse
As shown, this dumped the boot images in my phone's internal storage. Now these files can be used as intended. Cheers.
For UNrooted users :​
In order to gain elevated privileges to access the partitions, we will use the fastboot binary to temporarily boot to a custom recovery and have privilege escalation. So first, download the recovery for your device, unzip any archives and find an img file, copy/move this file to the same directory as the adb binaries and then restart the command line shell window as you did before, keep in mind to be in the same directory on your shell.
To boot to the downloaded recovery, the phone must be put on fastboot mode, ensure OEM/Bootloader Unlocking is turned on in Developer Options and then use ./adb[.exe] reboot fastboot to boot into fastboot mode.
Once in fastboot, type ./fastboot[.exe] devices and your device should show up in a list similar to the one showed before.
Next, use ./fastboot[.exe] boot <your_recovery.img> to boot into the desired recovery, in my case :
Code:
./fastboot.exe boot twrp-3.4.0-2-hotdog-unified-mauronofrio.img
Once in recovery mode, start an adb shell using ./adb[.exe] shell and follow the same steps as mentioned for rooted users, once you exit recovery mode, your phone will restore it's stock recovery.
That was your cue to read the section just above this one, Cheers.
I'll edit the guide as necessary. Based on the feedback received.

Related

[HOWTO]- Performing a Nandroid Restore Manually using ADB

[HOW TO] Perform a Nandroid Restore via the Android Debug Bridge (ADB)
(This guide assums that you have already installed and set up adb tools on you PC)
1. Start phone in recovery mode, by turning it on while holding "Home" and "Power" buttons.
2. Plug the phone into the PC with a USB cable
3. Start Windows Command Prompt on your PC, by pressing Start on your PC and typing CMD into the run or search bar depending on your operating system. Then selecting Command Prompt.
4. Within the command prompt window, change the directory to the one your adb tools are by typing the following:
cd c:\sdk\tools
Click to expand...
Click to collapse
The path you put in may be different to this example, as it depends where on your PC your adb tools are kept.
5. Then type:
adb shell
Click to expand...
Click to collapse
6. Now type:
mount /sdcard
Click to expand...
Click to collapse
7. Now you need to change directory again to the one holding your nandroid back-up data, so first type
cd /sdcard
Click to expand...
Click to collapse
8. Then type:
cd nandroid
Click to expand...
Click to collapse
9. Now you need to find the specific name for the folder that holds your Nandroid Backup images, so type:
ls
Click to expand...
Click to collapse
and view the list that appears.
10. Now to enter the folder you want to back up to type
cd HT**********
Click to expand...
Click to collapse
obviously replacing the *s with your numbers and letters. FYI the number string is your Device Serial number.
11. Again type
ls
Click to expand...
Click to collapse
and view the list that appears.
12. Now to enter the folder you want to back up to type
cd BCD***-********-****
Click to expand...
Click to collapse
obviously replacing the *s with your numbers and letters. FYI the format of these digits is BCDXYZ-YYYYMMDD-HHMM from when the back up was created.
13. Now type:
nandroid-mobile.sh restore
Click to expand...
Click to collapse
14. Just press enter to select default.
15. Double check that the Default backup that is found is the one you want then press enter again.
Your selected backup will now be restored. When your CMD window looks like the one below you can reboot your phone and it will be as you remember 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"
}
A big thanks goes to Pulser, without whom I would still be stuck, and this guide wouldn't have been written.
Nice. But are steps 6-12 really necessary? When in shell it should enough enter nandroid-mobile.sh -r, press enter to get you the list of available backups, pressing enter once again restores the last backup, or if you want an older just type the full name of that backup.
Install apk
Hello Fellow Androids!
If this is off topic, please accept my apologies. I am searching through all of XDA for a simple solution to adding apk. Now before you start bashing, please keep in mind that I am well aware of the "search" options + google + XDA etc.
Long story short, I have:
1) Rooted
2) Fashed many Roms (currently on Stock 2.1)
3) Lag Fixxed (see signature)
4) Removed Bloatware
5) I am familiar with ABD and commands
Problem:
All I'm trying to do is install certain "apk"s using ADB. I am well aware of the Program that installs/ pushes apps automatically that are found in G1 + Vibrant + HTC + Droid Forums without having to do any typin......BUT.....I would like to know my way around ABD <----Main reason why i dont want the easy way out.
I have been here:
http://forum.xda-developers.com/showthread.php?t=716806
as well as here:
http://forum.xda-developers.com/showthread.php?t=743457
even been here:
http://forum.xda-developers.com/showthread.php?t=740545
I know what you are thinking, why not use them? As i said before, i would like to be efficient with ADB. So...
I have tried methods found here:
http://forum.xda-developers.com/showthread.php?t=517874
As well as:
http://forum.xda-developers.com/showthread.php?t=532719
The problem I am having is:
Whether i navigate to my folder (desktop with all my apps) and use either
"adb push app /system/sd/app
adb push app-private /system/sd/app-private"
or simply
"adb install <path to file> - Example: adb install c:/apps/apps2sd.apk"
I always get the error: "cant find <whatever apk> to install"
No matter which directory i have it, i get that message.
Note:
1) I have debugging on
2) I mounted sd <----also tried Without mounting
3) I have used the same command when I removed bloatware but i understand Adding apks are slightly different.
4) I have all the drivers installed + Microsoft's .net framework + etc
What am i doing wrong?
All Critics, input, education bashing (just not hating) lol are welcome. Thanks!
put adb in your path... cd to the apk directory and run adb push *.apk /system....
TylerDurdenK said:
[HOW TO] Perform a Nandroid Restore via the Android Debug Bridge (ADB)
(This guide assums that you have already installed and set up adb tools on you PC)
and view the list that appears.
12. Now to enter the folder you want to back up to type
obviously replacing the *s with your numbers and letters. FYI the format of these digits is BCDXYZ-YYYYMMDD-HHMM from when the back up was created.
13. Now type:
MD window looks like the one below you can reboot your phone and it will be as you remember it.
http://farm3.static.flicn.[/QUOTE]
I get the error "nandroid-mobile.sh not found" after step 13. please help.
Click to expand...
Click to collapse
Dont use this, use jordfaz's clockworkmod, if you really need to use this adb script then you need to get nandroid-mobile.sh script somewhere

Simple guide to ADB/Fastboot

I've noticed an increase of users "bricking" their handsets. I use the term "bricking" in the slightest sense, as to them, it is bricked.
The main cause is simply a lack of background knowledge & experience with ADB & Fastboot, I've also noticed that the very helpful guides to recover handsets from this "bricked" state, have an assumption that the users know basic things such as using ADB/Fastboot & cmd. The very things that caused the "brick" in the first place.
Here I'm going to throw together a crash course in the very basics of ADB/Fastboot and how to implement them into your system so that they work all the time and from anywhere on your system. Then an example on how to flash a ROM.
Ensure that USB debugging is enabled on your handset. On HTC Sense it can be found under Settings > Developer Options > Check USB Debugging.
Step One - Download ADB & Fastboot - HERE
Step Two - Extract this to a folder on your C:\ - e.g. "C:\ADB"
Step Three - Add this location to your System PATH - This is important as it makes things a lot easier later
Control Panel > System > Advanced System Settings > Environment Variables...
At the bottom "System Variables" scroll down and find "Path", Click it then "Edit..."
Add to the end of the line named "Variable Value:" ";C:\ADB\" - Try not to delete anything previously in there, the ; is needed, just omit the quotes "".
Hit Ok on the menus and go back to your desktop.
Step Four - Reboot your system or just log out and back in.
Here is a image guide to follow.
{
"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"
}
-
-
Adding ADB & Fastboot to your System PATH allows you to run the commands adb & fastboot from anywhere in your system. Normally the guide you'd follow would say,
cd into fastboot folder
Click to expand...
Click to collapse
Now you don't need to.
Example usage.
You download a new ROM (CM10) plus GApps & the boot.img from the relevant thread. You copy the ROM & GApps from your computers download folder to your handset. Unmount USB storage and you do the following, making sure that your handset is still plugged in.
Open your computers default download folder.
Shift + Right Click > Open command window here
Type the following
adb devices > Serial Number should be printed
adb reboot bootloader > Device reboots into HBOOT, Fastboot is automatically selected.
fastboot devices > Serial Number should be printed again
fastboot flash boot boot.img > boot.img is sent and flashed, easy. Sometimes the boot.img maybe named different, just start typing and hit TAB, should autocomplete.
fastboot erase cache > not always needed, better being safe
Press the power button on your handset to enter HBOOT, then navigate to RECOVERY and press power.
In Recovery, make your backups as per, and wipe & flash the ROM + GApps, then reboot normally.
Profit
If you still do not understand what you are doing, don't do it. You would not attempt to change a head gasket in your cars engine, unless you knew and understood what you were doing. If you are unsure, search, read & ask until you know what your doing. Sometimes what I write looks too clinical so here's a :cyclops: smiley to lighten the post.
Andy said:
I've noticed an increase of users "bricking" their handsets. I use the term "bricking" in the slightest sense, as to them, it is bricked.
The main cause is simply a lack of background knowledge & experience with ADB & Fastboot, I've also noticed that the very helpful guides to recover handsets from this "bricked" state, have an assumption that the users know basic things such as using ADB/Fastboot & cmd. The very things that caused the "brick" in the first place.
Here I'm going to throw together a crash course in the very basics of ADB/Fastboot and how to implement them into your system so that they work all the time and from anywhere on your system. Then an example on how to flash a ROM.
Ensure that USB debugging is enabled on your handset. On HTC Sense it can be found under Settings > Developer Options > Check USB Debugging.
Step One - Download ADB & Fastboot - HERE
Step Two - Extract this to a folder on your C:\ - e.g. "C:\ADB"
Step Three - Add this location to your System PATH - This is important as it makes things a lot easier later
Control Panel > System > Advanced System Settings > Environment Variables...
At the bottom "System Variables" scroll down and find "Path", Click it then "Edit..."
Add to the end of the line named "Variable Value:" ";C:\ADB\" - Try not to delete anything previously in there, the ; is needed, just omit the quotes "".
Hit Ok on the menus and go back to your desktop.
Step Four - Reboot your system or just log out and back in.
Here is a image guide to follow.
-
-
Adding ADB & Fastboot to your System PATH allows you to run the commands adb & fastboot from anywhere in your system. Normally the guide you'd follow would say,
Now you don't need to.
Example usage.
You download a new ROM (CM10) plus GApps & the boot.img from the relevant thread. You copy the ROM & GApps from your computers download folder to your handset. Unmount USB storage and you do the following, making sure that your handset is still plugged in.
Open your computers default download folder.
Shift + Right Click > Open command window here
Type the following
adb devices > Serial Number should be printed
adb reboot bootloader > Device reboots into HBOOT, Fastboot is automatically selected.
fastboot devices > Serial Number should be printed again
fastboot flash boot boot.img > boot.img is sent and flashed, easy. Sometimes the boot.img maybe named different, just start typing and hit TAB, should autocomplete.
fastboot erase cache > not always needed, better being safe
Press the power button on your handset to enter HBOOT, then navigate to RECOVERY and press power.
In Recovery, make your backups as per, and wipe & flash the ROM + GApps, then reboot normally.
Profit
Click to expand...
Click to collapse
This is what i was looking for. I am just about to flash a ROM in a HTC vivid S-ON and i need it to flash the kernel manually.
Thank you. :cyclops:
Can you boot into recovery with a fast boot command?
Sent from my HTC One X using xda app-developers app
Tw1tchy said:
Can you boot into recovery with a fast boot command?
Sent from my HTC One X using xda app-developers app
Click to expand...
Click to collapse
Fastboot works in the bootloader
ADB works in the running OS and the recovery
So fastboot reboot recovery will work in the bootloader, adb reboot recovery works in the running OS and inside the recovery (if you want to reboot it for some reason when you are already in)
Unfortunately there is no fastboot command (AFAIK) to reboot into recovery from fastboot directly. Your only fastboot reboot options are
fastboot <command>
Code:
reboot
reboot-bootloader
Andy said:
Unfortunately there is no fastboot command (AFAIK) to reboot into recovery from fastboot directly. Your only fastboot reboot options are
fastboot <command>
Code:
reboot
reboot-bootloader
Click to expand...
Click to collapse
Ah my mistake , sorry mate. So it only apply to adb .
Thanks
Mr Hofs said:
Ah my mistake , sorry mate. So it only apply to adb .
Thanks
Click to expand...
Click to collapse
if you are in ADB
"
adb reboot bootleader
adb reboot recovery.
"
but if you are in fastboot you need to navigate to recovery option using the vol up and vol down keys and power on recovery.
:facepalm:
and i was wondering why fastboot write: waiting for device, of course if i use fastboot instead adb to try to reboot my phone in OS
i had forgotten...
Hi Im desperatte trying to root my ATT HTC ONE X with 1.5 using this method http://forum.xda-developers.com/showthread.php?t=1709296
I found this tutorial and I dont know if could work.
I have one big question: After i extracted the file in step one I get a folder named fastboot, instead en adb folder U mentioned in step 2
Im feeling stupid asking so basic things but I prefer to ask and not cry later
Thanks
ErnestoD said:
Hi Im desperatte trying to root my ATT HTC ONE X with 1.5 using this method http://forum.xda-developers.com/showthread.php?t=1709296
I found this tutorial and I dont know if could work.
I have one big question: After i extracted the file in step one I get a folder named fastboot, instead en adb folder U mentioned in step 2
Im feeling stupid asking so basic things but I prefer to ask and not cry later
Thanks
Click to expand...
Click to collapse
No worries, mate. Fastboot folder contains both fastboot and adb commands, so all you have to do is open command prompt in it (something like C:/fastboot/) and then type commands.
Beforehand, you must have htc drivers installed, and the phone connected, of course.
Also, beware that this forum is for International One X with Tegra 3, so be careful with instructions found here.
Thanks man.
I undestood what u said.
My problem is with the fisrt command I should write in the root proccess: adb shell rm /data/data/com.redbend.vdmc/lib/libvd*
I copied SU as stated, then typed adb shell and then rm /data/data/com.redbend.vdmc/lib/libvd* . here I get notification about missin file or folder.
The thread Im in is: http://forum.xda-developers.com/showthread.php?t=1709296
Do U understant what should I do or. If Im missing something
Thanks
[email protected]|-|oR said:
No worries, mate. Fastboot folder contains both fastboot and adb commands, so all you have to do is open command prompt in it (something like C:/fastboot/) and then type commands.
Beforehand, you must have htc drivers installed, and the phone connected, of course.
Also, beware that this forum is for International One X with Tegra 3, so be careful with instructions found here.
Click to expand...
Click to collapse
Where did you extract your fasboot/adb commands? Is SU in the same folder? Where do you open your command prompt?
Again, I'm no expert in AT&T One X, but fastboot/adb should be the same.
I suggest you open Windows Explorer, go to your fastboot/adb folder, press SHIFT, and right click your mouse.
Select "Open command window here".
Then type "adb devices" (make sure your phone is connected with USB cable, and USB debugging is turned on).
If adb sees your phone that's good.
Type dir and see if SU inside the folder.
Then follow the steps you should.
I hope this helps.
yes It has worked . Thanks man.
So now I know Im at least oriented. Lets see If I receive more help in the root thread Im talking about.
Thanks one more time
[email protected]|-|oR;40510609]Where did you extract your fasboot/adb commands? Is SU in the same folder? Where do you open your command prompt?
Again, I'm no expert in AT&T One X, but fastboot/adb should be the same.
I suggest you open Windows Explorer, go to your fastboot/adb folder, press SHIFT, and right click your mouse.
Select "Open command window here".
Then type "adb devices" (make sure your phone is connected with USB cable, and USB debugging is turned on).
If adb sees your phone that's good.
Type dir and see if SU inside the folder.
Then follow the steps you should.
I hope this helps.[/QUOTE]
It's alright, mate. That's the whole spirit of XDA.
Take care of you and of your One X, mate! :good:
Thanks
Woot Saved me
Thanks

[GUIDE] Internal Memory Data Recovery - Yes We Can!

This method does not seem to work on newer phones that apply TRIM or some other type of partition clearing implementation. If anyone has recovered their data on a device newer than Android 4.3 please pm me and let me know.
The Preamble
Did you delete all your SDCard data?
Are you pissed because no one told you before you unlocked your bootloader what would happen?
Did you lose valuable pictures of cats doing wondrously funny things? :laugh:
Well now there's a convenient new way for you to get that data back Buckaroo!
The Problem
Internal Memory doesn't mount as a drive like external memory does. External memory would allow you to use data recovery tools that scan for deleted files and return them to a usable state. These tools work because most operating systems don't go through and set all of those 1's and 0's to just 0's when you delete a file. Usually the operating system will just delete the reference pointer in the index that says that a file exists with such-and-such name and it's located at this position on the hard disk / memory location. There are destructive delete tools out there that will overwrite the spot of a deleted file multiple times to discourage recovery in just this manner. The issue is that data recovery tools need an actual mounted drive in order to dig deep and unearth those funny pictures of cats you so tragically deleted by accident. These newest batches of phones don't have external SDcards which are super easy to mount as drives. Internal memory mounts as MTP/PTP which is not treated as a mounted drive and cannot be scanned by these data recovery tools. But, cry no more cream-puff! :crying:
The Process
My phone is the Samsung Galaxy Nexus (toro) though I imagine this should work for ANY phone with Internal Memory. We will be using a Windows 7 machine to:
back up the entire internal memory partition to your computer as a single, massive .RAW file,
convert the .RAW file output to a VHD,
mount the VHD as a disk in Disk Manager,
scan the attached VHD volume for files that have been deleted and recover them,
?
profit! :good:
The Requirements
A rooted Android phone, (try to root with a non-destructive method as this appears to protect those who must root from wiping the device data a second time),
BusyBox installed on your device,
Cygwin installed to [c:\cygwin] with pv and util-linux from the repo. Make sure to open Cygwin once to make sure that the /bin folder is created. Also, I made a folder at [c:\cygwin\nexus] to put the exported .RAW file,
Netcat (download the ZIP file and extract nc.exe to [c:\cygwin\bin]),
ADB (make sure adb.exe is in your path),
USB Debugging enabled on your device,
VHD tool from the mighty M$. Put the VhdTool.exe file in [c:\cygwin\nexus],
Piriform Recuva or your favorite data recovery tool, (it appears Recuva only finds the more common file types like images, videos, etc. Those were the file types in which I was interested. If you are after more exotic file types perhaps you might share the software you used.)
A calm sense of peace and serenity that you will get your files back... :fingers-crossed:
The Work
*****Based on the number of people having trouble with this step it is now my recommendation that you choose to recover your entire memory block instead of just the data partition. In my phone's case that is mmcblk0. Please discover if yours is different.***** Identify which block/partition you want to recover. For our purpose here we are seeking to recover the userdata partition: /dev/block/mmcblk0p12
Turn on your phone
Connect the phone in ADB mode
Unlock the screen.
Open a Cygwin terminal and enter (This assumes your BusyBox installation is at [/system/bin/busybox]. It may be at [/system/xbin/busybox]):
Code:
adb forward tcp:5555 tcp:5555
adb shell
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0p12
Open another Cygwin terminal and enter:
Code:
adb forward tcp:5555 tcp:5555
cd /nexus
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0p12.raw
Run around the house a few times. For 32GB internal memory this is going to take 3+ hours. That's a lot of running. When it's done...
We need to convert the .RAW file to a virtual hard drive. VhdTool.exe basically just puts a VHD footer on the end of the .RAW file. Open a Windows command prompt, go to [c:\cygwin\nexus], and type:
Code:
VhdTool.exe /convert mmcblk0p12.raw
Now we need to mount the VHD in Windows. Select the Start button-->right-click Computer-->select Manage.
Select Storage-->Disk Management.
In the menu select Action-->Attach VHD.
For Location enter [c:\cygwin\nexus\mmcblk0p12.raw] and select the OK button.
Right-click on the name (e.g. "Disk 1") to the left of the Unallocated space and select Initialize Disk.
Select the GPT (GUID Partition Table) radio button and select the OK button.
Right-click on the Unallocated space and select New Simple Volume...
In the Wizard select Next>, leave the default for the volume size, select Next>, select a drive letter (e.g. K), select Next>, MAKE SURE to select the 'Do not format this volume' radio button, select Next>, select Finish.
A box will pop up asking you to format the drive. You DO NOT want to format the drive at this time.
Right-click on the RAW space and select Format... MAKE SURE to change the File system to FAT32. Set the Allocation unit size dropdown to 'Default.' MAKE SURE that the Perform a quick format checkbox is CHECKED. You do not want to overwrite the entire new drive with all zeroes (0's) and destroy your data. Quick Format means that it will only attempt to destroy the index for the drive by establishing a new index. Without this box checked the Windows operating system will write zeroes (0's) across the entire volume, potentially destroying your data. Select the OK button.
A box will pop up saying that Formatting this volume will erase all data on it. That would be doubly true if you actually didn't check the 'Perform a quick format' checkbox. Double check that you actually did check the box and select the OK button. (Don't worry. This essentially leaves the volume in the exact same state that your phone's internal memory is living in right now: there is data on the drive...you just can't see it. It's coming back, I promise!)
Open the Piriform Recuva application. In the wizard select the 'Next >' button. Select the 'Other' radio button and select Next >. Select the 'In a specific location' radio button and enter: k:\ (assuming K is the drive letter you chose...) Select the Next > button. Select the Enable Deep Scan checkbox. This is the magical setting that finds files that have been deleted...but not really deleted. Select the Start button.
The application may take about an hour to do the 'Deep Scan.' It's time for more laps around the house! Once the application has returned its results you can choose which files to recover using the checkboxes. Select the 'Recover...' button and choose the location to which you wish to output your files.
?
Profit! :victory:
The Appendix
The following links helped me to create this modern marvel - mad props to scandiun! :
[GUIDE] How to make a nandroid backup directly to your computer without using sdcard
[Info] List of Samsung Galaxy Nexus GT-I9250 devices and partitions
How to Create and Attach a Virtual Hard Disk in Windows 7
Good luck!
I forgot to mention, but run commands inside android as superuser or may fail (just after adb shell):
Code:
adb forward tcp:5555 tcp:5555
adb shell
[B]su[/B]
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0p12
And greetings for the guide, I didn't know of VHD Tool, congratulations!.
Great Work
scandiun said:
I forgot to mention, but run commands inside android as superuser or may fail (just after adb shell):
Code:
adb forward tcp:5555 tcp:5555
adb shell
[B]su[/B]
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0p12
And greetings for the guide, I didn't know of VHD Tool, congratulations!.
Click to expand...
Click to collapse
Good and informative tutorial indeed. Thanks though.
Good point...
scandiun said:
I forgot to mention, but run commands inside android as superuser or may fail (just after adb shell):
Code:
adb forward tcp:5555 tcp:5555
adb shell
[B]su[/B]
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0p12
And greetings for the guide, I didn't know of VHD Tool, congratulations!.
Click to expand...
Click to collapse
Thank you again scandiun
You may be right about the superuser command: su
For my part I did not have to use it but I'm sure it wouldn't hurt to run as su. Some systems may actually need it though.
Here's hoping...
oliverpowell said:
Good and informative tutorial indeed. Thanks though.
Click to expand...
Click to collapse
Thank you oliverpowell
I just hope the people who need this actually find it before they give up and start overwriting their lost data. Even having to get root access may cause a certain amount of data loss for some. Thankfully I was already rooted and already had busybox....
YOU..
YES YOU....!!!!!
WHERE HAVE YOU BEEN ALL MY LIFE?
s*it mate, i wish this thread comes earlier...
i lost my precious files on sdcard about 3 months ago when unlocking bootloader.
um..
anyway do you have any idea how to make files from computer back to internal memory,
but without changing the date modified timestamp?
i'm using adb push for that, but that's painfuly slow..
while mtp transfer messed up the date modified.
thanks, bookmarked.
just in case i do something stupid next time..
Not many options...
marhensa said:
um..
anyway do you have any idea how to make files from computer back to internal memory,
but without changing the date modified timestamp?
i'm using adb push for that, but that's painfuly slow..
while mtp transfer messed up the date modified.
Click to expand...
Click to collapse
I'm afraid painfully slow is probably the only option, just like my step that takes three hours. Start it and go build a birdhouse or window box for flowers....it's going to take a while.
I'm sorry you lost files. It's very sad to hear some of the stories of people losing pictures of their children's birth, or the last pictures of their husband going to Afghanistan... and not returning.
I'm hoping that this approach or one like it can be made popular. It needs to get out there.
I've also linked this thread and scandiun's thread in the second post of this sticky thread.
Nice!
efrant said:
I've also linked this thread and scandiun's thread in the second post of this sticky thread.
Click to expand...
Click to collapse
It looks good! Thank you.
Thanks for this tutorial. :good: It worked as indicated. I just wish I knew earlier as I had been trying for the past few days to use recovery tools and trying to make the internal drive USB Mass Storage capable when all this time there was this tutorial. Unfortunately, it only returned a dozen photos. Thanks again for this tutorial... this should be spread across xda forums for any others running into these issues.
xda_toronto said:
Thanks again for this tutorial... this should be spread across xda forums for any others running into these issues.
Click to expand...
Click to collapse
Agreed - lol
Firstly, I only recently created this guide. I'm sorry you lost files
Secondly, I attempted to link to older threads that mention the same issue so that they would be more likely to show up in a future Google search but I was scolded for waking up old threads, which makes sense. I just thought this was a rather seriously important issue that deserves a lot of eyes. Loss of personal photos is a little more significant than troubleshooting a bad ROM flash, IMO. But the Mod correctly canceled those other posts. It is a little douchey to try to increase a post count by linking all over to a single (my first, really) post. However, I couldn't give less of a pbbbttt about post counts. If you don't mind me asking, how did you find this thread?
Lastly, if you add it to your sig then this will show up on all of your posts...just sayin'...
I'm glad it at least helped you get 12 pics back...
Proplem
Sir .. I'm facing problem .. it won't receive any data from 5555 port .. I tried to make it copy the RAW file but it stopped without getting any data .. is that normal ?? see the picture attached
{
"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"
}
I have a question. Let's say we don't want somebody to ever use this guide to recover our stuff after we sell them a phone. What's the most secure and thorough way to destroy all data on the Gnex, making it impossible to recover, short of destroying the phone?
Med1a said:
Sir .. I'm facing problem .. it won't receive any data from 5555 port .. I tried to make it copy the RAW file but it stopped without getting any data .. is that normal ?? see the picture attached
Click to expand...
Click to collapse
i have the same problem
A couple things from you screenshots...
Med1a said:
Sir .. I'm facing problem .. it won't receive any data from 5555 port .. I tried to make it copy the RAW file but it stopped without getting any data .. is that normal ??
Click to expand...
Click to collapse
Did you try without using su command? Also where is busybox installed? /system/bin or /system/xbin?
CADude said:
I have a question. Let's say we don't want somebody to ever use this guide to recover our stuff after we sell them a phone. What's the most secure and thorough way to destroy all data on the Gnex, making it impossible to recover, short of destroying the phone?
Click to expand...
Click to collapse
If you use the erase command in fastboot, it should work (i.e., "fastboot erase userdata"), otherwise, flashing the stock userdata image will do the trick (i.e., "fastboot flash userdata userdata.img") <-- this writes a blank image in the userdata partition.
...well, that's a good question!
CADude said:
I have a question. Let's say we don't want somebody to ever use this guide to recover our stuff after we sell them a phone. What's the most secure and thorough way to destroy all data on the Gnex, making it impossible to recover, short of destroying the phone?
Click to expand...
Click to collapse
I would imagine you could do this guide, use a Guttman algorithm wipe utility on the attached VHD and then figure out a way to push the entire VHD back to the phone. Unfortunately, that may not actually overlay the physical phone memory in the same way. Perhaps you could wipe the VHD again and push it again, and then again...?
I want to say that someone asked the question on scandiun's post too. Go see if they figured out how to push back to the phone.
Good luck
Wartickler said:
Did you try without using su command? Also where is busybox installed? /system/bin or /system/xbin?
Click to expand...
Click to collapse
busy box installed properly in the right directory
su command used
Med1a said:
Sir .. I'm facing problem .. it won't receive any data from 5555 port .. I tried to make it copy the RAW file but it stopped without getting any data .. is that normal ?? see the picture attached
Click to expand...
Click to collapse
hetunandu said:
busy box installed properly in the right directory
su command used
Click to expand...
Click to collapse
When running su check on phone that permissions are granted. Furthermore using absolute paths is for when you are running it from clockworkmod recovery. If the phone is powered on you can use
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
nc -l -p 5555 -e dd if=/dev/block/mmcblk0p12
Open another Cygwin terminal and enter:
Code:
adb forward tcp:5555 tcp:5555
cd /nexus
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0p12.raw
If you are still having problems you can try the command within the phone only and see if dd works:
Code:
adb shell
su
dd if=/dev/block/mmcblk0p10 of=/dev/null
Also, make sure you run all the commands in the two terminals each time and in the proper order, if you are not sure cancel with Control+C and close them and restart again.
For those who want to try backing up the partition via wifi, you can send it via ftp. Read this post:
http://forum.xda-developers.com/showthread.php?p=27793062#post27793062
Don't use su...?
hetunandu said:
busy box installed properly in the right directory
su command used
Click to expand...
Click to collapse
Please try no su exactly as in the first post.
Did you follow the steps exactly? I can only say they worked for me ):
What phone do you have?

[Q&A] [BOOT-ON-CHARGE] LG Pro Lite D680 - Developer help needed.

Q&A for [BOOT-ON-CHARGE] LG Pro Lite D680 - Developer help needed.
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for [BOOT-ON-CHARGE] LG Pro Lite D680 - Developer help needed.. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!
JoseVigil said:
LG Pro Lite D680
{
"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"
}
Boot On Charge
Non-generic feature for commercial purposes
URGENT NEED! - WILL DONATE​
What we need:
I am looking for an urgent solution to boot-on-charge LG D680 cell phone, I am asking for help to developers who have experience on this area. The subject is related to unlock the bootlaoder, fastboot and custom rom. I understand the task is not simple, I am looking forward to donate whoever hacks the non generic feature.
What we do:
We provide video service through LG D680 cell phone (Also known as LG Pro Lite D680), the phone has 3G connection and is plugged to the power supply when is working.
Problem:
Most of the day the phone is plugged and working properly, however when the weekend comes the cell phone is unplugged and the energy is completely consumed. Currently, when the power is back to the cell phone we need to start the cell phone MANUALLY by pressing the power on button.
Goal:
We need the phone to be booted into the OS automatically when is plugged into the power USB cable (the phone initial status is powered off).
Possible Solutions / Alternatives:
Unlock the bootloader and run fastboot command fastboot oem off-mode-charge 0.
Continue our research, based on the steps described below (see LG D680 experience)
Replace charge animation with boot file command /system/bin/reboot (see Huawei experience below replacing ipod file).
Finding a custom ROM that already contains a Boot on Charge behaviour.
Finding a custom ROM that at least has “Power On Schedule” feature (AOSP certificate permissions level).
Finding a generic Android vestion with “Power On Schedule”.
Cellphone specifications:
PLATFORM
OS - Android OS, v4.1.2 (Jelly Bean), upgradаble to v4.4.2 (KitKat)
Chipset - Mediatek MT6577
CPU - Dual-core 1 GHz Cortex-A9
GPU - PowerVR SGX531
Previous work and research:
We did this "boot on charge" research in two types of cell phones. One is HUAWEI G730 and the other is LG D680. Fortunately, it worked fine in G730, but we haven’t the same results up to now on LG D680.
In Huawei G730, we replaced charging animation located at /system/bin/ipod with an ipod file containing “/system/bin/reboot” and worked like charm!
LG D680, we could not find the animation file, but we found that it might be inside the boot image. We did some research in order to modify it, but we got blocked (someone might continue our steps if useful).
HUAWEI G730 Extended Procedure:
Since this phone has a Mediatek chipset, the “battery animation” app is running on /system/bin folder. Is running with the filename ipod. The main task is to exchange ipod content (which is originally binary) to an ipod file with this content: /system/bin/reboot.
So, create a brand new file called ipod, and wrote the line in there. We transferred the file to the phone via adb push, as shown in next steps below.
Copy procedure: So, we set our phone to USB Debugging Mode, then we connected it to the PC, and run the following script:
adb shell mkdir /storage/sdcard0/carga/ (We created a folder to store files being pushed from the PC to the phone)
adb push ipod /storage/sdcard0/carga/ (We are pushing the file to the storage folder within the phone)
adb shell "su -c 'mount -o rw,remount -t ext4 /dev/block/mmcblk0p5 /system'" (This step is very important, here we remount the /system folder with read-write permissions. Only doing this we will be able to copy programmatically the “hacked” file ipod to /system/app. Look out that we used mmcblk0p5 because the system folder is mapped there in this phone. You can check this running cat /proc/dumchar_info)
adb shell "su -c 'chattr -i /system/bin/ipod'" (doing this we took out immutability to the original file ipod)
adb shell "su -c 'cp /system/bin/ipod /storage/sdcard0/carga/ipod.old'" (just creating a backup file from the original ipod)
adb shell "su -c 'rm /system/bin/ipod'" (here we are removing original ipod file)
adb shell "su -c 'cp /storage/sdcard0/carga/ipod /system/bin/'" (now we copy the new file ipod to the destination folder)
adb shell "su -c 'chmod 755 /system/bin/ipod'" (change the permission ro rwx-rx-rx)
adb shell "su -c 'mount -o ro,remount -t ext4 /dev/block/mmcblk0p5 /system'" (we remount the /system folder with read-only permissions)
adb shell "su -c 'reboot'" (Finally we reboot the phone)
RESULT: Whenever you plug in the phone to the charger when it is off, it will try to boot on the battery animation, but instead, it will be redirected to a “reboot” command, which in turn will be redirecting execution to the O.S.
LG D680 Procedure:
We found that this phone also has a Mediatek chipset. Moreover, it also has a file called ipod within /system/bin. But in this case, the bootloader image doesn’t call ipod whenever it displays the battery animation. So we had to check where is mapped the boot image on the phone by executing adb shell "cat /proc/dumchar_info". As the picture shows, the boot image (bootimg) is mapped in /dev/block/mmcblk0, from offset 0x1200000, and with size 0x900000.
We tried the following steps, in order to test if we were able to download / upload booting without bricking the phone:
We copy bootimg partition to boot.img by doing adb shell "su -c dd if=/dev/block/mmcblk0 of=/storage/sdcard0/boot.img bs=1024 skip=18432 count=9216’. (Skip and Count are measured on KBytes, and those values are offset and size translated from hexa to dec).
Then we did the inverse operation by executing: adb shell "su -c dd if=/storage/sdcard0/boot.img of=/dev/block/mmcblk0 bs=1024 seek=18432”
RESULT: The phone WASN’T bricked, and reboot normally (obviously without any change on bootimg).
Because these steps worked, we went even further, this time by unpacking and repacking boot.img file. The steps done were:
Same as (b)
We pulled boot.img file from the phone to a folder within the PC, and then we unpacked the image with bootimg.exe as the picture shows below. One interesting fact is that the pulled file sized almost 9MB.
Then we repacked it without any change inside the image, as the picture shows below. The “repacked” image is now on file “boot-new.img”, but its size is almost 7.4MB. We don’t know why we have this difference.
Same as step (ii) on (b).
RESULT: The phone resulted in a SECURITY_ERROR. It is weird because we didn’t change anything. We didn’t tried further since we are not able to unpack-repack the same image, and loading it successfully.
FastBoot Note LG:
Fastboot is a solution performing these commands, the problem is that the bootloader is locked for these operations on the generic vesion:
fastboot oem unlock
fastboot oem off-mode-charge 0
fastboot oem lock
fastboot reboot
The command "adb reboot bootloader" does not enter on fastboot upon reboot. There seems to be an opened option while booting on "Download Mode". What I did find out is that when you go into "Download Mode" a new ADB Device is detected on my computer however no driver matched the device. I assume fastboot could be avilable on Download Mode. I have been suggested by romulocarlos to Install the drivers on LG's website however did not work out.
Conclusion:
We have reached this spot and need help from more advanced hackers. As you guys can see, we have been working hard to trying to hack the boot-on-charge feature on the D680 however has not been yet possible. There is no precedent on this phone on custom CWM & TWRP and custom roms yet therefore the is no out of the box solution as on many other phones (i.e. cyanogen list). We have also tried XDA University practices with no results.
I am ready to donate whoever would help us in solving this problem, its an urgent matter that needs to be solved as soon as possible. I will reward a developer by making a donation.
Appreciate very mcuh the help in advance and reading.
Best,
Jose
Click to expand...
Click to collapse
Hello JoseVigil! I own Frelader PD20 (FD20LT81) android 4.0.4 problem with editing files ipod Can you help? Access can give teamviewer comp+usb+device
Ajeris said:
Hello JoseVigil! I own Frelader PD20 (FD20LT81) android 4.0.4 problem with editing files ipod Can you help? Access can give teamviewer comp+usb+device
Click to expand...
Click to collapse
Hi. To modify the ipod file located at /system/bin you will need root access. Once that please check the post, you need to replace the animation with a text file containing "/system/bin/reboot".
Am I answering your question?
Thanks,
Jose

[Linux] Jiayu S3 instructions setup adb

Credits
-to be expanded with other member input
vampirefo - for help with Linux and adb
Introduction
This is meant to be a step by step instruction for new to Linux users on how to set up adb with a Linux PC and
our Jiayu S3 device. Fastboot will be a separate thread. Windows users may find this thread useful?
http://forum.xda-developers.com/showthread.php?t=2266638
This is not meant to be a tutorial on how to use adb. adb is a powerful tool and so do so at your own risk.
In code boxes, they act the same as Android $ = non-root user # means you are root.
Linux PC preparation.
How to Install adb?
Use your package manager to check for it. I am running XFCE desktop variant of Ubuntu 64 bit
which is called Xubuntu. XFCE has smaller packages than say the KDE variant.
So I will give *buntu style instructions but offer other distro advice.
Open your software manager and search for "android-tools-adb" without the quotes please.
Some distros call it android-tools.
{
"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 you have a Debian/*buntu style based distro you can also check if its installed in a terminal like this
Code:
$ dpkg -l | grep adb
No response means its not installed.
Most modern distros allow you copy and paste commands from your web browser to a terminal. Some use pull down menus
otherwise highlight the command and in the terminal push down the wheel mouse.
If you have no wheel mouse press down both left and right buttons at the same time.
If its not installed use your manager to install it or use a terminal command to install it such as
Code:
$ sudo apt-get update (input your login password)
sudo apt-get install android-tools-adb
2) Are you a member of the adb users group?
Actually I don't care as we will make a udev rule that will give us root powers.
3) Jiayu specific adb usb driver?
Linux does not use such a beast but we still need some way of communicating and we use software called udev.
Udev should be installed for 90% or more of all major Linux distributions (distros) but I know of some exceptions
such as Tinycorelinux and Linuxfromscratch. Not all distros aim to be general purpose so there is no shame if udev is not installed.
If udev is not installed then install it ---easy yes?
We create a file that udev can use called.....with contents as per quote box
/etc/udev/rules.d/55-jiayu.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="666", GROUP="plugdev
Click to expand...
Click to collapse
copy and paste contents into a root powered text editor and save the file as ....the file name nominated please.
If you don't know the name of your text editor etc you can try a command
Code:
sudo echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="666", GROUP="plugdev" ' > /etc/udev/rules.d/55-jiayu.rules
But we might as well use a command to add our phone to the ini file a text file in a dot folder under home directory
This does not need a sudo command as we own this file
Code:
echo "0x0bb4" > .android/adb_usb.ini
4) Restart udev for Ubuntu style distros with
Code:
$ sudo service udev restart
(output is )udev stop/waiting
udev start/running, process 2116t
for some distros,
Code:
$ sudo udevadm control --reload-rules
Other phones can share the same Vendor ID. This is because of the contents of files included in the boot image,
called init.usb.rc with contents including this line
setprop sys.usb.vid 0BB4
Click to expand...
Click to collapse
You may notice that I have used lowercase 0bb4 in my rules file and it works fine.
Note some distros do not use sudo to gain root power commands. They would instead run a command like this
Code:
su - (input root password)
udevadm control --reload-rules
5) Android Preparation
We need a data cable usb.
6) We need to ensure that root has been activated in our device. Check it with
Settings -> Security -> Superuser is on (green slider)
7) We need USB debugging we check it by turning on developer mode by
Settings -> about phone -> Tap build number about 7 times
Go into new menu
Settings -> Developer Options -> Debugging -> USB debugging turn on (green slider)
8) Our phone boot image contains default.prop which contains this line
ro.adb.secure=1
This means Android will require authorization before adb will work on Linux
This same section at (7) has a config for Revoking previous authorizations for USB debugging,
if you have changed computers.
Lets Do It!
9) Connect cable between our phone and PC
10) On phone choose option USB storage.
11) You should now see a popup on your phone seeking authorization to continue.
I prefer you click the box so you don't have to see this popup again and click OK
12) Now back to Linux in the terminal start the adb action with a command as a non-root user
Code:
adb devices
You must see this image.
13) If you see below image, I have failed you. Re-check you have completed all steps
post your distro and we shall see if I can help you, or others.
Don't forget to restart udev if you need to change an udev rule and KILL adb with
Code:
adb kill-server
before trying again
Reasons may include
a) You have not enabled USB debugging on phone
b) You have not authorized PC
c) Your Linux udev rule contains an error
d) You did not choose USB storage on connection
14) Linux PC and phone usb storage enabled....gives file manager access to sdcard (/storage/sdcard1)
so its not available to adb at the same time,
--we can write files to internal storage.
15) Alternatively, on phone do NOT turn off usb storage but un-mount the storage you see in Linux.
This is a cheap trick I learnt. It is intended only if you need to write files from PC to sdcard,
while adb is running. If you are only pulling files from /system etc then ignore my advice.
########################################
This is not a tutorial on all adb commands.
Run command
Code:
adb --help
(to see help in the terminal)
Example of adb
Code:
$ adb shell su -c "dd if=/dev/block/platform/mtk-msdc.0/by-name/boot of=/storage/sdcard1/boot.img"
32768+0 records in
32768+0 records out
16777216 bytes transferred in 2.508 secs (6689480 bytes/sec
Nice explanation.
Only thing missing is running lsusb to find the VendorID that the phone is using, as it might be different with custom ROMs
HypoTurtle said:
Only thing missing is running lsusb to find the VendorID that the phone is using, as it might be different with custom ROMs
Click to expand...
Click to collapse
Really? I see 0bb4:0c03 vendor (HTC?): product for my 'stock' S3S 3GB/NFC. Other funky 'custom' results out there? Also, where would this value be altered in custom ROM?
---------- Post added at 02:19 ---------- Previous post was at 02:15 ----------
Nofan Tasi said:
Really? I see 0bb4:0c03 vendor (HTC?): product for my 'stock' S3S 3GB/NFC. Other funky 'custom' results out there? Also, where would this value be altered in custom ROM?
Click to expand...
Click to collapse
sorry to (attempt to try to) answer my own question:
vendor/product might be set in init.usb.rc from kernel ram disk.
# grep -i 0bb4 /init.usb.rc
setprop sys.usb.vid 0BB4
# grep -i 0c03 /init.usb.rc
write /sys/class/android_usb/android0/idProduct 0C03
write /sys/class/android_usb/android0/idProduct 0C03
and indeed
# getprop sys.usb.vid
0BB4
# cat /sys/class/android_usb/android0/idProduct
0c03
# cat /sys/class/android_usb/android0/idVendor
0bb4
yours and/or others mileage may vary though ... let us know!
Nofan Tasi said:
Really? I see 0bb4:0c03 vendor (HTC?): product for my 'stock' S3S 3GB/NFC. Other funky 'custom' results out there? Also, where would this value be altered in custom ROM?
---------- Post added at 02:19 ---------- Previous post was at 02:15 ----------
sorry to (attempt to try to) answer my own question:
vendor/product might be set in init.usb.rc from kernel ram disk.
# grep -i 0bb4 /init.usb.rc
setprop sys.usb.vid 0BB4
# grep -i 0c03 /init.usb.rc
write /sys/class/android_usb/android0/idProduct 0C03
write /sys/class/android_usb/android0/idProduct 0C03
and indeed
# getprop sys.usb.vid
0BB4
# cat /sys/class/android_usb/android0/idProduct
0c03
# cat /sys/class/android_usb/android0/idVendor
0bb4
yours and/or others mileage may vary though ... let us know!
Click to expand...
Click to collapse
Yea, init.usb.rc. Most custom recoveries would use the generic 0bb4 value. I think it's just the default number that the driver uses. Generic/Stock MTK should be 0e8d.
HypoTurtle said:
Most custom recoveries would use the generic 0bb4 value. I think it's just the default number that the driver uses. Generic/Stock MTK should be 0e8d.
Click to expand...
Click to collapse
0bb4 is HTC see http://developer.android.com/tools/device.html#VendorIds

Categories

Resources