Manifest.permission.CALL_PHONE);
1557
        }
1558
    }
1559
    private boolean hasTellPermission() {
1560
        return EasyPermissions.hasPermissions(getActivity(), Manifest.permission.CALL_PHONE);
1561
    }
1562
1563
1564
    @Override
1565
    public void onPermissionsGranted(int requestCode, @NonNull @NotNull List<String> perms) {
1566
1567
    }
1568
1569
    @Override
1570
    public void onPermissionsDenied(int requestCode, List<String> perms) {
1571
        if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
1572
            // TODO add by hyg20200525
1573
            new AppSettingsDialog.Builder(DetailsFragment.this).build().show();
1574
//            new AppSettingsDialog.Builder(InputCodeActivity.this,
1575
//                    "该功能需要开启拨号权限,是否前往开启??").build().show();
1576
        }
1577
    }
1578
1531 1579
    public static String getMD5(String content) {
1532 1580
        try {
1533 1581

+ 65 - 65
app/src/main/java/com/electric/chargingpile/util/Util.java

@ -402,7 +402,7 @@ public class Util {
402 402
    }
403 403

404 404
    public static String generateDmpUrl(String url) {
405
        url = url.replace("__OS__", "android");
405
      /*  url = url.replace("__OS__", "android");
406 406
        String mac = getMac(MainApplication.context);
407 407
        if (mac != null) {
408 408
            mac = mac.replace(":", "");
@ -419,7 +419,7 @@ public class Util {
419 419

420 420
        url = url.replace("__DVCBRAND__", Build.BRAND);
421 421
        url = url.replace("__DVCMODEL__", Build.MODEL);
422

422
*/
423 423
        return url;
424 424
    }
425 425

@ -436,69 +436,69 @@ public class Util {
436 436
        return udid;
437 437
    }
438 438

439
    /**
440
     * 获取wifi的mac地址,适配到android Q
441
     *
442
     * @param paramContext
443
     * @return
444
     */
445
    private static String getMac(Context paramContext) {
446
        try {
447
            if (Build.VERSION.SDK_INT >= 23) {
448
                String str = getMacMoreThanM(paramContext);
449
                if (!TextUtils.isEmpty(str))
450
                    return str;
451
            }
452
            // 6.0以下手机直接获取wifi的mac地址即可
453
            WifiManager wifiManager = (WifiManager) paramContext.getSystemService("wifi");
454
            WifiInfo wifiInfo = wifiManager.getConnectionInfo();
455
            if (wifiInfo != null)
456
                return wifiInfo.getMacAddress();
457
        } catch (Throwable throwable) {
458
            throwable.printStackTrace();
459
        }
460
        return null;
461
    }
462

463
    /**
464
     * android 6.0+获取wifi的mac地址
465
     *
466
     * @param paramContext
467
     * @return
468
     */
469
    private static String getMacMoreThanM(Context paramContext) {
470
        try {
471
            //获取本机器所有的网络接口
472
            Enumeration enumeration = NetworkInterface.getNetworkInterfaces();
473
            while (enumeration.hasMoreElements()) {
474
                NetworkInterface networkInterface = (NetworkInterface) enumeration.nextElement();
475
                //获取硬件地址,一般是MAC
476
                byte[] arrayOfByte = networkInterface.getHardwareAddress();
477
                if (arrayOfByte == null || arrayOfByte.length == 0) {
478
                    continue;
479
                }
480

481
                StringBuilder stringBuilder = new StringBuilder();
482
                for (byte b : arrayOfByte) {
483
                    //格式化为:两位十六进制加冒号的格式,若是不足两位,补0
484
                    stringBuilder.append(String.format("%02X:", new Object[]{Byte.valueOf(b)}));
485
                }
486
                if (stringBuilder.length() > 0) {
487
                    //删除后面多余的冒号
488
                    stringBuilder.deleteCharAt(stringBuilder.length() - 1);
489
                }
490
                String str = stringBuilder.toString();
491
                // wlan0:无线网卡 eth0:以太网卡
492
                if (networkInterface.getName().equals("wlan0")) {
493
                    return str;
494
                }
495
            }
496
        } catch (SocketException socketException) {
497
            return null;
498
        }
499
        return null;
500
    }
501

439
//    /**
440
//     * 获取wifi的mac地址,适配到android Q
441
//     *
442
//     * @param paramContext
443
//     * @return
444
//     */
445
//    private static String getMac(Context paramContext) {
446
//        try {
447
//            if (Build.VERSION.SDK_INT >= 23) {
448
//                String str = getMacMoreThanM(paramContext);
449
//                if (!TextUtils.isEmpty(str))
450
//                    return str;
451
//            }
452
//            // 6.0以下手机直接获取wifi的mac地址即可
453
//            WifiManager wifiManager = (WifiManager) paramContext.getSystemService("wifi");
454
//            WifiInfo wifiInfo = wifiManager.getConnectionInfo();
455
//            if (wifiInfo != null)
456
//                return wifiInfo.getMacAddress();
457
//        } catch (Throwable throwable) {
458
//            throwable.printStackTrace();
459
//        }
460
//        return null;
461
//    }
462
//
463
//    /**
464
//     * android 6.0+获取wifi的mac地址
465
//     *
466
//     * @param paramContext
467
//     * @return
468
//     */
469
//    private static String getMacMoreThanM(Context paramContext) {
470
//        try {
471
//            //获取本机器所有的网络接口
472
//            Enumeration enumeration = NetworkInterface.getNetworkInterfaces();
473
//            while (enumeration.hasMoreElements()) {
474
//                NetworkInterface networkInterface = (NetworkInterface) enumeration.nextElement();
475
//                //获取硬件地址,一般是MAC
476
//                byte[] arrayOfByte = networkInterface.getHardwareAddress();
477
//                if (arrayOfByte == null || arrayOfByte.length == 0) {
478
//                    continue;
479
//                }
480
//
481
//                StringBuilder stringBuilder = new StringBuilder();
482
//                for (byte b : arrayOfByte) {
483
//                    //格式化为:两位十六进制加冒号的格式,若是不足两位,补0
484
//                    stringBuilder.append(String.format("%02X:", new Object[]{Byte.valueOf(b)}));
485
//                }
486
//                if (stringBuilder.length() > 0) {
487
//                    //删除后面多余的冒号
488
//                    stringBuilder.deleteCharAt(stringBuilder.length() - 1);
489
//                }
490
//                String str = stringBuilder.toString();
491
//                // wlan0:无线网卡 eth0:以太网卡
492
//                if (networkInterface.getName().equals("wlan0")) {
493
//                    return str;
494
//                }
495
//            }
496
//        } catch (SocketException socketException) {
497
//            return null;
498
//        }
499
//        return null;
500
//    }
501
//
502 502

503 503
    public static PictureParameterStyle getWhiteStyle(Context context) {
504 504
        // 相册主题

cdzApp - Gogs: Go Git Service

充电桩app代码

hy 0e5aebc0c1 将所有gradle升级至31 4 ans auparavant
..
src b98aa2e34f 代码修改 6 ans auparavant
.gitignore e1cf244fe0 remove Useless dependence 7 ans auparavant
build.gradle 0e5aebc0c1 将所有gradle升级至31 4 ans auparavant
proguard-rules.pro e1cf244fe0 remove Useless dependence 7 ans auparavant