Git Product home page Git Product logo

android-rsync's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar ribbons avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

android-rsync's Issues

Tried to connect with SSH but it's not working.

Logs

Exit code: 12
Output: rsync: [sender] Failed to exec /data/data/com.app/.ssh/id_rsa: Permission denied (13)
rsync error: error in IPC code (code 14) at pipe.c(85) [sender=3.3.0]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [sender=3.3.0]

Here are my Public/Private keys:

Screenshot 2024-04-22 at 4 19 16 PM

My Code Block

try {
            String libDir = getReactApplicationContext().getApplicationInfo().nativeLibraryDir;
            ProcessBuilder builder;
            Process process;

            List<String> args = new ArrayList<>();
            args.add(libDir + "/librsync.so");
            // args.add("-e");
            // args.add("/data/data/com.app/.ssh/id_rsa"); // Tried with Custom path to SSH binary as well
            args.add("-avz");
            args.add("/storage/emulated/0/Pictures/Screenshots/Screenshot_2024-04-10-17-26-43-21_84d3000e3f4017145260f7618db1d683.jpg");
            args.add("[email protected]:/Users/awesomedev/rsync/"); // Tried with this path as well: ~/rsync/ then error code is 14
            builder = new ProcessBuilder(args);
            builder.redirectErrorStream(true);
            process = builder.start();

            BufferedReader inputReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
            BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
            StringBuilder output = new StringBuilder();
            StringBuilder errorOutput = new StringBuilder();
            String line;

            while ((line = inputReader.readLine()) != null) {
                output.append(line + "\n");
            }
            while ((line = errorReader.readLine()) != null) {
                errorOutput.append(line + "\n");
            }

            int exitCode = process.waitFor();
            inputReader.close();
            errorReader.close();

            Log.d("RsyncModule", "Exit code: " + process.exitValue());
            callback.invoke("Data transferred.  " + "Exit code: " + exitCode + " Output: " + output.toString() + " Errors: " + errorOutput.toString());

        } catch (IOException | InterruptedException e) {
            Log.e("RsyncModule ", "Error executing command", e);
            callback.invoke("Error executing command: " + e.getMessage());
        }

With the use of Termux or Mac everything works fine.

Screenshot_2024-04-22-12-34-07-17_84d3000e3f4017145260f7618db1d683

My Manifest permissions

Screenshot 2024-04-22 at 4 26 35 PM

With the use of the same Public/Private key I'm able to connect using Jsch.

Screenshot 2024-04-21 at 12 07 26 PM

`WARNING: linker: /data/local/tmp/rsync: unsupported flags DT_FLAGS_1=0x8000001` under Android 7 and below

Hi thanks for the lib! However it is having warnings as follows:

$ /data/local/tmp/rsync --help                                                                                                         
WARNING: linker: /data/local/tmp/rsync: unsupported flags DT_FLAGS_1=0x8000001
rsync  version 3.2.7  protocol version 31
Copyright (C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
    no socketpairs, symlinks, sy
...

Minimal Example

Thank you for your work!

This is not really a bug but i don't know where else to report this.

Is it possible that you provide a minimal code example for using your library?

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.