Backup manager for android

Related tags

App oandbackup
Overview

oandbackup

pipeline status

a backup program for android. requires root and allows you to backup individual apps and their data. both backup and restore of individual programs one at a time and batch backup and restore of multiple programs are supported (with silent / unattended restores).
restoring system apps should be possible without requiring a reboot afterwards. oandbackup is also able to uninstall system apps. handling system apps in this way depends on whether /system/ can be remounted as writeable though, so this will probably not work for all devices (e.g. htc devices with the security flag on).
backups can be scheduled with no limit on the number of individual schedules and there is the possibility of creating custom lists from the list of installed apps.

building

oandbackup is built with gradle. you need the android sdk, rust for building the oab-utils binary, and bash or a compatible shell for executing the oab-utils build script (patches for making this buildable on windows are welcomed).

./gradlew build
# building only debug
./gradlew assembleDebug
# building for a specific abi target
./gradlew assembleArm64

version control

oandbackup is handled on both gitlab and github:
https://gitlab.com/jensstein/oandbackup/
https://github.com/jensstein/oandbackup
debug apks are built by gitlab for each commit on every branch. the latest successful build can be found here (substitute $branch for the desired branch, e.g. master):
https://gitlab.com/jensstein/oandbackup/-/jobs/artifacts/$branch/browse/apks?job=build
(e.g. https://gitlab.com/jensstein/oandbackup/-/jobs/artifacts/master/browse/apks?job=build)
and signed release apks are built for every commit on the master branch:
https://gitlab.com/jensstein/oandbackup/-/jobs/artifacts/master/browse?job=sign

busybox / toybox / oab-utils

a working busybox or toybox installation is required at the moment, but work is in progress to include all the needed functionality in a binary included in the apk. this program is called oab-utils and is written in rust.

you can get the source for busybox here: https://busybox.net/. you then need to cross-compile it for the architecture of your device (e.g. armv6). you can also try the binaries found here: https://busybox.net/downloads/binaries/.
if you have a working toolchain for your target device, you should only need to run the following commands on the busybox source:

    make defconfig # makes a config file with the default options
    make menuconfig # brings up an ncurses-based menu for editing the options
        # set the prefix for your toolchain under busybox settings -> build options 
        # (remember the trailing dash, e.g. 'arm-unknown-linux-gnueabihf-')
        # build as a static binary if needed
    make

copy the busybox binary to your system, for example /system/xbin or /data/local, and make it executable. symlinking is not necessary for use with oandbackup. in the oandbackup preferences, provide the whole path to the busybox binary, including the binary's file name (e.g. /data/local/busybox).

an apk build of oandbackup is available on f-droid's servers: https://f-droid.org/repository/browse/?fdid=dk.jens.backup

translations are currently being managed on transifex: https://www.transifex.com/projects/p/oandbackup/ so please come help us there or spread the link if you want the app available in your own language.

if you have any questions, critique, bug reports or suggestions, please write me an email: [email protected]

Cryptography

oandbackup supports encrypting the backups using an external cryptography provider. First you need to install an app which implements the openpgp-api, e.g. OpenKeychain: https://www.openkeychain.org/, and set up an identity. The "Cryptography" section of the preferences of oandbackup is then enabled and here you can choose which openpgp and identity to use.

special usage notes

  • long press an item in the list of apps to get the context menu.
    • delete backup: deletes the backup files for the chosen app.
    • uninstall: somewhat more aggresive than a normal uninstall. in addition to doing a normal uninstall via android commands (via pm and thereby uninstalling for all users of the device), uninstalling from oandbackup deletes files the app might have left over in /data/app-lib/. this is useful, as a normal uninstall via android settings in rare circumstances can leave files there making a reinstall of the same app impossible while they are there. this also works on system apps (although this is still somewhat experimental), which are deleted with a normal rm after the system partition has been remounted as read-write. it is afterwards remounted as read-only.
    • enable / disable: uses the android script pm to enable or disable an app. disabling an app removes it from the normal user interface without uninstalling. this can be used for enabling or disabling an app for muliple users at a time (if the device has multiple users enabled). users are identified with an id: 0 is the first user (owner).
  • multiple users: multi-user is still somewhat experimental but should work. when restoring in a multi-user setting, pm install -r $apk gets called and subsequently the app is disabled for every user who has the app listed in /data/system/user/$user/package-restrictions.xml (unless the app is listed as enabled="1").
    this can create problems for users installing the same app at some later point, but is necessary to prevent the app from being installed to all users at the same time. the context menu has an option to enable or disable apps which can be used if other users become unable to use a specific app due to disabling on restore.
    enabling and disabling only works after an initial install (not necessarily from oandbackup) or restore of the app.

restoring data can also be done manually from the backup files. oandbackup stores the program data files in zip-compressed archives so they can be uncompressed and unpacked with any tool supporting that format (e.g. unzip dk.jens.backup.zip). the unpacked files should then be placed in the directory indicated by "dataDir" in the log file stored with the backup files. this directory will usually be in /data/data/.
after restoring the files, the user and group id of the package need to be set. therefore data can only be restored for packages where an apk has been installed successfully. uid and gid can be obtained with the stat program (e.g. stat /data/data/dk.jens.backup) and set with chown. finally, the correct permissions need to be set with chmod. oandbackup does this by setting 771 for all data files although this is probably not the best method. the subdirectory lib/ needs to be excluded from both chown and chmod.
on android 6 / marshmallow (api 23) you would also need to use the restorecon command on the data directory (e.g. restorecon -R /data/data/dk.jens.backup) or use another method of restoring the file security contexts.
the code which does these things are in the methods doRestore and setPermissions of ShellCommands.java.

licenses

oandbackup is licensed under the MIT license (see LICENSE.txt)

android-support-v4 is written by The Android Open Source Project and licensed under the Apache License, Version 2.0 (see NOTICE.txt in the libs directory)

openpgp-api-lib is written by Dominik Schürmann and licensed under Apache License, Version 2.0

author

jens stein

Comments
  • cannot backup on Android 7 Nougat

    cannot backup on Android 7 Nougat

    I'm currently running CM14 based TugaROM and just noticed that while restoring backups goes as usual, I cannot make new backups. It just loops the circle animation for ever and says "backup", but nothing happens. I have to force close the app. The app has storage permission.

    opened by takiainen 29
  • BUILD FAILED

    BUILD FAILED

    gericom@siductionbox:~/oandbackup$ /home/gericom/sdk/tools/android update project -t 1 -p . --library libs/openpgp-api-lib Resolved location of library project to: /home/gericom/oandbackup/libs/openpgp-api-lib Updated project.properties Updated local.properties Updated file ./proguard-project.txt gericom@siductionbox:~/oandbackup$ ant debug Buildfile: /home/gericom/oandbackup/build.xml

    -set-mode-check:

    -set-debug-files:

    -check-env: [checkenv] Android SDK Tools Revision 24.4.1 [checkenv] Installed at /home/gericom/sdk

    -setup: [echo] Project Name: OAndBackup [gettype] Project Type: Application

    -set-debug-mode:

    -debug-obfuscation-check:

    -pre-build:

    -build-setup: [getbuildtools] Using latest Build Tools: 23.0.2 [echo] Resolving Build Target for OAndBackup... [gettarget] Project Target: Android 5.1.1 [gettarget] API level: 22 [echo] ---------- [echo] Creating output directories if needed... [echo] ---------- [echo] Resolving Dependencies for OAndBackup... [dependency] Library dependencies: [dependency] [dependency] ------------------ [dependency] Ordered libraries: [dependency] [dependency] ------------------ [echo] ---------- [echo] Building Libraries with 'debug'...

    BUILD FAILED /home/gericom/sdk/tools/ant/build.xml:597: The following error occurred while executing this line: /home/gericom/oandbackup/libs/openpgp-api-lib/build.xml:55: sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.

    Total time: 0 seconds

    opened by niko-yanev 26
  • Restoring Signal / LibreSignal

    Restoring Signal / LibreSignal

    Good evening Ladies and Gentlemen!

    @jensstein recommended that I open this fresh Issue to publicly track our progress restoring messages from Signal (I am using the GCM-free version with websocket support called LibreSignal) and currently face the Issue that I need to restore it from a nandroid backup after moving from Android 5 to Android 6. Of course TitaniumBackup can restore nandroid backups, but I am not sure if it does that correctly since after restoring the app and data from the nandroid backup, I am prompted with the fresh registration screen as if I've never used the app. Uncool, I would lose tons of important messages! Solving this Issue is also important for oandbackup to know how to correctly implement feature #114.

    This is what has already been tested with the great help of @jensstein:

    • Backed up fesh APK of LibreSignal using oandbackup
    • Extracted data/org.thoughtcrime.securesms from TWRP backup named data.ext4.win000
    • Used a special version of oandbackup to convert the extracted org.thoughtcrime.securesms
    • Did a normal restore of APK and data using the special version of oandbackup

    Current result: I can open LibreSignal, yet again I am prompted with a fresh registration screen. What did I miss? How to find out which things have not been correctly restored?

    opened by SecUpwN 21
  • Can't restore some apps

    Can't restore some apps

    I get the following error. It also happens with Wallabad (non-root app).

    AdAway: pkg: /storage/emulated/0/oandbackups/org.adway-2.apk
    AdAway: Failure [INSTALL_FAILED_INVALID_URI] 
    : setPermissions error: could not find permissions for /data/data/org.adaway
    

    The permissions for /data/data are drwxrwx--x and the owner is system.

    Probably not an oab problem, but i noticed the problem with oab.

    Any hints that help me to solve this problem are appreciated.

    opened by lightonflux 20
  • Cannot restore data

    Cannot restore data

    Hi! Restoring apk works well. Restoring data after apk shows no error, but also shows no effect. No app settings. When restoring apk & data or restoring data again, i get the error ": setPermissions error: could not find permissions for /data/data/a2dp.Vol" for example. Also for every other app restore. I am using CM11 nightly without gapps.

    opened by mase76 19
  • Can't detect busybox

    Can't detect busybox

    On startup, error shows this: couldn't find busybox, please check error log

    error log shows this: sh: [1]: toybox: not found [busybox

    Recently changed from Lineage (7.1.2) to AOSP Extended (8.1). It was working fine on Lineage

    opened by swan11jf 13
  • Allow encryption of backups

    Allow encryption of backups

    I have my phone's internal storage encrypted but not my SD card. I would love to be able to make backups on a regular basis and store them on the SD card. But obviously storing them there without encryption would defeat the point.

    I propose an option in oandbackup for encrypting backups. I think it would make sense to tie this feature to a second feature I will suggest in another issue (#67): The ability to store all backups in one single archive. Since encrypting only the individual files would reduce security significantly.

    opened by ghost 13
  • Crash on launch

    Crash on launch

    oandbackup is crashing for me when getting package info, https://github.com/jensstein/oandbackup/blob/master/src/dk/jens/backup/AppInfoHelper.java#L48 appears to be the culprit.

    E/AndroidRuntime(19642): FATAL EXCEPTION: Thread-326
    E/AndroidRuntime(19642): Process: dk.jens.backup, PID: 19642
    E/AndroidRuntime(19642): java.lang.ClassCastException: android.graphics.drawable.StateListDrawable cannot be cast to android.graphics.drawable.BitmapDrawable
    E/AndroidRuntime(19642):    at dk.jens.backup.AppInfoHelper.getPackageInfo(AppInfoHelper.java:48)
    E/AndroidRuntime(19642):    at dk.jens.backup.OAndBackup$1.run(OAndBackup.java:105)
    E/AndroidRuntime(19642):    at java.lang.Thread.run(Thread.java:841)
    W/ActivityManager(  602):   Force finishing activity dk.jens.backup/.OAndBackup```
    
    opened by benpye 12
  • Restore fails (Android 9.0)

    Restore fails (Android 9.0)

    I updated my OnePlus 6 to Android 9.0 (official release) and since then oandbackup fails to restore any of my backed-up apps.

    My phone is rooted (Magisk 17.1) and I have BusyBox installed. I'm not sure what the issue is, but I attached a copy of the error log.

    error_log.txt

    opened by ghost 11
  • Restore error:

    Restore error: ": sed: No such file or directory"

    I tryed to restor made Backup from Android 5.01 to Android 6 and got these error on every restore. Intersting detail around 70% of all apps where able to restore and work without Problem.

    Installed XInternalSD (deactivated the change of the path for internal data) and have full access to my sdcard.

    screenshot_20170623-193211

    opened by Mannshoch 11
  • backup fails on cm14.1

    backup fails on cm14.1

    on cm14.1 (nougat) oandbackup does not work anymore and I can see the following two lines in logcat:

    01-08 10:57:33.465 14466 14485 E oandbackup: customlist0: error while reading logfile: org.json.JSONException: Value java.io.FileNotFoundException of type java.lang.String cannot be converted to JSONObject 01-08 10:57:33.465 14466 14485 E oandbackup: oandbackup.log: error while reading logfile: org.json.JSONException: Value java.io.FileNotFoundException of type java.lang.String cannot be converted to JSONObject

    Steps to reproduce: Install cm14.1 and oandbackup Setup toybox (/system/bin/toybox) Try to backup something (does not matter what and if APP or DATA or both) -> In my case backup starts and never ends (waited 30 minutes for a small app with no DATA) - no error message

    opened by fajabird 11
  • Prompt before overwriting old backups

    Prompt before overwriting old backups

    Currently old backups are just silently overwritten. Prompting before doing that would save a bunch of people a lot of hassle – it is all too easy to accidentally hit Backup instead of Restore.

    opened by mvglasow 0
  • Restore without root

    Restore without root

    No really file a bug, it is a question here - and don't know where else to ask:

    Can I restore app and even more important data of app without having root, but maybe with adb? Think app is always base.apk and can be installed without problem, but what about data? Is it somehow possible with adb? If so, how? Data are saved in zip. Guess cache is often not used, but what about other data?

    opened by starbrights 0
  • WeChat backup error, is not only a single backup, backup in quantity is also wrong. Backup APK is down, but won't the data backup, chat records, there is no beautiful MIUI system. Stop the lock screen function also is not normal

    WeChat backup error, is not only a single backup, backup in quantity is also wrong. Backup APK is down, but won't the data backup, chat records, there is no beautiful MIUI system. Stop the lock screen function also is not normal

    WeChat backup error, is not only a single backup, backup in quantity is also wrong. Backup APK is down, but won't the data backup, chat records, there is no beautiful MIUI system. Stop the lock screen function also is not normal

    opened by yphxp 0
  • Does Not Restore APKs - Does Not Request Permission To Install Apps On Android 11

    Does Not Restore APKs - Does Not Request Permission To Install Apps On Android 11

    On LineageOS 18.0 (Android 11) oandbackup does not restore apks because it is not requesting permission to "install unknown apps". I can not turn this on because it isn't even in the list of potential apps to do this in settings.

    When you try to restore from apk it just silently does nothing...

    opened by landry314 0
  • [Enhancement] Temporary directory for backup

    [Enhancement] Temporary directory for backup

    Hi,

    I use oandbackup extensively with scheduling frequent backup. As soon as the backup are done, I upload these with Nextcloud automatically in Android. The thing is the backup first start with uncompressed files (for data), so I have lots of random name file because it is detected by Nextcloud while oandbackup is still constructing the archive. This generated tons of failed upload in Nextcloud client because they are deleted quickly after the archive is done. The solution is quite simple in theory: it would require to set in oandbackup a different temporary directory to do all these work and do an atomic move of the archive at the end :) The temporary directory can be a parameter, or it could be /tmp as long as the directory is purged each time the archive is done to avoid space issue.

    Is-that possible? Thank you!

    opened by myroad94 1
Owner
null
Material design file manager for Android

Amaze File Manager Overview Open Source, light and smooth Based on Material Design guidelines Basic features like cut, copy, delete, compress, extract

Team Amaze 4.2k Jan 5, 2023
Demo of Downloading Songs/Images through Android Download Manager using RxJava2

Downloader Demo using RxJava Overview This project is for downloading items(songs, images etc) in Android using RxJava2. There are, however 2 conditio

Anshul Jain 168 Nov 25, 2022
An elegant and beautiful Android app manager

An elegant and beautiful Android app manager

Hamza Rizwan 250 Jan 1, 2023
Android samples built using Jetpack Window Manager for foldable and dual-screen devices like Microsoft Surface Duo.

Jetpack Window Manager samples for dual-screen and foldable devices like Microsoft Surface Duo Android app samples that use Jetpack Window Manager to

Microsoft 45 Dec 19, 2022
Ivy Wallet is an Open Source money manager app for android that you can either build or download from Google Play.

Ivy Wallet is an Open Source money manager app for android that you can either build or download from Google Play.

null 727 Dec 26, 2022
Simple Android File Manager

Simple File Manager Can also be used for browsing root files and SD card content. You can easily rename, copy, move, delete and share anything you wis

null 1 Nov 28, 2021
Download-manager - Boost AWS S3 file download for android

download-manager Boost AWS S3 file download What is DownloadManager? It is desig

Quique Ferraris 0 Feb 17, 2022
Mobile App that that enables users to manager product listing IProcure Ltd Senior Android Engineer Role interview solution

Mobile App that that enables users to manager product listing (in and e-commerce environment) IProcure Ltd Senior Android Engineer Role interview solution

Daniel Waiguru 6 Nov 1, 2022
A file manager,apk editor....

A file manager,apk editor....

FlyingYu 41 Oct 20, 2022
A handy phone call manager with phonebook, number blocking and multi-SIM support

Simple Dialer A lightweight app for handling your calls, no matter where are you. Comes with a handy call log for easy call initiation. There is a qui

Simple Mobile Tools 443 Jan 6, 2023
💰 Expense Manager is simple, intuitive, stable and modern app that is just designed for you.

Expense Manager is simple, intuitive, stable and modern app that is just designed for you. Everything you need at your fingertips to manage the expenditures and budgets.

Behzod Bozorboev 13 Oct 20, 2022
Money Manager app that helps you to add your daily small incomes and expenses and track them easily.

Simple Money Manager This app is a simple money manager app which helps you to add your daily small incomes and expenses and track them easily. Screen

Yash Bansal 2 Nov 21, 2021
Wallpaper Battle A combined online and local HD wallpaper file manager

Resplash Resplash is powered by Unsplash.com The internet’s source of freely-usable images. Powered by creators everywhere. Browse 1M+ high-res photos

null 1 Oct 19, 2021
A simple party manager app

Party App ?? Android native app using Kotlin to manage parties ?? Status: Under development ?? How to use The backend of this project can be founded h

Ítalo Sérvio 1 Dec 2, 2021
androidx window manager sample taken from the original source and modified for easy deploy and test

androidx-window-samples This project contains the WindowManager samples located in the androidx WM project location The goal of this project is to pro

Cesar Valiente 0 Nov 22, 2021
UsuageStats - Sample project for UsusageStats Manager

UsuageStats Sample project for UsusageStats Manager Add this permission in Manif

null 0 Jan 11, 2022
H4SGTAG MANAGER - CRUD that saves hashtags for social media

H4SGTAG_MANAGER CRUD that saves hashtags for social media made using android stu

Aldo Malacara 0 Jan 13, 2022
Money Manager Ex is a free, open-source, cross-platform, easy-to-use personal finance software

Money Manager Ex is a free, open-source, cross-platform, easy-to-use personal finance software. It primarily helps organize one's finances and keeps track of where, when and how the money goes.

Money Manager EX 1.2k Dec 31, 2022
MyAlarmManager - Learn to use alarm manager

MyAlarmManager belajar menggunakan alarm manager One time alarm Repeating alarm

Muhammad Beni Fajri 0 Jan 24, 2022