Skip to content

Commit db8ea7a

Browse files
committed
see 04/01 log
1 parent 2b38556 commit db8ea7a

File tree

5 files changed

+15
-35
lines changed

5 files changed

+15
-35
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
* `20/03/27` [opt] publish.gradle
1+
* `20/03/31` [add] Publish v1.27.0.
2+
* `20/03/30` [add] BatteryUtils.
3+
* `20/03/27` [add] publish.gradle.
4+
* `20/03/20` [add] UtilsBridge to clean the utils.
25
* `20/01/17` [upd] Leak Canary to v2.1.
36
* `19/11/30` [add] Publish bus plugin v2.4. Publish api plugin v1.2.
47
* `19/11/28` [add] Publish v1.26.0.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ If this project helps you a lot and you want to support the project's developmen
5151

5252
[frame]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/auc_frame.png
5353

54-
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.26.0-brightgreen.svg
54+
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.27.0-brightgreen.svg
5555
[auc]: https://github.com/Blankj/AndroidUtilCode
5656

5757
[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg

lib/utilcode/src/main/java/com/blankj/utilcode/util/AppUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static boolean isAppInstalled(final String pkgName) {
106106
* @return {@code true}: yes<br>{@code false}: no
107107
*/
108108
public static boolean isAppRoot() {
109-
UtilsBridge.ShellCommandResult result = UtilsBridge.execCmd("echo root", true);
109+
ShellUtils.CommandResult result = UtilsBridge.execCmd("echo root", true);
110110
if (result.result == 0) return true;
111111
if (result.errorMsg != null) {
112112
Log.d("AppUtils", "isAppRoot() called" + result.errorMsg);

lib/utilcode/src/main/java/com/blankj/utilcode/util/DeviceUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private static InetAddress getInetAddress() {
265265
}
266266

267267
private static String getMacAddressByFile() {
268-
UtilsBridge.ShellCommandResult result = UtilsBridge.execCmd("getprop wifi.interface", false);
268+
ShellUtils.CommandResult result = UtilsBridge.execCmd("getprop wifi.interface", false);
269269
if (result.result == 0) {
270270
String name = result.successMsg;
271271
if (name != null) {

lib/utilcode/src/main/java/com/blankj/utilcode/util/UtilsBridge.java

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,11 @@ static Gson getGson4LogUtils() {
286286
///////////////////////////////////////////////////////////////////////////
287287
// ImageUtils
288288
///////////////////////////////////////////////////////////////////////////
289-
public static byte[] bitmap2Bytes(final Bitmap bitmap) {
289+
static byte[] bitmap2Bytes(final Bitmap bitmap) {
290290
return ImageUtils.bitmap2Bytes(bitmap);
291291
}
292292

293-
public static byte[] bitmap2Bytes(final Bitmap bitmap, final Bitmap.CompressFormat format, int quality) {
293+
static byte[] bitmap2Bytes(final Bitmap bitmap, final Bitmap.CompressFormat format, int quality) {
294294
return ImageUtils.bitmap2Bytes(bitmap, format, quality);
295295
}
296296

@@ -408,26 +408,26 @@ static boolean isServiceRunning(final String className) {
408408
///////////////////////////////////////////////////////////////////////////
409409
// ShellUtils
410410
///////////////////////////////////////////////////////////////////////////
411-
static ShellCommandResult execCmd(final String command, final boolean isRooted) {
412-
return ShellCommandResult.parse(ShellUtils.execCmd(command, isRooted));
411+
static ShellUtils.CommandResult execCmd(final String command, final boolean isRooted) {
412+
return ShellUtils.execCmd(command, isRooted);
413413
}
414414

415415
///////////////////////////////////////////////////////////////////////////
416416
// SizeUtils
417417
///////////////////////////////////////////////////////////////////////////
418-
public static int dp2px(final float dpValue) {
418+
static int dp2px(final float dpValue) {
419419
return SizeUtils.dp2px(dpValue);
420420
}
421421

422-
public static int px2dp(final float pxValue) {
422+
static int px2dp(final float pxValue) {
423423
return SizeUtils.px2dp(pxValue);
424424
}
425425

426-
public static int sp2px(final float spValue) {
426+
static int sp2px(final float spValue) {
427427
return SizeUtils.sp2px(spValue);
428428
}
429429

430-
public static int px2sp(final float pxValue) {
430+
static int px2sp(final float pxValue) {
431431
return SizeUtils.px2sp(pxValue);
432432
}
433433

@@ -509,27 +509,4 @@ static Uri file2Uri(final File file) {
509509
///////////////////////////////////////////////////////////////////////////
510510
static abstract class Task<T> extends ThreadUtils.SimpleTask<T> {
511511
}
512-
513-
static class ShellCommandResult {
514-
int result;
515-
String successMsg;
516-
String errorMsg;
517-
518-
private ShellCommandResult(ShellUtils.CommandResult result) {
519-
this.result = result.result;
520-
this.successMsg = result.successMsg;
521-
this.errorMsg = result.errorMsg;
522-
}
523-
524-
static ShellCommandResult parse(ShellUtils.CommandResult result) {
525-
return new ShellCommandResult(result);
526-
}
527-
528-
@Override
529-
public String toString() {
530-
return "result: " + result + "\n" +
531-
"successMsg: " + successMsg + "\n" +
532-
"errorMsg: " + errorMsg;
533-
}
534-
}
535512
}

0 commit comments

Comments
 (0)