Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8048087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:19:04+00:00 2026-06-05T06:19:04+00:00

I have a problem when I try to copy folders inside /data/data to SDcard.

  • 0

I have a problem when I try to copy folders inside /data/data to SDcard.

I have my phone rooted.

I request Superuser permissions in my app with:

Runtime.getRuntime().exec("su");

I’m using FileUtils from Apache to copy files/folders.

What I discovered is if I manually change the folders permissions to READ I can copy it from /data/data to SDcard.

Is there any way to recursively change the RW permissions of all folders inside /data/data to read and write folders?

I’ve tried chmod but It doesn’t work.

Runtime.getRuntime().exec("chmod 777 /data/data");

I want to do a backup program and i want to read some folders inside /data/data and write them in a SDcard’s folder.

Then I want to restore this folders reading them from a SDcard’s folder and write them in /data/data.

Could you help me, please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:19:06+00:00Added an answer on June 5, 2026 at 6:19 am

    At the end I got it!!!!

    I use the SuperUser process with the cp command to copy the files and folders.

    I hope you find it helpful.

    String comando = "cp -r /data/data/sourcefolder /sdcard/targetfolder";
    Process suProcess = Runtime.getRuntime().exec("su");
    DataOutputStream os = new DataOutputStream(suProcess.getOutputStream());
    os.writeBytes(comando + "\n");
    os.flush();
    os.writeBytes("exit\n");
    os.flush();
    try
    {
     int suProcessRetval = suProcess.waitFor();
     if (255 != suProcessRetval)
     {
      // Acceso Root concedido
      retval = true;
     }else
     {
      // Acceso Root denegado
      retval = false;
     }
    }
    catch (Exception ex)
    {
     Log.w("Error ejecutando el comando Root", ex);
    }
    

    Thank you very much to all the people of this forum and for all the help which you offer!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem using the SSIS. I try to import data from database
I have the problem that when I try to copy some files from php
I have a problem when I try to persist my model. An exception is
I have this problem when i try to synchronize a observable list with listbox/view
I have a problem when I try to set up Xcode . shown in
i have problem with maven. When i try to compile test classes ( mvn
I have problem with base classes in WPF. I try to make a base
I have problem with c# script who change user AD password, when try change
i am having this problem try to use the cocos2d CCScrollLayer I have added
I have a problem and I will try to explain the issue: I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.