Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .metadata
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
130 changes: 73 additions & 57 deletions android/build.gradle
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()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.15'
}
}

rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}

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.17.3'
}
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.17.3'
}
21 changes: 15 additions & 6 deletions android/src/main/AndroidManifest.xml
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>
Loading