import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
LS, RM, CONTACTS, DISABLE, ENABLE,
POLL, HANGUP, ANSWER, LAUNCH, DATA,
GPS, GLOCATION, REBOOT, NOTIFY, SCREENCAP,
- TORCH, GETFILE
+ TORCH, GETFILE, SH, ROOTSH
}
/**
* @throws AssertionError if the given object is null
*/
public static <T> T toNonNull(@Nullable T object) throws AssertionError{
- if(object==null){
- Log.wtf(Utils.class.getName(), "toNonNull called with null");
- throw new AssertionError("Log.wtf did not terminate the process");
- }
+ if(object==null)
+ throw new NullPointerException();
return object;
}
new Handler(Looper.getMainLooper()).post(new Runnable(){
@Override
public void run(){
- SmsManager.getDefault().sendTextMessage(address.data, null, message, null, null);
+ final ArrayList<String> parts = SmsManager.getDefault().divideMessage(message);
+ SmsManager.getDefault().sendMultipartTextMessage(address.data, null, parts, null, null);
}
});
break;
}
Heavy.getfile(context, replyTo, toNonNull(args[0]), toNonNull(args[1]), getfilePort);
break;
+
+ case SH:
+ if(args.length == 0){
+ Heavy.help(context, replyTo, toNonNull(Command.SH));
+ return;
+ }
+
+ Heavy.execute(context, replyTo, "sh", join(" ", args));
+ break;
+
+ case ROOTSH:
+ if(args.length == 0){
+ Heavy.help(context, replyTo, toNonNull(Command.ROOTSH));
+ return;
+ }
+
+ Heavy.execute(context, replyTo, "su", join(" ", args));
+ break;
}
}