HOWTO: ADB over USB A-A cable (switching host to client mode) - A7 General

Here's how I hooked my A7 to my PC over USB and successfully used the ADB shell with it.
I hooked up a USB A-A cable first.
Then, on the device I used root explorer to make the following changes to /system/etc/usbotg.sh
#!/system/bin/sh
cat /proc/test_program/serial > /data/data/sn
if [ -f /data/data/com.android.providers.contacts/databases/contacts2.db-journal ]; then
echo "-------------------- Error journal, remove it -------------------"
rm /data/data/com.android.providers.contacts/databases/contacts2.db-journal
fi
sleep 1
# echo on > /sys/devices/platform/tegra-ehci.1/usb2/power/level #disable it to avoid suspend/resume fail # this was already disabled
#echo 10 4b a0 e4 07 00 > /proc/test_program/ecctl # not sure what this was for, had disabled it during testing
#echo on > /sys/devices/platform/tegra-ehci.0/usb1/power/level # not sure what this was for, had disabled it during testing
echo 0 > /proc/test_program/usb # set slave mode (set to 1 for host only mode)
#done
I used root explorer to mount the partition as r/w, and backed up the file, and set the backup as a+x (if i run that file manually, it switches the usb port back to host).
I also installed the android sdk pack, plus the google driver pack addon.
I applied the changes described at tegradeveloper.nvidia.com/tegra/forum/faq-where-can-i-find-usb-drivers to the driver inf file.
I rebooted my android device, and plugged it into my pc. Following the instructions in the above link I manually specified the device type.
The end result?
C:\Program Files (x86)\Android\android-sdk-windows\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
02804145421f6397 device
C:\Program Files (x86)\Android\android-sdk-windows\platform-tools>
C:\Program Files (x86)\Android\android-sdk-windows\platform-tools>adb shell
# ls
ls
config
misc
cache
acct
sdcard
storage
mnt
d
etc
system
sys
sbin
proc
init_recovery.rc
init.rc
init.goldfish.rc
init
default.prop
data
root
dev
#
I hope someone finds this useful.

This is great! I seriously can't wait to get my A7 in the mail. This will make modding alot easier!!!
A big thank you!

That's great news! Does it charge while plugged in?

Afraid not, but then again I didn't expect it to.

Moved to general as not android development

greenaar
Did you restart elocity every time when you switched host-mode?
I successfully connected my A7 to PC via adb (but notice, when device went sleep it turned off usb too)
And i go back only if i change script and restart

tjc2k4 said:
That's great news! Does it charge while plugged in?
Click to expand...
Click to collapse
Uses 19+ volts to charge. Usb is only 5 volts

did you have anymore definitive success or recommended instructions for enabling adb over usb on the elocity?
i've tried;
echo 0 > /proc/test_program/usb
which did seem to disable hosting/my thumb drive quit detecting, but could never get adb. android never seemed to like the script at all.
thanks for any response.

Didn't the otg_USB apk work for you???

@acid123; i've never seen a otg_usb.apk. the script seemed entirely unsuccessful for me, if thats what you mean, and appears to be based on an older file, as the new script doesn't exactly look like the one posted. i chose to try the scripts line by line mostly w/ errors, but it looks like i'll revisit the script again.

Related

Root Method for 2.2

This is copied from the Droid2 section and is said to work on the X for those of us that didnt move SU b4 updating to 2.2 or those that lost root for whatever reason.
Cool How to root the Droid 2
All credit goes to Sebastian Krahmer at http://c-skills.blogspot.com/. Please see fit to donate via Paypal to [email protected]
***NOTE: Proceed at your own risk. I and the providers of this code are not responsible for anything you do to your phone!***
Setup:
- Install adb (here) and Motorola drivers for windows(32-bit or 64-bit)
- Download attached archive
- Extract to a directory, I used c:\Droid2Root
- Make sure you have USB degugging enabled
- Change connection to PC Mode
Process:
- Open command prompt
- cd c:/wherever-your-sdk-tools-folder-is
- adb devices (to verify the connection)
- cd c:/Droid2Root
- adb push Superuser.apk /sdcard/Superuser.apk
- adb push su /sdcard/su
- adb push busybox /sdcard/busybox
- adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin
- adb shell
- cd data/local/tmp
- chmod 0755 rageagainstthecage-arm5.bin
- ./rageagainstthecage-arm5.bin
- let the process run until it 'kicks' you out (may take a minute or two)
- cd c:/wherever-your-sdk-tools-folder-is
- adb devices (to verify the connection)
- adb shell (you should now have a # prompt, if not return to ./rage step above)
- mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
- cp /sdcard/Superuser.apk /system/app/Superuser.apk
- cp /sdcard/su /system/bin/su
- cp /sdcard/busybox /system/bin/busybox
- chmod 4755 /system/bin/su
- chmod 4755 /system/bin/busybox
- mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
- exit
- exit
I'm sure there are certain steps that could be streamlined or eliminated, so please feel free to make a suggestion and I'll edit the post.
Additional thanks to @rainabba and AllDroid.org for their excellent Droid X rooting tutorial, which assisted me greatly in this process.
Attached Files
File Type: rar Droid2Root.rar (954.1 KB, 733 views)
Last edited by karnovaran; Yesterday at 01:58 PM.. Reason: Clarity
Reply With Quote
Hello all...
This worked on my DX that I upgraded to 2.2 just fine. The root pw isn't given anywhere in the instructions as it is in the 2.1 manual root steps.
Any thoughts on the root pw so that I can SSH to the device after rooting?
This method worked for me after thru much trial and error I was able to update to Froyo only to discover I lost root. Did not want to roll back to 2.1 and start over. Thanks so much to everyone who came up with root process and to those who discovered it worked on the DX.
I tried intstalling the 64bit drivers (then rebooted) then hooked it up in PC mode and can't seem to get it to show up in the list of attached devices.
Tried uninstalling and reinstalling everything, the one click roots say it can't find my droid X and going through your instructions adb can't find my device ether. I kinda been having a problem with doubletwist where it doesn't recognize my device properly, could that be related?
I don't know why, but after typing ./rageagainstthecage-arm5.bin it showed the text talking about donations, etc went right back to the $ prompt, and never booted me out of shell. I waited 15 minutes at the $ prompt before Ctrl-break'ing out of shell and trying to relogin. noticed adb is repsonding sluggish. Maybe it's still working? Anyone else having this problem?
Edit: I retried the ./rageagainstthecage-arm5.bin command after rebooting the phone and it worked this time. And I'm rooted! Wireless Tether for Root app works perfectly!
Also I notice when I say PC mode the little debugger icon then doesn't show up like it does in USB mode or charge mode. could this be why the device isn't showing up?
Ok so I manage to get everything good up until the point where I should be looking for a # instead of a $ for terminal. I've done the rage and waited till it kicked me out and went back in and got the same result.
The way that I got through my problems is I set the droid x to USB charge only mode (PC mode there was no debugging and every time I plugged it in, it wouldn't take the ADB driver it wanted a MB810 or something driver)
I know I set the permissions right, and it does run (shows up a little message about donating and in a min or so kicks me out, anything else I can try?
Thanks for the help.
mavermc said:
I tried intstalling the 64bit drivers (then rebooted) then hooked it up in PC mode and can't seem to get it to show up in the list of attached devices.
Click to expand...
Click to collapse
You need to turn off USB debugging first time you connect DX to PC and let the drivers install. After the drivers install, turn on USB debugging and let the driver installation complete again. Then go in terminal (also make sure you change directory to where the adb application is) and type in "adb devices". If your device does not show up, change USB connection method to Windows Media Sync mode on DX and try again.
I hope that helps because that is the limit of my knowledge on the subject.
No reboot, battery pull, then reboot = weird!
Okay, so after I rooted my DX, I went to reboot it (powered off then back on) and it got stuck on the M screen. So I pulled the battery, reinserted it, and then powered on again. It rebooted fine. So...why the battery pull?? Anyone??
So i rooted using this method, (finally got it to work, just used it in usb charge mode on a XP machine) Now my phone seems to drop battery like crazy, all I've changed besides the root is install set cpu (and set some profiles to lower the clock with screen off and low battery and hi temp) installed battery life widget and a little white widget that shows what the current clock speed is. oh and wifi teather, any idea why my battery just sucks now? and things like battery info (to show whats using the battery) force closes on me after root, anyone else with these problems?
read-only what? help!!
is it ppossible to do this from the device?
Will this root work on ota froyo upgrade that we will have in a few days?
Sent from my DROIDX using XDA App
Like many have said it works perfectly if you disable the USB Debugging...install all drivers again and then put it in "Charge Mode"
I finally have my phone rooted...Now I know why my Deodex didnt wanna work. Thanks to all for releasing this and ending my headache
Hi all.
Give a try to my version of the instructions. This is kind of like the holy grail of rooting the Droid 2 at the moment. Much clearer! More info! Enjoy!
http://forum.xda-developers.com/showpost.php?p=7865824&postcount=164
dscottjr81 said:
- ./rageagainstthecage-arm5.bin
- let the process run until it 'kicks' you out (may take a minute or two)
- cd c:/wherever-your-sdk-tools-folder-is
- adb devices (to verify the connection)
- adb shell (you should now have a # prompt, if not return to ./rage step above)
Click to expand...
Click to collapse
One thing I found was after it ran and returned to a cursor, I closed the cmd window and relaunched it and had no issues. Before I restarted I did switch to Charge only w/ USB debug active.
It wouldn't work at all for me until I put the contents of the Droid2Root.rar in my /tools folder. The adb commands would not work as soon as I "cd c:/Droid2Root", but the adb commands would work in the /tools folder. So I just put the contents of the Droid2Root.rar in my /tools folder and it worked just fine. O yea I'm on the OTA 2.2 (2.3.15) that came out today. I also did it under "Charge Only" with debugging.
So I take it that the One-Click root will not work withfroyo 2.2 update????
i continuously get the money sign even after it kicks me out from the ./rage step and i kill-server then adb shell.
its still there even after 3 attempts at the ./rage step what should i do? it just wont (#) prompt me

Minimal rooting - back to basics

There are many tools and "Super-Ultra-Mega-Rooters" and things to root your Nook.
They will install 23 different things on your Nook.
If you like them, use them.
What is "rooting"?
At the most basic level, "rooting" is managing to get a root (all-powerful) shell (command line interpreter).
When your Nook is sitting there with a prompt saying # then you are rooted.
Alright, a prompt #, but on where?
On your desktop computer, which has to be linked somehow to your Nook.
The way we link Android devices to desktop computers is with ADB (Android Debug Bridge).
Every Android device has this capability built in, but sometimes it's disabled.
Sometimes they make it easy to enable, sometimes they make it hard.
On the Nook, it's fairly easy because the Nook will boot up off an external SD card.
How to root any Nook
The configuration for the Nook is stored in a filesystem called uRamdisk inside the boot partition.
If we can get a copy of uRamdisk, modify it, then replace the copy in the boot partition we can root.
Copy uRamdisk to the desktop
There are two easy ways to get a copy of uRamdisk:
Put noogie on an SD card, boot up, connect the USB and a disk will appear on your desktop.
This will be the boot partition, copy uRamdisk.
Get the update zip from B&N and unzip it.
They call the file ramdisk.img, but it's uRamdisk.
Modify uRamdisk
You need to extract two files out of uRamdisk then replace them.
There is a utility for Win32 called bootutil.exe in the signature below.
Code:
bootutil /x /v uRamdisk init.rc default.prop
This should say that it extracted two files.
Using an editor you need to edit the two files.
Don't use Windows Notepad (it's miserable and doesn't understand Unix end-of-lines).
Try Notepad++ if you don't have a good text editor.
Comment out a few lines in init.rc (additions in red):
Code:
service adbd /sbin/adbd
[color=red]#[/color] disabled
...
# adbd on at boot in emulator
on property:ro.kernel.qemu=1
[color=red]#[/color] start adbd
on property:persist.service.adb.enable=1
[color=red]#[/color] start adbd
on property:persist.service.adb.enable=0
[color=red]#[/color] stop adbd
You can use ADB over WiFi or USB.
Over WiFi can be easier because you don't need to configure desktop drivers.
As so far modified the ADB would use USB.
If you want it to work over WiFi instead, delete the comment # mark:
Code:
[color=red]#[/color] setprop service.adb.tcp.port 5555
Now a minor modification to default.prop.
Change it so that it reads only (no other lines):
Code:
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
To put these two files back into the desktop's copy of uRamdisk:
Code:
bootutil /v /r uRamdisk init.rc default.prop
This should say that it replaced two files.
Copy uRamdisk to the Nook
Use noogie as in step one and just copy the uRamdisk over the old copy.
Reboot. Make sure that your WiFi is turned on and connected.
Use ADB
Get adb.exe from the Android SDK.
You connect to your Nook using either an IP address or a host name if you defined one in your C:\Windows\System32\drivers\etc\hosts.
Code:
adb connect nook [color=red][i]or whatever you named it[/i][/color]
adb shell
or
Code:
adb connect 192.168.1.2 [color=red][i]or whatever the IP is[/i][/color]
adb shell
Then you will get your # prompt.
You can do whatever you want.
Usually the point of all this is to allow you to modify something in the system.
To do this, you have to "remount" the system partition.
Code:
# mount -o rw,remount /dev/block/mmcblk0p5 /system
The rest is up to you!
Can you release a version of this utility for linux?
nobricks said:
Can you release a version of this utility for linux?
Click to expand...
Click to collapse
In Unix (as always) you can accomplish your purpose by chaining together a half dozen commands with obscure case-sensitive parameters.
I don't know the exact parameters, but the general drift of things is here.
Thanks for pointing me in the right direction.
Did some further searching on the forums and found this post with the proceedure for modifying uRamdisk under linux.
Renate NST said:
Over WiFi can be easier because you don't need to configure desktop drivers.
Click to expand...
Click to collapse
Renate,
Question about NST USB drivers for ADB.
In short: I got 2 NSTs, they do have "slightly" different hardware, I guess. Or might be, internal SD card size is different only?
First was rooted long time ago, and my WinXP see it as ADB device (backup size 1,958,739,968 bytes)
NST modded ADB driver was installed long time ago.
Another one is a bit newer (backup size 1,962,934,272 bytes)
I’ve decided to root second one, followed instruction to the letter.
It was not detected as ADB device, only ADB via WiFi worked.
Apparently, /sbin/adbd was started, but I was not able to adb connect via USB at all, but only via WiFi with following line was uncommented (obviosly):
setprop service.adb.tcp.port 5555
Tried few times, the results are consistent.
Made me think, are there different drivers for "slightly" different NST hardware?
Am I mistaken?
The partitioning on an NST actively uses 1,941,962,752 bytes.
Any capacity over that is unused by the stock partitioning.
The exact capacity of the "2 GB" is varied.
I wrote a note somewhere of 3 different sizes that I have seen.
adbd, the ADB daemon uses either USB or TCP (on the Nook, that's WiFi).
Whether service.adb.tcp.port is defined determines this.
Renate,
Renate NST said:
The partitioning on an NST actively uses 1,941,962,752 bytes.
…
I wrote a note somewhere of 3 different sizes that I have seen.
Click to expand...
Click to collapse
The Q is: Does all 3 use exact same windows driver?
Could you compare your NST Android Composite ADB Interface driver with mine, please:
Google, Inc. | 8/11/2009 | 2.0.10.2
Hardware Ids
USB\Vid_2080&Pid_0003&Rev_0216&MI_01
USB\Vid_2080&Pid_0003&MI_01
The excess size of the internal NAND does not make a difference in anything.
The "ADB driver" is basically a way to tell Windows:
Hey, dude, you don't really know this device but pretend that you do.
It just has a bulk in endpoint and a bulk out endpoint.
Don't worry your little head over what the data is.
Just use the generic driver file C:\Windows\System32\drivers\winusb.sys
And if I feel like using it I'll interface through C:\Windows\System32\winusb.dll
Click to expand...
Click to collapse
And Windows sighs and just does it.
(Well, actually, it's a bit more complicated than that because it creates the Android Device install class.)
Anyway, what was your question?
Then what about adb wireless apps? Do we still need one of those to adb-connect wirelessly? I tried this on a fresh Nook with 1.1.2, and don't seem to be able to connect to the Nook.
If you use ADB over WiFi and if you leave your WiFi on then you have a big security leak unless you are only on a private network.
People use app like ADB Konnect to disable ADB over WiFi.
I prefer just using ADB over USB.
Renate NST said:
If you use ADB over WiFi and if you leave your WiFi on then you have a big security leak unless you are only on a private network.
People use app like ADB Konnect to disable ADB over WiFi.
I prefer just using ADB over USB.
Click to expand...
Click to collapse
Thank you for the advice. Then, if I want to use adb over wifi, but want it to be off (or standby or whatever state that doesn't allow adb connection over wifi) at boot so that it can be toggled on/off later using one of adb wireless apps, what should I do? Is keeping "setprop service.adb.tcp.port 5555" commented sufficient for this?
ADB is only designed to support one transport at a time, USB or WiFi.
Apps that control this have to kill the adbd to have it restart.
If you comment the service.adb.tcp.port out then USB will be used.
Renate NST said:
ADB is only designed to support one transport at a time, USB or WiFi.
Apps that control this have to kill the adbd to have it restart.
If you comment the service.adb.tcp.port out then USB will be used.
Click to expand...
Click to collapse
I've been having a really hard time today attempting to get ADB over USB working on my NSTG 1.2.1. I followed the instructions, but when I do
Code:
adb usb
-OR-
Code:
adb devices
I always get
Code:
error: device not found
Which, of course, means that ADB isn't picking up my Nook as an ADB device.
Can you help?
Use Device Manager (devmgmt.msc) to see if the USB part is working.
See: http://forum.xda-developers.com/showthread.php?p=55428192#post55428192

[Q] Best Backup Solution for ROOTED but LOCKED Nexus 7

Hello Everyone,
I recently Rooted my Nexus 7, but did not Unlock it because as I understand it......Unlocking will wipe my data.
I have tried many backup solutions and I find TWRP to be by far the best, but there is one catch and it's bugging me.
TWRP doesn't backup everything. For example "Internal Storage" aka "SDCARD" aka what ever else android calls the directory to be more confusing lol
I have been trying different things to backup what TWRP doesn't cover and it has just been a long frustrating failure.
MTP is terrible. It can't really be trusted and Windows Explorer becomes unresponsive. It worked better when I selected a few folders at a time but still horrible to trust. However I am open to any suggestions.....maybe there is an MTP Client that is better at handling this than Windows Explorer? I don't know.
ADB Kinda sorta doesn't seem to work with a locked device. Although Holo backup which uses ADB seemed to save a lot to a backup file, it didn't work to restore from it. Even tried unzipping it to see what was in that file but no luck. So I don't know if this means ADB is also hopeless or not.
Airdroid / Wifi File Transfer app also don't work very well with certain directories or major transfer sizes.
Any suggestions would be greatly appreciated. I would really like to be able to do the unthinkable which is recover from a Hard Factory Reset, but I am fine with just being able to save a backup of everything that TWRP won't.
Thanks so much in advance.
External USB and Titanium Backup. You can order a cable to use an external usb on amazon for about a dollar.
What about uploading to cloud storage? Dropbox, drive, etc. Might not work so good for large files though.
Sent from XDA app
Not sure why you created another thread on this issue, but what doesn't work with adb? Adb pull /sdcard will pull everything from your sdcard including your twrp backup.
Adb doesn't care if you have a locked boot loader.
Sent from my Galaxy Nexus
KingVeto said:
External USB and Titanium Backup. You can order a cable to use an external usb on amazon for about a dollar.
Click to expand...
Click to collapse
Thanks I already have one and I been using it for the things I tried above. Mine is just a small adapter no cord.
gc84245 said:
What about uploading to cloud storage? Dropbox, drive, etc. Might not work so good for large files though.
Click to expand...
Click to collapse
That would be ok but as you said not so good for large files. plus i would prefer an offline backup solution to toss on my NAS as well.
Pirateghost said:
Not sure why you created another thread on this issue, but what doesn't work with adb? Adb pull /sdcard will pull everything from your sdcard including your twrp backup.
Adb doesn't care if you have a locked boot loader.
Click to expand...
Click to collapse
Honestly it beats me why I can't get ADB to work. Only reason why I though it was related to my bootloader being locked was because some programs / toolkits I used brought up an error saying that it couldnt connect adb due to locked bootloader.
I can't get ADB working and it has been driving me mad lol. I feel like maybe I am doing something stupid wrong when trying to use an adb command.
At this point I would love a noob guide with screen shots on how to use adb command, the adb command line tool....the works on adb lol.
Screenshots would be a huge help to prove that I am not doing something dumb and that I actually have some issue with adb.
Thanks Everyone.
Code:
C:\Users\pirateghost>adb
Android Debug Bridge version 1.0.31
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <specific device> - directs command to the device or emulator with the given
serial number or qualifier. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices [-l] - list all connected devices
('-l' will also list device qualifiers)
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devices.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
- push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
('--algo', '--key', and '--iv' mean the file is encrypted already)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(<packages...> is the list of applications to be backed up. If
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb get-devpath - prints: <device-path>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list of the following values
1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes priority over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these debug tags are printed.
Code:
c:\temp\gnex>adb pull /sdcard
Using your example except for the directory names being different this is what I would get:
(I am using the names of your directories for simplicity....I know enough that mine would vary lol)
After running adb and entering the command as you did. This is the outcome:
'adb' is not recognized as an internal or external command, operable program, or batch file.
HandyAndyXDA said:
Using your example except for the directory names being different this is what I would get:
(I am using the names of your directories for simplicity....I know enough that mine would vary lol)
After running adb and entering the command as you did. This is the outcome:
'adb' is not recognized as an internal or external command, operable program, or batch file.
Click to expand...
Click to collapse
because you have not set adb to be an environment variable.
browse to where your adb.exe is located
make a new directory called n7
hold down shift and right click in the box somewhere in windows explorer
click on open command window here
then type this:
Code:
adb pull /data/media n7/
/data/media and /sdcard are the same location
Pirateghost said:
because you have not set adb to be an environment variable.
browse to where your adb.exe is located
make a new directory called n7
hold down shift and right click in the box somewhere in windows explorer
click on open command window here
then type this:
Code:
adb pull /data/media n7/
/data/media and /sdcard are the same location
Click to expand...
Click to collapse
OK, did that which made perfect sense.
This is what it outputs:
pull: building file list...
0 files pulled. 0 files skipped.
(That was trying it with /media n7/)
The following is when i tried it with /sdcard:
remote object '/sdcard' not a file or directory
HandyAndyXDA said:
OK, did that which made perfect sense.
This is what it outputs:
pull: building file list...
0 files pulled. 0 files skipped.
(That was trying it with /media n7/)
The following is when i tried it with /sdcard:
remote object '/sdcard' not a file or directory
Click to expand...
Click to collapse
/data/media
/data is the partition, media is the directory
/media is looking for a media directory on the root or /
I usually just run...
Code:
adb pull /mnt /N7backup
Which copies everything to a folder called 'N7backup' onto the root of my C:/ drive in Windows...
But, boy... does it take a while! Seriously, I could be half way through 'War & Peace' by the time it's done! (OK, bit of an exaggeration, but you get my point).
For this reason, I rarely use ADB much... I tend to use MTP to copy select folders over - drag'n'dropping folders... Titanium, TWRP, MyStuff, etc., et.al. But even that takes it own sweet time.
---------------------
The N7 is a great device... but it's crippled by the lack of removable storage (microSD), that I can slip into my laptop, and can copy everything within 5 minutes.
Rgrds,
Ged.
Pirateghost said:
/data/media
/data is the partition, media is the directory
/media is looking for a media directory on the root or /
Click to expand...
Click to collapse
I appreciate you're patience with me and the help.
Do I need to do some connect command before doing any of that?
HandyAndyXDA said:
I appreciate you're patience with me and the help.
Do I need to do some connect command before doing any of that?
Click to expand...
Click to collapse
no. the command is simply
adb pull /data/media /nameoffolderyouwanttosenditto
GedBlake said:
I usually just run...
Code:
adb pull /mnt /N7backup
Which copies everything to a folder called 'N7backup' onto the root of my C:/ drive in Windows...
But, boy... does it take a while! Seriously, I could be half way through 'War & Peace' by the time it's done! (OK, bit of an exaggeration, but you get my point).
For this reason, I rarely use ADB much... I tend to use MTP to copy select folders over - drag'n'dropping folders... Titanium, TWRP, MyStuff, etc., et.al. But even that takes it own sweet time.
---------------------
The N7 is a great device... but it's crippled by the lack of removable storage (microSD), that I can slip into my laptop, and can copy everything within 5 minutes.
Rgrds,
Ged.
Click to expand...
Click to collapse
I agree with the first part but I would like to understand and get ADB going and give it a try myself.
As for the "crippled by lack of removable storage" ..........if you are rooted you can use an adapter to go from the usb port on the nexus to a regular USB port then you can use usb flash drives or any kind of usb storage / card reader whatever. You will need to be rooted / have that adapter / and install an app like StickMount so the device can see the drive and mount it as a directory. This works great.
Thanks
Pirateghost said:
no. the command is simply
adb pull /data/media /nameoffolderyouwanttosenditto
Click to expand...
Click to collapse
This should work but instead right away it outputs this:
pull: building file list...
0 files pulled. 0 files skipped.
GedBlake said:
I usually just run...
Code:
adb pull /mnt /N7backup
Which copies everything to a folder called 'N7backup' onto the root of my C:/ drive in Windows...
But, boy... does it take a while! Seriously, I could be half way through 'War & Peace' by the time it's done! (OK, bit of an exaggeration, but you get my point).
For this reason, I rarely use ADB much... I tend to use MTP to copy select folders over - drag'n'dropping folders... Titanium, TWRP, MyStuff, etc., et.al. But even that takes it own sweet time.
---------------------
The N7 is a great device... but it's crippled by the lack of removable storage (microSD), that I can slip into my laptop, and can copy everything within 5 minutes.
Rgrds,
Ged.
Click to expand...
Click to collapse
Sorry I was replying quick and misunderstood.......yes an actual sdcard would not be something I'd say no to. What would be good too is if you didnt have to use either MTP or PTP.....if it just showed up as a drive
HandyAndyXDA said:
I agree with the first part but I would like to understand and get ADB going and give it a try myself.
As for the "crippled by lack of removable storage" ..........if you are rooted you can use an adapter to go from the usb port on the nexus to a regular USB port then you can use usb flash drives or any kind of usb storage / card reader whatever. You will need to be rooted / have that adapter / and install an app like StickMount so the device can see the drive and mount it as a directory. This works great.
Thanks
Click to expand...
Click to collapse
Oh, don't get me wrong - I wasn't trying to dissuade you from using and understanding ADB... and you should give it a try. Definitely. Both Fastboot and ADB are powerful and useful tools, and IMHO you should learn everything you can about them.
I was just grumbling about the data transfer speeds from N7 to laptop...
HandyAndyXDA said:
...if it just showed up as a drive
Click to expand...
Click to collapse
Yes,Yes,Yes... and thrice times YES!.
Rgrds,
Ged.
GedBlake said:
Oh, don't get me wrong - I wasn't trying to dissuade you from using and understanding ADB... and you should give it a try. Definitely. Both Fastboot and ADB are powerful and useful tools, and IMHO you should learn everything you can about them.
I was just grumbling about the data transfer speeds from N7 to laptop...
Yes,Yes,Yes... and thrice times YES!.
Rgrds,
Ged.
Click to expand...
Click to collapse
I understand and agree completely. And, yes i would love to learn as much as i can. This android stuff is awesome and fun.
Thanks again and I like your attitude
BUMP:
So any last ideas on what could be wrong with ADB not working?
I don't blame you if you are stumped at this point.
PS:
At this point I am desperate, so feel free to even ask me noob questions such as .....Did I connect the device to the computer. I won't be offended you guys are a real help.
HandyAndyXDA said:
BUMP:
So any last ideas on what could be wrong with ADB not working?
I don't blame you if you are stumped at this point.
PS:
At this point I am desperate, so feel free to even ask me noob questions such as .....Did I connect the device to the computer. I won't be offended you guys are a real help.
Click to expand...
Click to collapse
UPDATE:
I tried
adb reboot-bootloader
and that worked so why dont
pull
work?

Root for Xperia Z3 Tablet Compact SGP611 *WORK IN PROGRESS*

OBSOLETE! There are now better ways to root using a proper kernel and TWRP. Please follow this guide instead
http://forum.xda-developers.com/z3-tablet-compact/general/adb-fastboot-drivers-tutorial-t2980529
I am working on root for the stock rom on SGP611 with unlocked bootloader.
So far I have managed to get R/W access to /system and make permanent changes. I have installed an su binary but it is not working properly which I believe is because of selinux restrictions. I can become root in ADB and mount /system writable but apps requiring root fails.
I have not tried to build a custom recovery so installing normal flashable zips is not possible.
This is what I did so far:
Get the firmware files using PC Companion
Extract the kernel using Flashtool and split it into kernel, ramdisk and dtb
Extract the ramdisk
Replace adbd with an insecure version
Change fstab.qcom som /system is mounted rw
Reassemble the boot.img using mkbootimg
Code:
mkbootimg --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0xb7 ehci-hcd.park=3 dwc3.maximum_speed=high dwc3_msm.prop_chg_detect=Y" \
--base 0x00000000 --kernel kernel_S1-SW-LIVE-9C84-PID1-0006-MMC.elf.Image --ramdisk ramdisk-insecure.img.gz \
--ramdisk_offset 0x02000000 -o boot.img --dt kernel_S1-SW-LIVE-9C84-PID1-0006-MMC.elf.3 --tags_offset 0x01E00000
Unlock bootloader (I selected Z3 on the Sony unlock web page). YOUR DATA WILL BE WIPED SO MAKE A BACKUP FIRST! DRM keys will be removed which may affect funtionality and can affect the second hand value of your tablet. You have been warned!
Boot the insecure image with fastboot
Code:
fastboot-toolkit.exe boot \temp\insecure-kernel\z3tc-sgp611-insecure.img
Tablet boots but screen is not working.
Connect with ADB with root and /system rw. Now it is possible to push files to /system
Attached is my modified kernel image. I have not tried to flash it but only booted it from fastboot.
I am now asking for help installing a proper su (su daemon?) and tips for building a custom recovery.
Please feel free to move this thread to a development forum but I am not allowed to post there.
I can only hope that you can break through and get this thing rooted. Remember that there are developer's that can give you a hand. I wish I knew how. By the way will this work with SGP621 4G LTE they are the same except for cell capability. I just want to thank you for trying
Instructions for rooting Z3TC with unlocked bootloader
Root for unlocked bootloader
Sony Z3 Tablet Compact Wifi SGP611 firmware 23.0.1.A.0.167
Step by step installation:
Make sure that you have ADB installed and it is working before you proceed. Your PC should be authorized (connect once and press ok on the tablet.)
Reboot to fastboot and unlock bootloader. Follow the instructions here
http://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader/
and select Xperia Z3 if Tablet Compact is not available.
WARNING! YOUR DATA WILL BE WIPED WHEN UNLOCKING THE BOOTLOADER. MAKE SURE THAT YOU HAVE A BACKUP. DRM keys will be removed which may affect functionality and can affect the second hand value of your tablet. You have been warned!
Boot the included kernel image. This will not flash a new kernel, only load it to RAM and boot it
Code:
fastboot boot z3tc-sgp611-insecure.img
Wait for the tablet to boot. NOTHING WILL BE SHOWN ON SCREEN, THE DISPLAY IS
DARK.
Run the following commands to push files to the tablet:
Code:
adb push UPDATE-SuperSU-v2.16.zip /tmp
adb push busybox /tmp
adb push install-supersu.sh /tmp
Start an ADB shell. You should get a root prompt #
Code:
adb shell
In ADB shell, run the script to install supersu. A number of error messages
about missing files will be shown but it is normal.
Code:
# cd /tmp
# /system/bin/sh install-supersu.sh
Reboot tablet and enjoy root!
Code:
# reboot
When booting z3tc-sgp611-insecure.img only mass storage usb device is on USB port, no debug! How to solve?
SGP621, 23.0.1.A.0.167
Code:
C:\adt\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>fastboot boot z3tc-sgp611-insecure.img
< waiting for device >
downloading 'boot.img'...
OKAY [ 0.333s]
booting...
OKAY [ 0.048s]
finished. total time: 0.385s
C:\adt\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>adb devices
List of devices attached
C:\adt\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>adb push UPDATE-SuperSU-v2.16.zip /tmp
error: device not found
error: device not found
C:\adt\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>adb devices
List of devices attached
C:\adt\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>adb devices
List of devices attached
C:\adt\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>adb kill-server
C:\adt\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
alex9x said:
When booting z3tc-sgp611-insecure.img only mass storage usb device is on USB port, no debug! How to solve?
Click to expand...
Click to collapse
I have SGP611 16GB Wifi version and I do not know if SGP621 uses the exact same kernel.
It sound like a missing driver issue. Is ADB enabled in developer settings? Is ADB working ok when you boot normally?
Check Device Manager in Windows and see if there are any missing drivers (question marks). I had to replace the android_winusb.inf file for the ADB driver to get it to recognize the Z3TC (or maybe that was for Fastboot...).
ejdan said:
I have SGP611 16GB Wifi version and I do not know if SGP621 uses the exact same kernel.
It sound like a missing driver issue. Is ADB enabled in developer settings? Is ADB working ok when you boot normally?
Check Device Manager in Windows and see if there are any missing drivers (question marks). I had to replace the android_winusb.inf file for the ADB driver to get it to recognize the Z3TC (or maybe that was for Fastboot...).
Click to expand...
Click to collapse
All drivers installed, but only SD card appear in device manager. Seems like ADB disabled in booted firmware.
When normal boot - Sony sa0111 ADB Interface Driver (USB\VID_0FCE&PID_51C0&REV_0232&MI_01 ) appear and all OK. But before connection it ask to allow my pc connection and display RSA keys. One time press allow, and then no any questions, adb devices show my serial in list.
When powering UP - Android ADB Interface (USB\VID_0FCE&PID_0DDE&REV_0100) appearing, then booting z3tc-sgp611-insecure.img -
USB Mass Storage Device (USB\VID_0FCE&PID_E1C0&REV_0232) appears in a 7-10 seconds, and no more devices.
right on guys you're getting there. thank you
alex9x said:
When powering UP - Android ADB Interface (USB\VID_0FCE&PID_0DDE&REV_0100) appearing, then booting z3tc-sgp611-insecure.img -
USB Mass Storage Device (USB\VID_0FCE&PID_E1C0&REV_0232) appears in a 7-10 seconds, and no more devices.
Click to expand...
Click to collapse
Do you have any lockscreen security enabled? Maybe ADB is disabled when the device is locked. Try disabling PIN/pattern lock before booting the insecure kernel.
ejdan said:
Do you have any lockscreen security enabled? Maybe ADB is disabled when the device is locked. Try disabling PIN/pattern lock before booting the insecure kernel.
Click to expand...
Click to collapse
no any locks... I know this...
usb sd device is the same like when charging.... seems like when insecure kernel boots - it just enter charger mode... when booting insecure image, need any pressing key?
alex9x said:
When powering UP - Android ADB Interface (USB\VID_0FCE&PID_0DDE&REV_0100) appearing, then booting z3tc-sgp611-insecure.img -
USB Mass Storage Device (USB\VID_0FCE&PID_E1C0&REV_0232) appears in a 7-10 seconds, and no more devices.
Click to expand...
Click to collapse
Also I have my tablet set to MTP mode. Maybe it makes a difference.
Settings -> Xperia connections -> USB connection -> USB connection mode (translated from Swedish so it may not be the exact wording in English.)
ejdan said:
Also I have my tablet set to MTP mode. Maybe it makes a difference.
Settings -> Xperia connections -> USB connection -> USB connection mode (translated from Swedish so it may not be the exact wording in English.)
Click to expand...
Click to collapse
Yes, mode is MTP. When booting insecure - mass storage device NOT connect SD or internal flash, just disk without any access.
Maybe you make other steps or settings? that may affect...
alex9x said:
Yes, mode is MTP. When booting insecure - mass storage device NOT connect SD or internal flash, just disk without any access.
Maybe you make other steps or settings? that may affect...
Click to expand...
Click to collapse
Ok, then I do not know. The kernel I used is for SGP611 so maybe you need a different kernel.
ejdan said:
I have SGP611 16GB Wifi version and I do not know if SGP621 uses the exact same kernel.
Click to expand...
Click to collapse
i don't understand this.
i have the 32GB wifi only version and it says model number SGP621. What exactly is the SGP611 ?
Just a thought. Make sure you have the updated version of adb.exe installed. Previous versions will not work with KK. You will get no devices when doing "adb devices". If your tab is running, and adb debugging is enabled, and you can't get it to display devices (and no security notice on the tab), update your adb.exe
Also, when you push SU and the apk, you may want to do a chmod . Here's an example I used on the A700 tabs from my bat file, note your directories may need to be changed, but you get the general idea;
Code:
adb remount
adb push su /system/xbin/
adb push Superuser.apk /system/app/
adb push busybox /system/xbin/
adb shell chmod 6755 /system/xbin/su
adb shell chmod 0755 /system/xbin/busybox
adb shell chmod 0644 /system/app/Superuser.apk
cls
echo Installing busybox
adb shell /system/xbin/busybox --install -s /system/xbin
Just some info.
a user said:
i don't understand this.
i have the 32GB wifi only version and it says model number SGP621. What exactly is the SGP611 ?
Click to expand...
Click to collapse
SGP611 is 16GB wifi only version. I think the kernel, ramdisk and system should be the same for 16GB and 32GB versions but LTE version may be different.
According to Sony kernel docs the SGP611 and SGP612 uses the same config and SGP621/SGP641 is a different config.
Xperia Z3 Tablet Compact SGP621/SGP641 => shinano_scorpion_defconfig
Xperia Z3 Tablet Compact SGP611/SGP612 => shinano_scorpion_windy_defconfig
Click to expand...
Click to collapse
In Sweden 3 versions are available from the Sony online store:
16 GB Wi-Fi® SGP611NB
32 GB Wi-Fi® SGP612NB
LTE/4G 16 GB SGP621NB
Moscow Desire said:
Just a thought. Make sure you have the updated version of adb.exe installed. Previous versions will not work with KK. You will get no devices when doing "adb devices". If your tab is running, and adb debugging is enabled, and you can't get it to display devices (and no security notice on the tab), update your adb.exe
Also, when you push SU and the apk, you may want to do a chmod . Here's an example I used on the A700 tabs from my bat file, note your directories may need to be changed, but you get the general idea;
Code:
adb remount
adb push su /system/xbin/
adb push Superuser.apk /system/app/
adb push busybox /system/xbin/
adb shell chmod 6755 /system/xbin/su
adb shell chmod 0755 /system/xbin/busybox
adb shell chmod 0644 /system/app/Superuser.apk
cls
echo Installing busybox
adb shell /system/xbin/busybox --install -s /system/xbin
Just some info.
Click to expand...
Click to collapse
chmod is not enough for KitKat because of SELinux. Take a look at the update script from superuser 2.16 and the chcon command to change file SELinux security context.
ejdan said:
chmod is not enough for KitKat because of SELinux. Take a look at the update script from superuser 2.16 and the chcon command to change file SELinux security context.
Click to expand...
Click to collapse
Thanks for the info. KK is new for me since coming off the Iconia tabs.
Your very much welcomed Ejdan, I will try your rooting method when i get home tonight and i will report back if i have success because i have been trying to root this tablet now for nearly two weeks, I tried all the rooting methods, apks and recoveries as they all failed but now we have hope
ejdan said:
SGP611 is 16GB wifi only version. I think the kernel, ramdisk and system should be the same for 16GB and 32GB versions but LTE version may be different.
According to Sony kernel docs the SGP611 and SGP612 uses the same config and SGP621/SGP641 is a different config.
In Sweden 3 versions are available from the Sony online store:
16 GB Wi-Fi® SGP611NB
32 GB Wi-Fi® SGP612NB
LTE/4G 16 GB SGP621NB
Click to expand...
Click to collapse
I reassamble boot.img from downloaded firmware (from sony site, with flashtool) with correct kernel and dt_image from original firmware - the same result! the same usb storage unknown device.
611 have "SoMC Scorpion WINDY"
621 have "SoMC Scorpion ROW"
flashtool log while manipulations...
Code:
24/032/2014 23:32:52 - INFO - Device disconnected
24/033/2014 23:33:08 - INFO - Device connected in fastboot mode
24/033/2014 23:33:32 - INFO - Device disconnected
24/033/2014 23:33:41 - INFO - Device connected with USB debugging off
24/033/2014 23:33:41 - INFO - For 2011 devices line, be sure you are not in MTP mode
24/034/2014 23:34:06 - INFO - List of connected devices (Device Id) :
24/034/2014 23:34:06 - INFO - - USB\VID_0FCE&PID_E1C0\[my_serial] Driver installed : true
24/034/2014 23:34:06 - INFO - List of ADB devices :
24/034/2014 23:34:06 - INFO - - none
24/034/2014 23:34:06 - INFO - List of fastboot devices :
24/034/2014 23:34:06 - INFO - - none
What may be problem? Maybe another settings in tablet?
Moscow Desire said:
Just a thought. Make sure you have the updated version of adb.exe installed. Previous versions will not work with KK. You will get no devices when doing "adb devices". If your tab is running, and adb debugging is enabled, and you can't get it to display devices (and no security notice on the tab), update your adb.exe
Click to expand...
Click to collapse
adb.exe downloaded from site yesterday, this is not adb error - no adb device in device manager, seems that adbd not started on tablet or just asking for permission in a black screen... but when booting normal - adb device OK and no any permission/RSAkey questions.
Normal boot:
Code:
25/035/2014 00:35:28 - INFO - List of connected devices (Device Id) :
25/035/2014 00:35:28 - INFO - - USB\VID_0FCE&PID_51C0&MI_00\7&13ECB37&0&0000 Driver installed : true
25/035/2014 00:35:28 - INFO - - USB\VID_0FCE&PID_51C0&MI_01\7&13ECB37&0&0001 Driver installed : true
25/035/2014 00:35:28 - INFO - - USB\VID_0FCE&PID_51C0\C[serial]N Driver installed : true
25/035/2014 00:35:28 - INFO - List of ADB devices :
25/035/2014 00:35:28 - INFO - - C[serial]N
25/035/2014 00:35:28 - INFO - List of fastboot devices :
25/035/2014 00:35:28 - INFO - - none

Binding a tcp port to a block device ?

@Zaphodspeaks
Z,
okay i found a lead here http://stackoverflow.com/questions/...-android-device-failing-to-bind-tcp-port-5037
Android enforces its Internet Permission via a modification to the Linux Kernel which checks that a process is a member of an associated unix group before allowing it to open sockets in the AF_INET domain.
Such membership is inherited, so native code executed, either as a JNI library or by invoking a distinct executable, will only be able to perform network operations if it is either run as a privileged user automatically having this membership (such as adb's "shell" account, or as root on an engineering build) or run under the identify of an application package having the Internet permission in its manifest.
Click to expand...
Click to collapse
i'm going to snoop around the source and se if i can figure out how to tweak android tools source to build a modded adb and daemon and try it out.
interesting side note, even without root as long as adb is insecure you can push and run certain scripts and binaries seemingly outside of security if you work out of /data/local/tmp
for anyone wondering i had a though that maybe i could use the tab's in-house adb to connect to "itself" and achieve a root prompt.
m
EDIT- I found Q&A !!! i think ? umm this is q&a right? xD
This looks promising and fascinating.. If you pull this off, I think you will be the first to ever of done anything like this..
Zaphodspeaks said:
This looks promising and fascinating.. If you pull this off, I think you will be the first to ever of done anything like this..
Click to expand...
Click to collapse
I'd like to try it, i've been working with some simple c programming execises for the last few days
trying to figure out how to get certain system calls to work for miscellanious hooliganery! xD
i found out if you run /init in terminal you will reboot your device to recovery.
i have to re-flash a clean instance of the lp 5.1.1 firmware and then the unsecured boot.img so selinux is still intact,
then push a copy of the init binary to /data/local/tmp via adb and execute it.
if it works , then i have some neat ideas!
m
edit- i also have a new boot image which automatically mounts my debian chroot and exports the $PATH to my gcc
to anyone who needs to mount a custom block device
you need an entry like this in init.environ.rc
# Debian CHROOT
export DEBIAN_ROOT /debian
export TMPDIR /tmp
mount -t proc none /debian/proc
mount -t sysfs none /debian/sys
mount -o bind /dev /debian/dev
mount -o bind /proc/net /debian/proc/net
mount -t devpts none /debian/dev/pts
[this is for mounting my chroot, so all i have to do is run the chroot command itself and all my needed mounts are already in place]
and amend your path and ld library entries
export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/gcc/bin:/system/xbin:/bin:/usr/bin:/usr/sbin
export LD_LIBRARY_PATH /system/lib:/system/gcc/lib:/system/vendor/lib
NOTE TO SELF- pipe the output of strace <command> to text
strace id &> narc.txt
moonbutt74 said:
I'd like to try it, i've been working with some simple c programming execises for the last few days
trying to figure out how to get certain system calls to work for miscellanious hooliganery! xD
i found out if you run /init in terminal you will reboot your device to recovery.
i have to re-flash a clean instance of the lp 5.1.1 firmware and then the unsecured boot.img so selinux is still intact,
then push a copy of the init binary to /data/local/tmp via adb and execute it.
if it works , then i have some neat ideas!
m
Click to expand...
Click to collapse
Damn I wish I had your skills.. Programming is NOT my forte.... Hardware repair and PC diagnostics is what I'm best at..
@Zaphodspeaks
OKAY,
stumbled across something interesting, this will be slightly interrupted as i need to switch to tab for the second part of the post,
[via adb shell]
strace adb shell
one line in particular caught my notice in the output of strace
Code:
connect(3, {sa_family=AF_FILE, path="[COLOR="Red"]/tmp/5037[/COLOR]"}, 12) = 0
back in a minute... okay, i'm on tab from clean reboot,
when running adb shell [remember the above] i get this
Code:
[email protected]:/ # adb shell
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
error: device not found
1|[email protected]:/ #
okay now [with unsecured boot.img] as normal user in tab you cannot do this part, BUT you can via adb shell on pc-side
Code:
mkdir /data/local/tmp/5038
EDITED - see edit below [dammit, i really have to start taking notes]
EDIT
that's maybe a "HIT" of some kind. How to make it work from there i'm not sure yet.
okay i goofed by mkdir 5038 should actually be a link to socket [DERP]
i'll get back to this after some breakfast so as to avoid brain death from overcaffination. xD
i had to edit this, i lost a step somewhere, should have posted all of this from the first time around
I'm trying to understand sockets and pipes, yay!
m
okay
i learnded me how to create a symlink to a socket
ln socket:[5038] /blah-blah/5038 [sort of ]
i'm guessing i need to be looking at how /proc works
for an example in /proc/5743/fd
10 -> socket:[41910]
from http://www.linuxquestions.org/quest...an-i-create-a-socket-file-248399/#post4398605
Lots of misunderstanding here; let's see if I can clarify.
A socket file is not a regular file, it's more like an IP address (it is also not a fifo, although those are similar). A socket file is created by the system when a program calls bind on a unix domain socket, which is a special kind of network socket that can only be internal to one computer. The system then associates this special file with the socket file descriptor that the program bound (or more specifically, the "inode" to which that file descriptor refers).
From that point on, the program that created the socket has no interaction with the socket by the filename. If you move it elsewhere, create new links to it, or remove it, you may confuse other programs that are trying to talk to the program in question, but the program itself won't see it at all. You are only changing the set of names that point at that inode (and you can connect to the listening program at that new name!). Thinking of the filename as a domain name, the inode as the ip address, and the filesystem as DNS isn't so very far off.
Click to expand...
Click to collapse
i'm guessing sock_create is a c thing http://linux.die.net/man/2/socket
i have authbind "working" after getting the source configured for ndk-build , but i don't yet know what a good example of it's usage would be to prove that it functions as it should.
@osm0sis,
okay, as per your instucts , i did this
[email protected]:/ # cat /sdcard/dooby
#!/system/bin/sh
cd /sdcard
setprop service.adb.tcp.port 5555
stop adbd && start adbd
adb connect 192.168.254.42
pwd
adb shell pwd
[email protected]:/ # /sdcard/./dooby
connected to 192.168.254.42:5555
/sdcard
/
[email protected]:/ #
now of i understand this correctly i am connecting to myself via my router, right?
you know, if i remount / and touch this script there and run it with a little modification i can probably create a loop, xD
Sounds fun. Glad to be of service.

Categories

Resources