diff --git a/.gitignore b/.gitignore index fd45b12..2aa3836 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,9 @@ /.idea/libraries /.idea/modules.xml /.idea/workspace.xml +gradle/ .DS_Store /build /captures .externalNativeBuild +.idea/ diff --git a/README.en.md b/README.en.md index 93c6b45..57ed437 100644 --- a/README.en.md +++ b/README.en.md @@ -24,7 +24,7 @@ implementation 'com.tongtonglock:ttlock:3.0.6' ``` - + ``` diff --git a/README.md b/README.md index c208f33..48ccba7 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ implementation 'com.tongtonglock:ttlock:3.0.6' ``` - + ``` diff --git a/app/build.gradle b/app/build.gradle index c2b76fa..6ce48b7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,3 +51,4 @@ dependencies { implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:converter-gson:2.4.0' } + diff --git a/app/local.properties b/app/local.properties new file mode 100644 index 0000000..75a20f8 --- /dev/null +++ b/app/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Fri May 15 08:53:19 CST 2020 +sdk.dir=D\:\\Users\\Administrator\\AppData\\Local\\Android\\sdk diff --git a/app/src/main/java/ttlock/demo/gateway/GatewayActivity.java b/app/src/main/java/ttlock/demo/gateway/GatewayActivity.java index 3a7fb80..84b805f 100644 --- a/app/src/main/java/ttlock/demo/gateway/GatewayActivity.java +++ b/app/src/main/java/ttlock/demo/gateway/GatewayActivity.java @@ -60,8 +60,8 @@ private void initListener() { */ @TargetApi(Build.VERSION_CODES.M) private void startScan(){ - if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, REQUEST_PERMISSION_REQ_CODE); + if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { + requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_PERMISSION_REQ_CODE); return; } getScanGatewayCallback(); @@ -98,7 +98,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { getScanGatewayCallback(); } else { - if (permissions[0].equals(Manifest.permission.ACCESS_COARSE_LOCATION)){ + if (permissions[0].equals(Manifest.permission.ACCESS_FINE_LOCATION)){ } } diff --git a/app/src/main/java/ttlock/demo/lock/ScanLockActivity.java b/app/src/main/java/ttlock/demo/lock/ScanLockActivity.java index bdf1024..22537a2 100644 --- a/app/src/main/java/ttlock/demo/lock/ScanLockActivity.java +++ b/app/src/main/java/ttlock/demo/lock/ScanLockActivity.java @@ -93,8 +93,8 @@ private void initListener(){ */ @TargetApi(Build.VERSION_CODES.M) private void startScan(){ - if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, REQUEST_PERMISSION_REQ_CODE); + if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { + requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_PERMISSION_REQ_CODE); return; } @@ -133,7 +133,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { getScanLockCallback(); } else { - if (permissions[0].equals(Manifest.permission.ACCESS_COARSE_LOCATION)){ + if (permissions[0].equals(Manifest.permission.ACCESS_FINE_LOCATION)){ } } diff --git a/app/src/main/java/ttlock/demo/wireless_keyboard/WirelessKeyboardActivity.java b/app/src/main/java/ttlock/demo/wireless_keyboard/WirelessKeyboardActivity.java index 0c5faf8..4f5d3a0 100644 --- a/app/src/main/java/ttlock/demo/wireless_keyboard/WirelessKeyboardActivity.java +++ b/app/src/main/java/ttlock/demo/wireless_keyboard/WirelessKeyboardActivity.java @@ -75,8 +75,8 @@ private void initListener(){ */ @TargetApi(Build.VERSION_CODES.M) private void startScan(){ - if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, REQUEST_PERMISSION_REQ_CODE); + if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { + requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_PERMISSION_REQ_CODE); return; } @@ -143,7 +143,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { getScanWirelessKeyboardCallback(); } else { - if (permissions[0].equals(Manifest.permission.ACCESS_COARSE_LOCATION)){ + if (permissions[0].equals(Manifest.permission.ACCESS_FINE_LOCATION)){ } } diff --git a/build.gradle b/build.gradle index ab39209..ce3d1e0 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.1' + classpath 'com.android.tools.build:gradle:3.4.1' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' @@ -31,10 +31,10 @@ ext { // Support library and architecture components support minSdk 14 and above. minSdkVersion = 18 targetSdkVersion = 23 - compileSdkVersion = 27 - buildToolsVersion = '27.0.3' + compileSdkVersion = 28 + buildToolsVersion = '28.0.3' // App dependencies - supportLibraryVersion = '27.1.1' + supportLibraryVersion = '28.0.0' lifecycle_version = "1.1.1" }