Coder Social home page Coder Social logo

backupproject's Introduction

Android备份工具:(设备必须是已root)

1、备份数据:备份app数据到sdcard上,然后再将sdcard的数据全部压缩成压缩包,再上传到服务器。

2、还原数据:从服务器下载压缩包并进行解压,清空sdcard,解压下载的压缩包恢复sdcard数据,最后还原app数据。

技术要点:执行Linux命令、压缩和解压、FTP文件上传和文件下载。


用法

  • 备份

    new BackupManage()
        .init()
        .setContext(context)
        .setParams("192.168.31.244", "uid", "aid", "fileName")
        .backup("packageName", new IResponListener() {
            @Override
            public void onResponSuccess() {
               Log.i(TAG, "备份成功 onResponSuccess: ");
            }
    
           @Override
           public void onResponFailed(String msg) {
               Log.i(TAG, "onResponFailed: " + msg);
            }
        })
        .uploadFile(new IResponListener(){
            @Override
            public void onResponSuccess(){
            
            }
            @Override
            public void onResponFailed(String msg){
              
            }
        };
    
  • 还原

     new BackupManage()
        .init()
        .setContext(context)
        .setParams("192.168.31.244", "uid", "aid", "fileName")
        .restore("packageName", new IResponListener() {
             @Override
             public void onResponSuccess() {
                 Log.i(TAG, "恢复备份成功 onResponSuccess: ");
             }
    
             @Override
             public void onResponFailed(String msg) {
                 Log.i(TAG, "onResponFailed: " + msg);
             }
         });
    

注:本项目是参考钛备份而写的,项目中taisource就是钛备份源码,backupJar是本人写的

backupproject's People

Contributors

androidky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.