This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
forked from pauldemarco/flutter_blue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supporting Android 12 Bluetooth permissions.
- Loading branch information
1 parent
4f0e2c3
commit c839714
Showing
8 changed files
with
496 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: f53b32eb2317ba09137969999d130c24a6314997 | ||
channel: master | ||
|
||
project_type: plugin | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
version: | ||
revision: f53b32eb2317ba09137969999d130c24a6314997 | ||
channel: master | ||
project_type: plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,74 @@ | ||
group 'com.pauldemarco.flutter_blue' | ||
version '1.0' | ||
|
||
buildscript { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:4.1.0' | ||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.15' | ||
} | ||
} | ||
|
||
rootProject.allprojects { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'com.google.protobuf' | ||
|
||
android { | ||
compileSdkVersion 30 | ||
|
||
defaultConfig { | ||
minSdkVersion 19 | ||
} | ||
sourceSets { | ||
main { | ||
proto { | ||
srcDir '../protos' | ||
} | ||
} | ||
} | ||
} | ||
|
||
protobuf { | ||
protoc { | ||
artifact = 'com.google.protobuf:protoc:3.11.4' | ||
} | ||
generateProtoTasks { | ||
all().each { task -> | ||
task.builtins { | ||
java { | ||
option "lite" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation 'com.google.protobuf:protobuf-javalite:3.11.4' | ||
group 'com.pauldemarco.flutter_blue' | ||
version '1.0' | ||
|
||
buildscript { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:4.1.0' | ||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.15' | ||
} | ||
} | ||
|
||
rootProject.allprojects { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'com.google.protobuf' | ||
|
||
android { | ||
compileSdkVersion 31 | ||
|
||
defaultConfig { | ||
minSdkVersion 19 | ||
targetSdkVersion 31 | ||
// Use Java 8 language features and APIs | ||
// https://developer.android.com/studio/write/java8-support | ||
multiDexEnabled true | ||
} | ||
|
||
compileOptions { | ||
// Use Java 8 language features and APIs | ||
// https://developer.android.com/studio/write/java8-support | ||
// Flag to enable support for the new language APIs | ||
coreLibraryDesugaringEnabled true | ||
// Sets Java compatibility to Java 8 | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
sourceSets { | ||
main { | ||
proto { | ||
srcDir '../protos' | ||
} | ||
} | ||
} | ||
} | ||
|
||
protobuf { | ||
protoc { | ||
artifact = 'com.google.protobuf:protoc:3.11.4' | ||
} | ||
generateProtoTasks { | ||
all().each { task -> | ||
task.builtins { | ||
java { | ||
option "lite" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' | ||
implementation 'com.google.protobuf:protobuf-javalite:3.11.4' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.pauldemarco.flutter_blue"> | ||
<uses-permission android:name="android.permission.BLUETOOTH" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> | ||
</manifest> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pauldemarco.flutter_blue"> | ||
<!-- New Bluetooth permissions in Android 12 | ||
https://developer.android.com/about/versions/12/features/bluetooth-permissions | ||
--> | ||
<!-- Include "neverForLocation" only if you can strongly assert that | ||
your app never derives physical location from Bluetooth scan results. --> | ||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> | ||
|
||
<!-- Request legacy Bluetooth permissions on older devices. --> | ||
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" /> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.