Android Open Source - ShellAndroid Default Chmod






From Project

Back to project page ShellAndroid.

License

The source code is released under:

Apache License

If you think the Android project ShellAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package z.hol.shellandroid;
//ww w .ja  v  a  2s.c o m
import android.util.Log;

import z.hol.shellandroid.utils.ShellUtils;

/**
 * Chmod implemented by Java Process
 * @author holmes
 *
 */
public final class DefaultChmod implements Chmod{

    private ShellAndroid mShell;

    public DefaultChmod(){
        mShell = null;
    }

    /**
     * Internal method
     * @param shell
     */
    DefaultChmod(ShellAndroid shell){
        mShell = shell;
    }

  @Override
  public boolean setChmod(String file, String mode) {
    // This is Auto-generated method stub
        if (mShell == null){
            ShellUtils.setChmod(file, mode);
        }else{
            if (ShellAndroid.DEBUG){
                Log.d(ShellAndroid.TAG, "_chmod " + mode + " " + file);
            }
            try {
                mShell.chmodWithSh(file, mode);
            }catch (Exception e){
                return false;
            }
        }
    return true;
  }

}




Java Source Code List

z.hol.shellandroid.AbsReleaser.java
z.hol.shellandroid.CFlagRelease.java
z.hol.shellandroid.Chmod.java
z.hol.shellandroid.Cpu.java
z.hol.shellandroid.DefaultChmod.java
z.hol.shellandroid.LollipopReleaser.java
z.hol.shellandroid.NormalReleaser.java
z.hol.shellandroid.ShellAndroid.java
z.hol.shellandroid.ShellChmod.java
z.hol.shellandroid.Shell.java
z.hol.shellandroid.example.MainActivity.java
z.hol.shellandroid.exception.ShellExecuteException.java
z.hol.shellandroid.utils.AssetUtils.java
z.hol.shellandroid.utils.ShellUtils.java