[MOD] Rsync Flashable Zip - Verizon Samsung Galaxy S 4

Good Morning XDA!
I present to you a flashable version of a tool I often use to sync my music library with my phone: rsync.
For those of you not familiar with it, it is a (generally) Unix / Mac OSX / Cygwin based tool to allow the easy synchronization of files from machine A to machine B.
It requires some sort of SSH server on your phone, but once everything is setup it is a very easy to use tool to manage a music library, especially when you keep music in a non-standard location.
I also included a link to a shell script I created to sync music that runs on your computer. Note: Requires Unix / Mac OSX / Cygwin
Downloads
Android rsync
See Attachments
Optional: Music Synchronization Script
https://bitbucket.org/rcmurphy/scripts/downloads/android-music-sync
Installation
Android rsync
Push Rsync.zip to your phone.
Flash as you would any other zip.
Optional: Music Synchronization Script
Ensure 'rsync' is installed on your computer.
Create '~/bin' if already exist.
Copy the script to '~/bin/'.
Rename the script to 'android-music-sync'.
Chmod the script to 755.
Shell Script Usage
Code:
android-music-sync [IP of phone] [Source Dir] [Destination Dir]
Example
Code:
android-music-sync 10.30.35.37 ~/Music/MasterLibrary/ /storage/sdcard1/Music/

Related

[HOW-TO] Manually backup 3rd-party application settings and data--by cyricc

From the original post by cyricc in the G1 Android Development forum:
HOW TO: Manually backup 3rd-party application settings and data
I just didn't want to be the guy posting only a link. Please post any questions, comments, or thanks in the original thread I deserve NO CREDIT for this post.
##############################
This tutorial will explain how to backup application data and settings for 3rd-party apps that do not have an export/import settings feature. Looking to upgrade your ROM but don't want to lose your todos/highscores/whatnots after a data wipe? Then read on..
(I've never used apps to SD, so I'm not completely sure how the data is stored with that. I'm assuming the entire data partition is moved to the SD though, so the procedures outlined in this guide are not necessary / do not apply to apps2sd)
Tools needed:
adb
Backing up settings
Run a adb shell in the command prompt and navigate to /data/data
Code:
c:\android-sdk-windows-1.5_r1\tools> adb shell
# cd /data/data
Find the folder of the app whose settings you want to backup. In android 1.5, M/SMS are stored in com.android.providers.telephony and bookmarks are in com.android.browser. For third party apps, you can use ls to list all installed apps and find your app folder manually, or use find - say I want to find the app folder for the Astrid todo app:
Code:
# ls
<.....lots of directories....>
com.timsu.astrid
<.....more directories....>
# find *astrid* -maxdepth 0
com.timsu.astrid
Now open a separate command prompt and use adb pull to copy the application's data folder to your computer. This does not copy the app itself, only its saved data and settings. App .apks reside in /data/apps, which you can also adb pull out if you want. In this example I pull out settings for Astrid:
Code:
c:\android-sdk-windows-1.5_r1\tools> adb pull /data/data/com.timsu.astrid d:\desktop\com.timsu.astrid
Feel free to replace d:\desktop with the location of your choice, of course. Repeat the above for each app folder you want to backup.
Restoring settings after a wipe
First thing to do is reinstall the apk, from sdcard, adb install, market, whatever. After the app is installed, you can restore settings in one of two ways: the easy way or the hard but safe (paranoid) way.
The Easy Way:
This quick and dirty method will give everyone full read/write/execute permissions on the application's settings/data. This is normally a Very Bad Idea with a normal linux computer, but realistically there is very little risk of this posing any real security issues on a device like a phone.
First, adb push the settings into the data folder, overwriting the app's stock settings (in this example, the astrid data I backed up) then adb shell into the phone and navigate to /data/data:
Code:
c:\android-sdk-windows-1.5_r1\tools> adb push d:\desktop\com.timsu.astrid /data/data/com.timsu.astrid
Done
c:\android-sdk-windows-1.5_r1\tools> adb shell
# cd /data/data
Now give full permissions to the app's data folder and its contents:
Code:
# chmod 777 com.timsu.astrid
# cd com.timsu.astrid
# chmod 777 * */*
And that's it. Launch the app and your settings/data should be restored.
The Hard Way
I'm not going to go into this in detail because if you're reading this, you probably know the commands to do this anyway. After you reinstall the app, the general idea is to run ls -l on the stock app data directory and its subdirectories to display the owner and permissions of each file/folder as setup by the android system. Write these down then adb push the backup app data folder in, which overwrites everything with directories and files owned by root. Then use chown and chmod to restore the original owners and permissions for each file and directory. Needless to say this can be quite a hassle if you're dealing with more than a few application backups.
i made a script that copies ALL of the applications off of the phone as a backup to a folder on your sd card. the sd card MUST HAVE a folder called "app" in order for this to work.
Code:
@ECHO OFF
adb shell cp data/app/* /sdcard/app
pause
then here is one to reinstall ALL of the apps from that "app" folder back onto your android, keeping the update notifications.
Code:
@ECHO OFF
adb remount
adb shell busybox install sdcard/app/*.apk /data/app
pause
exit
either type those commands into a command prompt or you can make a .bat file and put those commands in.

Photon 4G Full Linux (Debian) inside WebTop - Instructions

THE PHOTON 4G INSTRUCTIONS FOR DEBIAN LINUX IN WEBTOP MODE
First -- the important legal stuff (repeated in the script files so you can read there instead)-- then the instructions:
# This work is based on the work by SystemR89 on the xda-developers forum.
# It therefore acknowledges that work, and carries all of the disclaimers
# also inherent in the body of work by SystemR89.
# See http://forum.xda-developers.com/showthread.php?t=1093790 for more.
# LEGAL DISCLAIMERS AND ASSUMPTION OF THE RISK BY THE USER OF THIS PROGRAM
# Assumption of the Risk of Use
# You assume, and agree to assume, all the risk of harm by using this
# program. This program may void your warranty with a third party,
# it may improperly operate and damage your device, it may cause any
# myriad of harmful outcomes regarding your device. You acknowledge that
# you are aware of those risks, understand those risks, and voluntarily
# and intelligently elect to engage those risks by using the program.
#Disclaimer of Warranty.
# THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
# LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
# OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
# THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
# YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
# NECESSARY SERVICING, REPAIR OR CORRECTION.
#Limitation of Liability.
# IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
# ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE
# PROGRAM, PERMITTED OR NOT, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
# GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
# USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
# OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
# THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
# PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGES.
Prerequisites:
Rooted Motorola Photon 4G Phone
BusyBox installed using the BusyBox Installer
In short, you should know how to, and have already rooted your phone. Second, you should be able to type: /system/xbin/busybox and not get an error.
Step by Steps:
Since you are installing a Linux mod on your phone, I'll assume you already have familiarity with Linux and therefore the instructions below discuss that. The same nature works for Windows, the only difference is the commands (you should know those, or you should not do this mod).
1) Read http://forum.xda-developers.com/showthread.php?t=1093790. Particularly, look at the Prerequisites section -- the only difference here is where that discussion mentions "Atrix," you are using a "Photon";
2) On your computer: Make a working directory for the files and change to it:
Code:
mkdir photonmod
cd photonmod
3) On your computer: Download the Installer (a.k.a. easy-signed.zip) on that page into your working directory:
browse to: http://www.multiupload.com/C5GEIHDEM0
4) Download the files for this mod: photon_webtop_mod.zip:
wget http://www.4shared.com/zip/vkPYLVf7/photon_webtop_mod__1_.html
Notes:
I will move the file later, when I get a valid upload site for the Photon forum, but 'til then, you can use my server as per the above link.
The md5 hash for that file is as follows:
7df2fa818ddb15f1586695028b7024fd photon_webtop_mod.zip
At this point, in your working directory (photonmod), you should have two files, the two zips downloaded above.​
4) On your computer: unzip the easy-signed.zip file (downloaded in step 3 above):
Code:
unzip easy_v0.2.7-signed.zip
6) Remove uninteresting files (from the Photon's perspective) from the easy-signed.zip file:
Code:
rm -rf META-INF
rm -f webtopmod.sh
7) On your computer: unzip the photon photon_webtop_mod.zip file (downloaded in step 4 above):
Code:
unzip photon_webtop_mod.zip
Notes:
At this point, you should see the install.sh and webtopmod.sh files for the photon, and also the uninstall directory (which has uninstaller scripts for the photon) and the directories and files necessary from the easy-install.zip file from the Atrix forum.​
8) On your computer: Remove the downloads, zip up the webtopmod files and push it to your phone:
Code:
rm -f photon_webtop_mod.zip
rm -f easy_v0.2.7-signed.zip
zip -r ../photonmod.zip .
adb push ../photonmod.zip /mnt/sdcard/
9) Now open a shell on your phone and switch to super user:
Code:
adb shell
10) On your phone: Switch to the super user:
Code:
su
11) On your phone: Change directories to /data/local/tmp:
Code:
cd /data/local/tmp
12) On your phone: Make certain you did that correctly:
Code:
pwd
Notes:
Should return /data/local/tmp -- if not, to back to step 11 above.​
13) On your phone: Unzip the photonmod zip file into the /data/local/tmp directory:
Code:
/system/xbin/unzip /mnt/sdcard/photonmod.zip
14) On your phone: Set the execute bit on the install scripts:
Code:
/system/xbin/chmod +x install.sh
/system/xbin/chmod +x webtopmod.sh
15) On your phone: Run the installer in test mode and review the results:
Code:
./install.sh -m test
Notes:
That will show you exactly what commands the install script will execute. Review that very carefully and be sure you agree with it.​
16) On your phone: Run the installer in install mode and it will install the files necessary to start Debian Linux:
Code:
./install.sh -m install
17) After that -- go to the original Atrix post and get the disk image file and place it as that page describes (look for the text: "0) Download Debian disk - http://droid.makrit.net/WebTopMOD/WebTopMOD-20110707.7z").
Uninstalling the MOD:
The unpacked files in /data/local/tmp included an uninstaller script. To execute that:
1) On your computer: Open a shell on your phone:
Code:
adb shell
2) On your phone: become super user and change directories to the uninstaller:
Code:
cd /data/local/tmp/uninstall
su
3) On your phone: Set the execute bits on the restore scripts:
Code:
/system/xbin/chmod +x uninstall.sh
/system/xbin/chmod +x webtop_restore.sh
4) On your phone: Run the uninstaller for the commands it will execute:
Code:
./uninstall.sh -m test
Review that and if you agree, go ahead ...
5) On your phone: Run the uninstaller in 'restore' mode:
Code:
./uninstall.sh -m restore
As a final note -- this mod prepares your phone for running Debian Linux in a chroot-ed environment. You need the debian disk image. Rather than duplicate those instructions (essentially downloading and placing the disk image file in the correct place), please read the original Atrix thread at: http://forum.xda-developers.com/showthread.php?t=1093790. You will download the http://droid.makrit.net/WebTopMOD/WebTopMOD-20110707.7z file to your computer, unpack it (it's a 7zip file) and thereafter copy it to your phone.
I'll try to keep up with folks responding for help requests, or otherwise.
-- Tom
CHANGELOG
Update (12/22/2012):
You can now download photon_webtop_mod.zip file (see step 4 in the original post) by clicking here.
For all the files (in the event you have troubles downloading the files in the Atrix forum, look here.
great tutorial I assume that should work with jelly bean
hightech316 said:
... I assume that should work with jelly bean
Click to expand...
Click to collapse
One would think, that's for sure. So long as you can root the phone, mount/remount the relevant partitions, chroot (to the loopback), and the /osh directory remains the same, I don't know why it would fail. With that said, I don't have JB, so it's just words on screen .
-- Tom
tdhite said:
THE PHOTON 4G INSTRUCTIONS FOR DEBIAN LINUX IN WEBTOP MODE
3) On your computer: Download the Installer (a.k.a. easy-signed.zip) on that page into your working directory:
browse to: -link-
4) Download the files for this mod: photon_webtop_mod.zip:
wget -link-
-- Tom
Click to expand...
Click to collapse
That sounds like a great work! Now, after 6 years I want to apply it to my Photon Q. Unfortunately, the links are gone. Do you still have the files?

[Q] How to copy rsync binary to Android PATH.

Experienced Linux user, Android noob.
I'd like to be able to use rsync to transfer files from my Linux desktop to my Sony Xperia Tablet Z and initiate the transfers from my Linux desktop.
A blog explained how to do it by first installing an SSH app, which I have done. It works fine, I can now SSH from my Linux desktop to the tablet.
Now I need to copy the rsync binary to the tablet and to make sure it's in the PATH and has "755" permissions set. Over SSH I was able to see what my PATH is, but I can't copy the rsync binary to anywhere in the PATH as I run into permission denied problems.
How do I copy the rsync binary to within my PATH and set 755 permissions? I really do not want to ROOT my device.
Thanks all.
PS. I don't want to use "rsync backup for Android" as the rsync commands can only be run from the Android device.

start script at boot

hi,
i'm using stock-rom 4.1.2 (root) on my xtz wifi 16gb. i can mount samba shares running 2 script in terminal emulator
Code:
su
sh cifs.sh
sh mount.sh
cifs.sh starts cifs.ko and mount.sh mounts the samba share. su sh cifs.sh or ./cifs.sh don't work.
now i want to mount the share after boot the xtz. on linux i can use init.d, but on android init.d is read-only. there is no autostart.sh. in play store there are some app who starts autostart.sh (i.e. this https://play.google.com/store/apps/details?id=nk.bla.android.autostart&hl=de; i had to create the folder opt in /data and then create autostart.sh in /opt). bit it seems the scripts isn't loaded after bot the device.
is there an other solution for autostart the scripts on xtz?
piere
Download ROM Toolbox (Pro or Lite), go to Scripts, choose Import Script, look for your script. After added, press and hold over your script, and choose Set At Boot, or smth like that.
That Should do
thx, works.

[GUIDE][TUTORIAL][SHARE] How to make a nandroid backup directly to your computer with

Note: I'm just sharing the work of the XDA member.This guide was tested on Galaxy Y GT-S5360.Here's a little introduction:
scandiun said:
INFORMATION
This guide is intended to make a full backup of your android phone (the entire memory block with all partitions) or a single partition (including sdcards, etc) directly to your computer, in either
Block level (with dd): for single partitions or whole memory block (all partitions in one piece). The backup always has the same size which is the size of the partition.
File level (with tar): only for individual partitions. This only includes files and folders, so occupies much less space, depending on how much filled is the partition.
It can be done with the phone powered on or from ClockWorkMod Recovery (from both ADB works, while in Fastboot doesn't so won't apply). Unless specified the commands meant to be used from Windows. For Linux and Unix is similar.
REQUIREMENTS
Rooted Android Phone
Busybox installed on your phone
If you are using Linux / OS X you have native tools, for Windows download Cygwin, and install with it netcat, pv and util-linux. Get them from Cygwin's setup.exe
ADB installed.
Make sure adb.exe is in your windows' path. See here and here, or use Path Manager.
Android phone with USB Debugging enabled, and the proper drivers installed on Windows so the phone is recognized. Typing 'adb devices' on a terminal should show your device.
PARTITION IDENTIFICATION
You now have to identify the partition or block device that you want to backup. For a single partition you can use either tar or dd, while for the entire memory block you can only use dd.
For example, on Galaxy Nexus you have the list of partitions here and for Galaxy S2 here.
Usually on android, the entire block containing all partitions is located at /dev/block/mmcblk0 and the data partitions is a subpartition of it. You can push parted with GPT support to your device and see all information on a partition or block.
Whole phone memory -> /dev/block/mmcblk0 (may vary, in some phones this is the sdcard)
Subpartitions -> depends on each device. Usually at /dev/block/platform/dw_mmc/by-name/ there are listed by name linking to the real device.
Back up of the whole memory block (via adb)
Connect the phone in ADB mode and unlock the screen.
Open one Cygwin Terminal and enter (replace mmcblk0 if needed):
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
You will see the cursor blinking at the left. Now the phone is waiting to send the block over the network.
Open another Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
cd /path/to/store/the/backup
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
You will see how the image size is growing until it finishes. Now you have the whole phone backed up in raw format. You can see the contents of the GPT partition with gptfdisk tool, available for windows, linux and such. See official website and sourceforge to get it. You can do it the same from ClockWorkMod Recovery but you have to mount first the /system partition since the busybox included with clockworkmod does not come with netcat and you have to use the one from the system partition.
With further linux tools you could edit or extract single partitions from the whole block.
You can use adb via wifi as well with applications like WiFi ADB.
Back up of the whole memory block (via wifi)
Original post: [Q] Nandroid directly to computer w/o sdcard
We need to install a FTP server on the computer or the other device, configure a user with a password if we want to, and set some port. It uses by default 21 but this example uses 40. We must set a home dir for the user with write permissions.
Usually is a good idea to put myfifo in /cache not in /data because we may overwrite sensitive data in case we want to use that raw image for data recovery.
Open one Cygwin terminal
Code:
adb shell
su
mkfifo /cache/myfifo
ftpput -v -u user -p pass -P 40 COMPUTER_IP block.raw /cache/myfifo
Open another Cygwin terminal
Code:
adb shell
su
dd if=/dev/block/mmcblk0p12 of=/cache/myfifo
Tips:
- Fifos only can be made on linux native filesystems, for example on a FAT partition is not possible.
- Reading from a partition does not modify it.
Now check on Filezilla Server the speed
Back up of the whole memory block (USB tethering, Wifi tethering)
To use tethering you have to disconnect the computer from all networks and connect it only to the phone with the type of connection you want.
Once you connect it, you can view the IP of the computer and the IP of the phone from connection properties. The ip is the computer ip and the gateway is the phone's ip.
Wifi Tethering: Computer Phone Internet
USB Tethering:
Computer Phone Internet
Conputer Phone Internet
This is exactly the same as via wifi, except that the transfer speed is much higher because the computer and the phone are directly connected, instead of using a router as a gateway. In this case, the gateway is the phone. USB tethering has the highest transfer rate.
Back up of a single partition (raw = every bit of the partition)
It is exactly the same as the the previous but replacing mmcblk0 by the corresponding partition. You can use in this particular case several software to read the partition from windows, depending on partition filesystem: DiskInternals Linux Reader, Ext2Read, Ext2 File System Driver for Windows, Ext4Explore, plugin for Total Commander and ImDisk Virtual Disk Driver. You can also use recovery software on individual partitions like Recuva in combination with VHD Tool or command line tools included with operating systems.
Back up of a single partition (tar = only files and folders)
In this case, you need the partition mounted. To see the list of mounted partitions type on Cygwin Terminal
Code:
adb shell mount
Now you need to know where is mounted the partition you want to backup, for example the firmware is mounted on /system, which is the ROM.
In this case you will have to open three terminals, because of android limitations:
Open one Cygwin terminal and create a fifo, in /cache, for example, and redirect the tar there
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox mkfifo /cache/myfifo
/system/xbin/busybox tar -cvf /cache/myfifo /system
We have to do it this way because redirecting the tar to stdout (with - ) is broken on android and will corrupt the tar file.
Open a second Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox cat /cache/myfifo
Open a third Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
cd /path/to/store/the/backup
nc 127.0.0.1 5555 | pv -i 0.5 > system.tar
You can browse the tar file with Winrar, Total Commander, PeaZip and almost any compression tool. Note that you shouldn't extract files or edit it since the tar format saves the permission and owner data for each file, that is lost when extracted to FAT / NTFS partitions and you will mess things when restoring.
LINKS
[GUIDE] Internal Memory Data Recovery - Yes We Can!
How to Create and Attach a Virtual Hard Disk in Windows 7
[Guide] Types of Android backups
Click to expand...
Click to collapse
Original Thread : http://forum.xda-developers.com/showthread.php?t=1818321
And here is the guide to make nandroid backup through terminal app in android with switching off the phone in sdcard!!!
http://forum.xda-developers.com/showthread.php?t=1620255

Categories

Resources