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 7027677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:16:47+00:00 2026-05-28T00:16:47+00:00

I am writing an application that will copy files from its assets directory to

  • 0

I am writing an application that will copy files from its assets directory to the Android’s /system directory.

I feel that I am getting close to achieving this, but I am not quite there. Here is the strategy that I have attempted:

First, I tried to change the permissions of the /system directory by:

Runtime.getRuntime().exec("su");
Runtime.getRuntime().exec("mount -o rw,remount -t yaffs2 /dev/block/mtdblock4");
Runtime.getRuntime().exec("chmod -R 777 /system");

Second, I tried to write a file to the /system directory.

I read that by remounting the directory, I could write files to it. Indeed, this seemed to work with a terminal. But in the application, I couldn’t figure out how to make sure each command was completed before execution of the next one.

Does anyone have any suggestions?

  • 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-05-28T00:16:48+00:00Added an answer on May 28, 2026 at 12:16 am

    I assume there is a return value from the exec() method that you should be checking to see if the execution worked fine.

    But I think you’ve got several mistakes in your attempts to execute this series of commands:

    • su can only influence its own process and child processes. You execute it with no arguments, so it does nothing. The next exec() method starts over from scratch with the exact permissions of your process, not the elevated privileges you might expect.
    • Your mount(8) command doesn’t seem right: you’re not saying which mountpoint to manipulate. (Don’t forget that a device may be mounted in multiple locations.)
    • Your chmod(1) call also doesn’t run with privileges and sets permissions way too open. Perhaps you don’t care about security on your device, that’s fine, but be certain that that is what you want.

    I believe your mount command should look more like:

    Runtime.getRuntime().exec("su -c \"mount -orw,remount /system\"");
    

    And I believe your chmod command should look more like:

    Runtime.getRuntime().exec("su -c \"chmod 777 /system/fonts\"");
    

    Again, be certain you understand the consequences of allowing all users on the system privileges to write to any file that other users can execute.

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

Sidebar

Related Questions

At the office we are currently writing an application that will generate XML files
I'm writing an application that monitors a directory for new input files by polling
I'm writing a source control application. Now I want to copy the files from
The application I am writing needs to be able to copy files that are
I am writing an application that will write database tables into CSV Files. Since
I am current writing an application that will require multiple inserts, updates and deletes
I'm writing an application that will create difficult passwords for the user. The user
I am writing a web application that will run in kiosk mode on a
I'm writing a web application that will have plugins. The plugins will be .DLL
I am writing a PHP application that will have the ability to edit settings

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.