SoFunction
Updated on 2025-04-09

How to change read permissions in Android internal storage

During development, the mobile phone needs to ROOT first, and then change the permissions through the code.

<span style="color:#330033;">public synchronized static boolean getRoot(String paramString)
	  {
	    Process process = null;
	    DataOutputStream os = null;
	    try
	    {
	      process = ().exec("su");
	      os = new DataOutputStream(());
	      (paramString + "\n");
	      ("exit\n");
	      ();
	      ();
	    } catch (Exception localException)
	    {
	      ("@@@@root cmd error:"+localException);
	      //();
	      return false;
	    }finally {
	      try {
	        if (os != null) {
	          ();
	        }
	        ();
	      } catch (Exception e) {
	      	("###root cmd error:"+e);
	      }
	    }
	    return true;
	  }</span>

Pay attention to joining permissions when quoting:

getRoot("chmod -R 777 /data/data//databases/");

The above method of changing the read permissions of Android internal storage is all the content I share with you. I hope you can give you a reference and I hope you can support me more.