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
100 changes: 50 additions & 50 deletions .dart_tool/package_config_subset
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
async
3.4
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/async-2.12.0/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/async-2.12.0/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/async-2.12.0/
file:///home/slayer/.pub-cache/hosted/pub.dev/async-2.12.0/lib/
boolean_selector
3.1
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2/
file:///home/slayer/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2/lib/
characters
3.4
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/characters-1.4.0/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/characters-1.4.0/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/characters-1.4.0/
file:///home/slayer/.pub-cache/hosted/pub.dev/characters-1.4.0/lib/
clock
3.4
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/clock-1.1.2/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/clock-1.1.2/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/clock-1.1.2/
file:///home/slayer/.pub-cache/hosted/pub.dev/clock-1.1.2/lib/
collection
3.4
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/collection-1.19.1/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/collection-1.19.1/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/collection-1.19.1/
file:///home/slayer/.pub-cache/hosted/pub.dev/collection-1.19.1/lib/
fake_async
3.3
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/fake_async-1.3.2/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/fake_async-1.3.2/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/fake_async-1.3.2/
file:///home/slayer/.pub-cache/hosted/pub.dev/fake_async-1.3.2/lib/
leak_tracker
3.2
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/leak_tracker-10.0.8/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/leak_tracker-10.0.8/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/leak_tracker-10.0.8/
file:///home/slayer/.pub-cache/hosted/pub.dev/leak_tracker-10.0.8/lib/
leak_tracker_flutter_testing
3.2
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.9/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.9/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.9/
file:///home/slayer/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.9/lib/
leak_tracker_testing
3.2
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.1/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.1/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.1/
file:///home/slayer/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.1/lib/
matcher
3.4
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/matcher-0.12.17/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/matcher-0.12.17/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/matcher-0.12.17/
file:///home/slayer/.pub-cache/hosted/pub.dev/matcher-0.12.17/lib/
material_color_utilities
2.17
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1/
file:///home/slayer/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1/lib/
meta
2.12
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/meta-1.16.0/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/meta-1.16.0/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/meta-1.16.0/
file:///home/slayer/.pub-cache/hosted/pub.dev/meta-1.16.0/lib/
path
3.4
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/path-1.9.1/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/path-1.9.1/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/path-1.9.1/
file:///home/slayer/.pub-cache/hosted/pub.dev/path-1.9.1/lib/
source_span
3.1
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/source_span-1.10.1/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/source_span-1.10.1/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/source_span-1.10.1/
file:///home/slayer/.pub-cache/hosted/pub.dev/source_span-1.10.1/lib/
stack_trace
3.4
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/stack_trace-1.12.1/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/stack_trace-1.12.1/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/stack_trace-1.12.1/
file:///home/slayer/.pub-cache/hosted/pub.dev/stack_trace-1.12.1/lib/
stream_channel
3.3
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/stream_channel-2.1.4/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/stream_channel-2.1.4/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/stream_channel-2.1.4/
file:///home/slayer/.pub-cache/hosted/pub.dev/stream_channel-2.1.4/lib/
string_scanner
3.1
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/string_scanner-1.4.1/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/string_scanner-1.4.1/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/string_scanner-1.4.1/
file:///home/slayer/.pub-cache/hosted/pub.dev/string_scanner-1.4.1/lib/
term_glyph
3.1
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/term_glyph-1.2.2/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/term_glyph-1.2.2/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/term_glyph-1.2.2/
file:///home/slayer/.pub-cache/hosted/pub.dev/term_glyph-1.2.2/lib/
test_api
3.5
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/test_api-0.7.4/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/test_api-0.7.4/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/test_api-0.7.4/
file:///home/slayer/.pub-cache/hosted/pub.dev/test_api-0.7.4/lib/
vector_math
2.14
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/vector_math-2.1.4/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/vector_math-2.1.4/
file:///home/slayer/.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/
vm_service
3.3
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/vm_service-14.3.1/
file:///Users/jinbolu/.pub-cache/hosted/pub.dev/vm_service-14.3.1/lib/
file:///home/slayer/.pub-cache/hosted/pub.dev/vm_service-14.3.1/
file:///home/slayer/.pub-cache/hosted/pub.dev/vm_service-14.3.1/lib/
ttlock_flutter
2.12
file:///Users/jinbolu/Documents/Work/ttlock_flutter/
file:///Users/jinbolu/Documents/Work/ttlock_flutter/lib/
file:///home/slayer/Desktop/freelance_projects/ttlock_flutter/
file:///home/slayer/Desktop/freelance_projects/ttlock_flutter/lib/
sky_engine
3.7
file:///opt/homebrew/Caskroom/flutter/3.29.3/flutter/bin/cache/pkg/sky_engine/
file:///opt/homebrew/Caskroom/flutter/3.29.3/flutter/bin/cache/pkg/sky_engine/lib/
file:///home/slayer/flutter/bin/cache/pkg/sky_engine/
file:///home/slayer/flutter/bin/cache/pkg/sky_engine/lib/
flutter
3.7
file:///opt/homebrew/Caskroom/flutter/3.29.3/flutter/packages/flutter/
file:///opt/homebrew/Caskroom/flutter/3.29.3/flutter/packages/flutter/lib/
file:///home/slayer/flutter/packages/flutter/
file:///home/slayer/flutter/packages/flutter/lib/
flutter_test
3.7
file:///opt/homebrew/Caskroom/flutter/3.29.3/flutter/packages/flutter_test/
file:///opt/homebrew/Caskroom/flutter/3.29.3/flutter/packages/flutter_test/lib/
file:///home/slayer/flutter/packages/flutter_test/
file:///home/slayer/flutter/packages/flutter_test/lib/
2
2 changes: 1 addition & 1 deletion .dart_tool/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.29.3
3.35.7
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ build

.DS_Store
.packages
**/.cxx
.dart_tool

9 changes: 7 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@ rootProject.allprojects {
google()
jcenter()
flatDir {
dirs 'libs'
dirs project(':ttlock_flutter').file('libs')
}
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 31
ndkVersion "29.0.13113456 rc1"
if (project.android.hasProperty("namespace")) {
namespace 'com.ttlock.ttlock_flutter'
}

compileSdkVersion 36
namespace 'com.ttlock.ttlock_flutter'
defaultConfig {
minSdkVersion 18
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 04 09:25:22 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file modified android/libs/ttlock-release.aar
Binary file not shown.
25 changes: 9 additions & 16 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,12 +22,9 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 34

compileSdkVersion 36
ndkVersion "29.0.13113456 rc1"
lintOptions {
disable 'InvalidPackage'
}
Expand All @@ -35,7 +33,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.ttlock.ttlock_flutter_example"
minSdkVersion flutter.minSdkVersion
targetSdkVersion 34
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -56,11 +54,6 @@ android {
}
namespace 'com.ttlock.ttlock_flutter_example'
}
repositories {
flatDir {
dirs 'libs', '..\\..\\..\\android\\libs'
}
}

flutter {
source '../..'
Expand Down
16 changes: 0 additions & 16 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
buildscript {
ext {

agp_version = '8.6.0'
}
repositories {
mavenCentral()
google()
jcenter()
}

dependencies {
classpath "com.android.tools.build:gradle:$agp_version"
}
}

allprojects {
repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Feb 06 11:31:35 CST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
30 changes: 22 additions & 8 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.12.2' apply false
id "org.jetbrains.kotlin.android" version "2.2.10" apply false
}

include ":app"
32 changes: 32 additions & 0 deletions example/ios/Flutter/ephemeral/flutter_lldb_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Generated file, do not edit.
#

import lldb

def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
base = frame.register["x0"].GetValueAsAddress()
page_len = frame.register["x1"].GetValueAsUnsigned()

# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
# first page to see if handled it correctly. This makes diagnosing
# misconfiguration (e.g. missing breakpoint) easier.
data = bytearray(page_len)
data[0:8] = b'IHELPED!'

error = lldb.SBError()
frame.GetThread().GetProcess().WriteMemory(base, data, error)
if not error.Success():
print(f'Failed to write into {base}[+{page_len}]', error)
return

def __lldb_init_module(debugger: lldb.SBDebugger, _):
target = debugger.GetDummyTarget()
# Caveat: must use BreakpointCreateByRegEx here and not
# BreakpointCreateByName. For some reasons callback function does not
# get carried over from dummy target for the later.
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
bp.SetAutoContinue(True)
print("-- LLDB integration loaded --")
5 changes: 5 additions & 0 deletions example/ios/Flutter/ephemeral/flutter_lldbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Generated file, do not edit.
#

command script import --relative-to-command-file flutter_lldb_helper.py
28 changes: 12 additions & 16 deletions example/lib/key_pad_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:ttlock_flutter/ttelectricMeter.dart';
import 'package:bmprogresshud/progresshud.dart';
import 'package:ttlock_flutter/ttlock.dart';
import 'package:ttlock_flutter/ttremoteKeypad.dart';
Expand Down Expand Up @@ -79,21 +78,18 @@ class _KeyPadState extends State<KeyPadPage> {
});
break;
case Command.addFingerprint:
TTRemoteKeypad.addFingerprint(mac,
null,
1746673751000,
1746760151000,
lockData,
(int currentCount, int totalCount){
print("addFingerprint;;;currentCount:$currentCount;;;;totalCount:$totalCount");
}, (String fingerprintNumber) {
print("addFingerprint fingerprintNumber:$fingerprintNumber");
}, (errorCode, errorMsg) {
print("addFingerprint;;;errorCode:$errorCode;;;;errorMsg:$errorMsg");

}, (TTRemoteKeyPadAccessoryError errorCode, String errorMsg){
print("addFingerprint;;;errorCode:$errorCode;;;;errorMsg:$errorMsg");
});
TTRemoteKeypad.addFingerprint(
mac, null, 1746673751000, 1746760151000, lockData,
(int currentCount, int totalCount) {
print(
"addFingerprint;;;currentCount:$currentCount;;;;totalCount:$totalCount");
}, (String fingerprintNumber) {
print("addFingerprint fingerprintNumber:$fingerprintNumber");
}, (errorCode, errorMsg) {
print("addFingerprint;;;errorCode:$errorCode;;;;errorMsg:$errorMsg");
}, (TTRemoteKeyPadAccessoryError errorCode, String errorMsg) {
print("addFingerprint;;;errorCode:$errorCode;;;;errorMsg:$errorMsg");
});
break;
case Command.addCard:
break;
Expand Down
Loading