[Java for Android App Development] LittlEvil:
There are some app required root busy box deodex i have wrote some java that will help you to know that the phone is rooted , busy box available , deodex

First You need to make New Java Named Logger

Content are below

/*
* This File is Part of Almas Api
*
* Copyright (c) 2015 Sahid S Almas
*
* This code are licensed under the terms of the Apache License Version 2.0
* You may use this code according to either of these licenses as is most appropriate
* for your project on a case-by-case basis.
*/
package sahidsalmas.api.internel;

import android.util.Log;
import java.util.ArrayList;

public class Logger {
private ArrayList<String> mDebugLogs = new ArrayList<>();
private ArrayList<String> mErrorLogs = new ArrayList<>();
private ArrayList<String> mInfoLogs = new ArrayList<>();
private int DLogs = 0;
private int ELogs = 0;
private int ILogs = 0;
private String TAG_NAME;
public Logger(String nam) {
setTAG_NAME(nam);
}
public void addDLogs(String logs) {
DLogs++;
mDebugLogs.add(logs);
}
public void addELogs(String logs) {
ELogs++;
mErrorLogs.add(logs);
}
public void addILogs(String logs) {
ILogs++;
mInfoLogs.add(logs);
}
public void execute() {
if (DLogs > 0) {
for (int i = 0 ; i < DLogs;i++) {
Log.d(getTAG_NAME(),mDebugLogs.get(i));

}
}
if (ELogs > 0) {
for (int i = 0 ; i < ELogs;i++) {
Log.e(getTAG_NAME(),mErrorLogs.get(i));

}
}
if (ILogs > 0) {
for (int i = 0 ; i < ILogs;i++) {
Log.i(getTAG_NAME(),mInfoLogs.get(i));

}
}
}

private String getTAG_NAME() {
return TAG_NAME;
}

private void setTAG_NAME(String TAG_NAME) {
this.TAG_NAME = TAG_NAME;
}
}

Make RootInfo Java

Content are below

/*
* This File is Part of Almas Api
*
* Copyright (c) 2015 Sahid S Almas
*
* This code are licensed under the terms of the Apache License Version 2.0
* You may use this code according to either of these licenses as is most appropriate
* for your project on a case-by-case basis.
*/
package sahidsalmas.api.internel;

import java.io.File;
import java.util.ArrayList;

public class RootInfo {

static Logger mLogger = new Logger("RootInfo");

/**
* Logger used to logs to the android system
*/

public static boolean isRooted() {
Process mProcess = null;
boolean mRoot;
try {
// This is executing on terminal
mProcess = Runtime.getRuntime().exec("su");
mRoot = true;
mLogger.addDLogs("Rooted Phone");
// If the execute successfully then it return to true

} catch (Exception e) {
// if is not successfully then it return to false
mRoot = false;
mLogger.addELogs("Unrooted Phone");
} finally {
if (mProcess != null) {
try {
mProcess.destroy();
} catch (Exception ignored) {
}
}
}
mLogger.execute();
return mRoot;
}
public static boolean isRooted2() {
/*
* This is the another method to know
* that the phone is rooted or not
*/
mLogger.addDLogs("Trying to know that the phone is rooted " +
"or not by another method");
File mFile = new File("/system/bin/su");

File mFile1 = new File("/system/xbin/su");
boolean isRooted = false;
ArrayList<File> mFileList = new ArrayList<>();
mFileList.add(mFile);
mFileList.add(mFile1);
/*
* In the mFileList we added to file
* to arrary to run loop and check does it
* exists or not exists return to the isRooted2();
*/
for (int i = 0 ; i < mFileList.size();i++) {
if (mFileList.get(i).exists()) {
isRooted = true;
mLogger.addDLogs("The phone is rooted");
}
else {
isRooted = false;
mLogger.addELogs("The phone is not rooted");
}

}
mLogger.execute();
return isRooted;
}

}

Make BusyboxInfo Java

Content are below

/*
* This File is Part of Almas Api
*
* Copyright (c) 2015 Sahid S Almas
*
* This code are licensed under the terms of the Apache License Version 2.0
* You may use this code according to either of these licenses as is most appropriate
* for your project on a case-by-case basis.
*/
package sahidsalmas.api.internel;

import java.io.File;
import java.util.ArrayList;

public class BusyboxInfo {

static Logger mLogger = new Logger("BusyBox");

/**
* Logger used to logs to the android system
*/

public static boolean isBusyBoxAvai() {
Process mProcess = null;
boolean mBusyBox;
try {
// This is executing on terminal
mProcess = Runtime.getRuntime().exec("busybox");
mBusyBox = true;
mLogger.addDLogs("BusyBox found");
// If the execute successfully then it return to true

} catch (Exception e) {
// if is not successfully then it return to false
mBusyBox = false;
mLogger.addELogs("Busybox not found");
} finally {
if (mProcess != null) {
try {
mProcess.destroy();
} catch (Exception ignored) {
}
}
}
mLogger.execute();
return mBusyBox;
}
public static boolean isBusyBoxAvai2() {
/*
* This is the another method to know
* that the phone is rooted or not
*/
mLogger.addDLogs("Trying to know that the phone is busybox " +
"is available or not");
File mFile = new File("/system/bin/buxybox");

File mFile1 = new File("/system/xbin/buxybox");
boolean Bu = false;
ArrayList<File> mFileList = new ArrayList<>();
mFileList.add(mFile);
mFileList.add(mFile1);
/*
* In the mFileList we added to file
* to arrary to run loop and check does it
* exists or not exists return to the isRooted2();
*/
for (int i = 0 ; i < mFileList.size();i++) {
if (mFileList.get(i).exists()) {
Bu = true;
mLogger.addDLogs("BusyBox found");
}
else {
Bu = false;
mLogger.addELogs(" BusyBox not found ");
}

}
mLogger.execute();
return Bu;
}

}

Make DexInfo Java

Content are below

/*
* This File is Part of Almas Api
*
* Copyright (c) 2015 Sahid S Almas
*
* This code are licensed under the terms of the Apache License Version 2.0
* You may use this code according to either of these licenses as is most appropriate
* for your project on a case-by-case basis.
*/
package sahidsalmas.api.internel;

import java.io.File;

public class DexInfo {
/*
* This Java Only Say that the system apk are odex or deodex
* it does not make system apps to odex or deodex
*/
public static Logger mLogger = new Logger("DexInfo");

public static boolean isDeodex() {
boolean Deodex = false;
mLogger.addDLogs("Trying to know that phone is deodex or not");
File mFileDirec = new File("/system/app/");
File[] AllFiles;
AllFiles = mFileDirec.listFiles();
for (File AllFile : AllFiles) {
if (AllFile.getPath().endsWith(".odex"))
Deodex = false;
else {
Deodex = true;

}

}
if (Deodex) {
mLogger.addDLogs("The system apk are deodex");
}
else {
mLogger.addDLogs("The system apk are not deodex");
}
mLogger.execute();
return Deodex;
}
public static boolean isOdex() {
boolean Odex = false;
mLogger.addDLogs("Trying to know that phone is odex or not");
File mFileDirec = new File("/system/app/");
File[] AllFiles;
AllFiles = mFileDirec.listFiles();
for (File AllFile : AllFiles) {
if (AllFile.getPath().endsWith(".odex")) {
Odex = true;

} else {
Odex = false;
}
}
if (Odex) {
mLogger.addDLogs("The system apk are odex");
}
else {
mLogger.addDLogs("The system apk are not odex");
}

mLogger.execute();
return Odex;
}
}

How to use

In this java all the method are static just you need to call like this

RootInfo.isRooted();
RootInfo.isRooted2();
BusyboxInfo.isBusyBoxAvai2();
BusyboxInfo.isBusyBoxAvai();
DexInfo.isDeodex();
DexInfo.isOdex();