https://raw.githubusercontent.com/ameer1234567890/OnlineNandroid/master/versionhttps://raw.githubusercontent.com/ameer1234567890/OnlineNandroid/master/onandroidhttps://raw.githubusercontent.com/ameer1234567890/OnlineNandroid/master/changeloghttps://raw.githubusercontent.com/ameer1234567890/OnlineNandroid/master/part_layouts/codenameshttps://raw.githubusercontent.com/ameer1234567890/OnlineNandroid/master/part_layouts/mtd_deviceshttps://raw.githubusercontent.com/ameer1234567890/OnlineNandroid/master/part_layouts/raw/partlayout4nandriod.codename, where codename is the codename for the specific device.https://raw.githubusercontent.com/ameer1234567890/OnlineNandroid/master/part_layouts/zip/part_detect_tool.codename.zip, where codename is the codename for the specific device.
v6 introduces a new command line flag mechanism with totally revamped code. Each command line flag also has a long version which is more descriptive and preferred by some. This screen can be accessed by typing onandroid -h or onandroid --help.
:::none
-h, --help display this help message and exit
-h2, --help2 display more help messages and exit
-ah, --advanced-help display help for advanced backup mode
-v, --version display version number and exit
-p, --phone generate backup name with phone timezone
-u, --utc generate backup name with UTC time (default)
-i, --incremental CWM6 style incremental backup mode
-a, --advanced PARTITIONS advanced / selective backup mode
-l, --split split backup mode (CWM 6+ only)
-o, --old good old backup mode (default)
-gc, --garbage-collect run garbage collect mode
-w, --twrp TWRP backup mode
-me, --md5-enable enable md5 generation (for TWRP only)
-md, --md5-disable disable md5 generation (for TWRP only)
-ce, --compression-enable enable compression (for TWRP only)
-cd, --compression-disable disable compression (for TWRP only)
-cg, --compression-gzip enable compression and use gzip (TWRP only)
-c, --custom NAME specify a custom backup name
-s, --storage MEDIA specify an alternate storage media to backup
-e, --sd-ext-path PATH specify path to sd-ext partition
-r, --replace replace backup with same name
In addition to these, v8 introduces a new command line flag listing, which contains advanced and less frequently used command line flags. This screen can be accessed by typing onandroid -h2 or onandroid --help2.
:::none
-y, --yaffs-override create tar balls instead of yaffs images for yaffs2 partitions
-t, --sbin-last use /sbin as last option for busybox
-ne, --notification-enable enable vibrate and LED notification (default)
-nd, --notification-disable disable vibrate and LED notification
-pp, --progress-percent show percentage progress indicator (default)
-pd, --progress-dot show dot progress indicator
-d, --device-id return device id used by TWRP
-ds, --set-device-id set device id used by TWRP
-xd, --exclude-dalvik exclude dalvik-cache from backup
-xg, --exclude-gmusic exclude Google Music files from backup
Since some people are having issues where the script detects internal sd card for backing up, but people want the external sd card to be selected (there is instances of vice versa too), there is a command line flag to set the sdcard / base folder. You could also use this for cryptonite volumes or any other folders for that matter. Here is an example:
For sd card selection: (This would force Online Nandroid to backup to /sdcard/external_sd/clockworkmod/backup/...)
:::shell
onandroid -s /sdcard/external_sd
OR
onandroid --storage /sdcard/external_sd
For your cryptonite volume: (This would force Online Nandroid to backup to /sdcard/mnt/cryptonite/clockworkmod/backup/...)
:::shell
onandroid -s /sdcard/mnt/cryptonite
OR
onandroid --storage /sdcard/mnt/cryptonite
Since it is almost impossible for the script to detect all the various flavors of sd-ext usages (such as app2sd, link2sd, data2sd, etc...), I have added a command line flag to manually specify sd-ext path / mountpoint. Here is an example:
:::shell
onandroid -e /data/sdext2
OR
onandroid --sd-ext-path /data/sdext2
Using this backup mode you can backup only specific partitions.
:::shell
Usage: onandroid -a <partitions></partitions>
<partitions>
m: mmcblk0_start (for Acer devices)
k: uboot (for MTK based devices)
b: boot
r: recovery
w: wimax (for Samsung devices)
l: appslog (for HTC and Sony (Ericsson) devices)
g: kernel
q: modem
v: Trim Area / TA (for Sony devices)
s: system
d: data
c: cache
t: datadata (for some Samsung devices)
j: data/data (for HTC devices)
e: efs (for Samsung devices)
o: preload (for Samsung devices)
u: .cust_backup (for Huawei devices)
f: flexrom (for Acer devices)
h: custpack (for Alcatel devices)
i: mobile_info (for Alcatel devices)
a: android_secure
x: sd-ext</partitions>
Note: This help screen can be accessed by entering:
:::shell
onandroid -ah
OR
onandroid --advanced-help
Example (backup boot, system and data partitions only):
:::shell
onandroid -a bsd
OR
onandroid --advanced bsd
Setting dot indicator:
:::shell
onandroid -pd
OR
onandroid --progress-dot
Setting percentage indicator:
:::shell
onandroid -pp
OR
onandroid --progress-percent
If the app / tool you are developing has a method of notifying the user when backup is done, and / or if you do not require the notifications done by Online Nandroid script itself (currently led and vibrate notifications), you can disable notifications. Here is an example:
:::shell
onandroid -nd
OR
onandroid --notification-disable
Online Nandroid adheres to backup format indicator set in .default_backup_format file, by ClockWorkMod (CWM) recovery. This file could have 2 different strings, dup or tar, where dup means incremental backup mode and tar means split backup mode. The file is normally in the below location, as set by CWM. The sd card mount point may vary.
:::shell
/mnt/sdcard/clockworkmod/.default_backup_format
In addition, Online Nandroid introduces its own file (.advanced_backup_partitions) for specifying backup partitions for advanced / selective backup. This file should be populated with the partition letters in the same way as doing an advanced / selective backup. The file should be in the below location. The sd card mount point may vary.
:::shell
/mnt/sdcard/clockworkmod/.advanced_backup_partitions
Some kernels include busybox in the ramdisk, in /sbin/busybox. This is mostly done to accommodate busybox calls in recovery mode. In the default setup of Terminal Emulator, /sbin is given preference over /system/bin and /system/xbin. Thus, Online Nandroid uses /sbin/busybox over any other busybox installations. The issue arises when the busybox binary in /sbin/busybox is out of date. This sometimes causes undesired affects for Online Nandroid. To overcome this situation, you can use the below command line flag.
:::shell
onandroid -t
OR
onandroid --sbin-last
CWM has an old method of backing-up yaffs2 partitions as yaffs2 images, instead of tar balls. Since Online Nandroid follows the same formats used by CWM, it follows the same method as well. This has a side affect in some cases (specially if internal sdcard lives in /data/media or if an sd-ext setup is used). To overcome this, Online Nandroid can do tar backups for yaffs2 partitions as well. The override flag is:
:::shell
onandroid -y
OR
onandroid --yaffs-override
Online Nandroid returns specific exit codes based on the status of the script run. Below is the list of error codes and their respective descriptions.
:::shell
0 : Success
65 : Could not acquire root permissions
66 : Sufficient battery not available
67 : Error: BusyBox version less than 1.20 found
68 : SD card not found
69 : Killed by exit/kill signal
70 : mkyaffs2image not found in path
71 : dedupe not found in path
75 : busybox not found in path
80 : Could not change to backup path
81 : Cannot create backup directory
82 : Cannot delete backup directory
83 : Backup name already exists
84 : Cannot write to backup directory
85 : Cannot write to blobs directory
86 : Not enough disk space
87 : Could not change to backup directory
88 : Another instance already running
/data/local/tmp/onandroid.pid at the beginning of each run. This can be used to explicitly kill the Online Nandroid process via java or shell.
/data/local/tmp/onandroid.busybox. This provides the opportunity for apps to include their own busybox binary within the app's data directory, which could provide a more consistent experience and avoid glitches with various versions of busybox.Contents of onandroid.busybox file:
:::shell
/system/xbin/busybox
Note: This text file should contain the full path, including the file name of busybox binary, and should not contain a line feed or carriage return or both. Also, it is recommended for app developers to overwrite this file (if it exists), upon each run of the app or backup process and remove the file upon exit of the app or backup process.
Normal compression using busybox's tar:
:::shell
onandroid -w -ce
OR
onandroid --twrp --compression-enable
Alternative compression using busybox's gzip:
:::shell
onandroid -w -cg
OR
onandroid --twrp --compression-gzip
Note: The normal compression mode does not work with certain busybox versions. This BusyBox Installer is known to work and this BusyBox Installer does not work. Alternative compression mode was provided to overcome this. However, it might take more time for compression than the normal mode. Sometimes, the alternative compression mode is known to produce smaller backups than the normal mode.