public class Util
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
AES_BLOCK_SIZE |
static org.json.JSONObject |
EMPTY_JSON |
static long |
SECS_PER_DAY |
static long |
SECS_PER_HOUR |
static long |
SECS_PER_MINUTE |
static long |
SECS_PER_WEEK |
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
AES_decrypt(byte[] input,
byte[] key) |
static byte[] |
AES_decrypt(byte[] input,
byte[] key,
byte[] iv) |
static byte[] |
AES_decrypt(byte[] input,
byte[] key,
byte[] iv,
boolean padding) |
static byte[] |
AES_encrypt(byte[] input,
byte[] key) |
static android.net.Uri.Builder |
appendQueryParametersFromJSON(android.net.Uri.Builder uri,
org.json.JSONObject json) |
static long |
CRC32(byte[] bytes,
int length) |
static java.lang.String |
dateString(java.util.Date date,
java.lang.String format) |
static java.lang.String |
dateString(java.util.Date date,
java.lang.String format,
java.util.Locale locale,
java.util.TimeZone timezone) |
static long |
DAYS(long days) |
static java.lang.String |
format(double value,
int precision) |
static java.text.DateFormat |
formatter(java.lang.String format,
java.util.Locale locale,
java.util.TimeZone timezone) |
static java.lang.Object |
getExtra(android.content.Intent intent,
java.lang.String extra) |
static android.content.Intent |
getLaunchIntent(android.content.Context context) |
static boolean |
getNotificationsBlocked(android.content.Context context) |
static boolean |
getNotificationsSilent(android.content.Context context) |
static boolean |
hasPermission(android.content.Context context,
java.lang.String permission) |
static java.lang.String |
hexdigest(byte[] input) |
static byte[] |
hmac_sha1(java.lang.String data,
java.lang.String key) |
static byte[] |
HMAC_SHA256(java.lang.String data,
java.lang.String key) |
static long |
HOURS(long hours) |
static android.content.Intent |
intentForURL(android.content.Context context,
android.net.Uri url) |
static org.json.JSONArray |
jsonConcat(org.json.JSONArray sourceArray,
org.json.JSONArray addArray) |
static org.json.JSONObject |
jsonFromBase64(java.lang.String base64JSON) |
static org.json.JSONObject |
jsonPut(org.json.JSONObject json,
java.lang.String key,
java.lang.Object value) |
static boolean |
listContainsString_nocase(java.util.List<java.lang.String> list,
java.lang.String value) |
static long |
MINUTES(long minutes) |
static org.json.JSONObject |
putAll(org.json.JSONObject into,
org.json.JSONObject all) |
static java.lang.String |
randomString(int length) |
static long |
SECONDS(long seconds) |
static void |
setMenuIconColors(android.view.Menu menu,
int color) |
static void |
setToolbarForegroundColor(Toolbar toolbar,
int color) |
static java.lang.String |
SHA1(java.lang.String input) |
static byte[] |
SHA256(byte[] input) |
static byte[] |
SHA256(java.lang.String input) |
static java.lang.String[] |
stringArray(org.json.JSONArray jsonArray) |
static java.lang.String[] |
stringArray(java.lang.Object values) |
static java.lang.String[] |
stringArray(java.lang.String values,
java.lang.String separator) |
static java.lang.String |
timestamp_RFC339() |
static java.lang.String |
timestamp_RFC339(long time) |
static java.lang.String |
timestamp() |
static java.lang.String |
timestamp(long time) |
static java.lang.String |
toBase64(java.lang.Object o) |
static boolean |
toBoolean(java.lang.Object value) |
static byte[] |
toBytes(java.io.InputStream input) |
static byte[] |
toBytesFromHex(java.lang.String hexString) |
static java.lang.String |
toHexDump(byte[] input,
int width) |
static java.lang.String |
toHexString(byte[] input) |
static java.lang.String |
toHexString(byte[] input,
int offset,
int length) |
static org.json.JSONObject |
toJSON(android.os.Bundle bundle) |
static org.json.JSONObject |
toJSON(android.os.Bundle bundle,
java.lang.String prefix) |
static org.json.JSONObject |
toJSON(java.lang.Object... pvpairs) |
static java.lang.String |
toString(android.os.Bundle b) |
static java.lang.String |
toString(java.io.InputStream input) |
static java.lang.String |
toString(java.lang.Object o) |
static boolean |
tryClose(java.io.Closeable closeable) |
static org.json.JSONObject |
tryJSON(java.lang.String jsonString) |
static org.json.JSONObject |
tryJSON(java.lang.String jsonString,
org.json.JSONObject defaultValue) |
static org.json.JSONArray |
tryJSONArray(java.lang.String jsonArrayString) |
static boolean |
trySleep(long millis) |
static android.net.Uri |
tryUri(java.lang.String surl) |
static java.net.URI |
tryURI(java.lang.String url) |
static java.lang.String |
ts() |
static java.lang.String |
ts(long time) |
public static long SECS_PER_MINUTE
public static long SECS_PER_HOUR
public static long SECS_PER_DAY
public static long SECS_PER_WEEK
public static final org.json.JSONObject EMPTY_JSON
public static final int AES_BLOCK_SIZE
public static long SECONDS(long seconds)
public static long MINUTES(long minutes)
public static long HOURS(long hours)
public static long DAYS(long days)
public static java.text.DateFormat formatter(java.lang.String format,
java.util.Locale locale,
java.util.TimeZone timezone)
public static java.lang.String dateString(java.util.Date date,
java.lang.String format,
java.util.Locale locale,
java.util.TimeZone timezone)
public static java.lang.String dateString(java.util.Date date,
java.lang.String format)
public static java.lang.String ts(long time)
public static java.lang.String ts()
public static java.lang.String timestamp_RFC339(long time)
public static java.lang.String timestamp_RFC339()
public static java.lang.String timestamp(long time)
public static java.lang.String timestamp()
public static java.lang.String format(double value,
int precision)
public static boolean trySleep(long millis)
public static byte[] toBytes(java.io.InputStream input)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String toString(java.io.InputStream input)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String toString(android.os.Bundle b)
public static java.lang.String toString(java.lang.Object o)
public static java.lang.String toBase64(java.lang.Object o)
public static android.net.Uri tryUri(java.lang.String surl)
public static java.net.URI tryURI(java.lang.String url)
public static boolean tryClose(java.io.Closeable closeable)
public static org.json.JSONObject putAll(org.json.JSONObject into,
org.json.JSONObject all)
public static android.net.Uri.Builder appendQueryParametersFromJSON(android.net.Uri.Builder uri,
org.json.JSONObject json)
public static org.json.JSONObject toJSON(android.os.Bundle bundle,
java.lang.String prefix)
public static boolean toBoolean(java.lang.Object value)
public static org.json.JSONObject toJSON(android.os.Bundle bundle)
public static org.json.JSONObject toJSON(java.lang.Object... pvpairs)
public static org.json.JSONObject tryJSON(java.lang.String jsonString,
org.json.JSONObject defaultValue)
public static org.json.JSONObject tryJSON(java.lang.String jsonString)
public static org.json.JSONArray tryJSONArray(java.lang.String jsonArrayString)
public static org.json.JSONObject jsonFromBase64(java.lang.String base64JSON)
public static org.json.JSONArray jsonConcat(org.json.JSONArray sourceArray,
org.json.JSONArray addArray)
public static org.json.JSONObject jsonPut(org.json.JSONObject json,
java.lang.String key,
java.lang.Object value)
public static java.lang.String[] stringArray(org.json.JSONArray jsonArray)
public static java.lang.String[] stringArray(java.lang.String values,
java.lang.String separator)
public static java.lang.String[] stringArray(java.lang.Object values)
public static boolean listContainsString_nocase(java.util.List<java.lang.String> list,
java.lang.String value)
public static java.lang.Object getExtra(android.content.Intent intent,
java.lang.String extra)
public static java.lang.String toHexString(byte[] input,
int offset,
int length)
public static java.lang.String toHexString(byte[] input)
public static java.lang.String toHexDump(byte[] input,
int width)
public static byte[] toBytesFromHex(java.lang.String hexString)
public static java.lang.String hexdigest(byte[] input)
public static java.lang.String randomString(int length)
public static long CRC32(byte[] bytes,
int length)
public static byte[] HMAC_SHA256(java.lang.String data,
java.lang.String key)
public static byte[] SHA256(byte[] input)
public static byte[] SHA256(java.lang.String input)
public static java.lang.String SHA1(java.lang.String input)
public static byte[] hmac_sha1(java.lang.String data,
java.lang.String key)
public static byte[] AES_decrypt(byte[] input,
byte[] key)
public static byte[] AES_decrypt(byte[] input,
byte[] key,
byte[] iv)
public static byte[] AES_decrypt(byte[] input,
byte[] key,
byte[] iv,
boolean padding)
public static byte[] AES_encrypt(byte[] input,
byte[] key)
public static boolean hasPermission(android.content.Context context,
java.lang.String permission)
public static boolean getNotificationsBlocked(android.content.Context context)
public static boolean getNotificationsSilent(android.content.Context context)
public static android.content.Intent intentForURL(android.content.Context context,
android.net.Uri url)
public static android.content.Intent getLaunchIntent(android.content.Context context)
public static void setMenuIconColors(android.view.Menu menu,
int color)
public static void setToolbarForegroundColor(Toolbar toolbar,
int color)