Skip to content

Commit

Permalink
Replace the deprecated device_info package with device_info_plus T…
Browse files Browse the repository at this point in the history
  • Loading branch information
lingol committed Mar 30, 2022
1 parent bc0f4eb commit ec26215
Show file tree
Hide file tree
Showing 17 changed files with 154 additions and 63 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# MMKV Change Log

## v1.2.13 / 2022-03-30

### Android
* Fix crash on using Ashmem while `MMKV_DISABLE_CRYPT` macro is defined.

### iOS
* Add ability to retrieve key existece while getting value, aka `-[MMKV getXXX:forKey:hasValue:]` methods.

### POSIX
* Add ability to retrieve key existece while getting value, aka `MMKV::getXXX(key, defaultValue, hasValue)` methods.

### Win32
* Add ability to retrieve key existece while getting value, aka `MMKV::getXXX(key, defaultValue, hasValue)` methods.

## v1.2.12 / 2022-01-17
### Changes for All platforms
* Fix a bug that a subsequential `clearAll()` call may fail to take effect in multi-process mode.
Expand Down
2 changes: 1 addition & 1 deletion Core/MMKVPredef.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <vector>
#include <unordered_map>

constexpr auto MMKV_VERSION = "v1.2.12";
constexpr auto MMKV_VERSION = "v1.2.13";

#ifdef DEBUG
# define MMKV_DEBUG
Expand Down
4 changes: 2 additions & 2 deletions MMKV.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKV"
s.version = "1.2.12"
s.version = "1.2.13"
s.summary = "MMKV is a cross-platform key-value storage framework developed by WeChat."

s.description = <<-DESC
Expand Down Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF" => "NO",
}

s.dependency 'MMKVCore', '~> 1.2.12'
s.dependency 'MMKVCore', '~> 1.2.13'

end

4 changes: 2 additions & 2 deletions MMKVAppExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKVAppExtension"
s.version = "1.2.12"
s.version = "1.2.13"
s.summary = "MMKV is a cross-platform key-value storage framework developed by WeChat."
s.module_name = "MMKVAppExtension"

Expand Down Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"GCC_PREPROCESSOR_DEFINITIONS" => "MMKV_IOS_EXTENSION",
}

s.dependency 'MMKVCore', '~> 1.2.12'
s.dependency 'MMKVCore', '~> 1.2.13'

end

2 changes: 1 addition & 1 deletion MMKVCore.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKVCore"
s.version = "1.2.12"
s.version = "1.2.13"
s.summary = "MMKVCore for MMKV. MMKV is a cross-platform key-value storage framework developed by WeChat."

s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions MMKVWatchExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKVWatchExtension"
s.version = "1.2.12"
s.version = "1.2.13"
s.summary = "MMKV is a cross-platform key-value storage framework developed by WeChat."
s.module_name = "MMKVWatchExtension"

Expand Down Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"GCC_PREPROCESSOR_DEFINITIONS" => "MMKV_IOS_EXTENSION",
}

s.dependency 'MMKVCore', '~> 1.2.12'
s.dependency 'MMKVCore', '~> 1.2.13'

end

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![license](https://img.shields.io/badge/license-BSD_3-brightgreen.svg?style=flat)](https://github.com/Tencent/MMKV/blob/master/LICENSE.TXT)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/MMKV/pulls)
[![Release Version](https://img.shields.io/badge/release-1.2.12-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Release Version](https://img.shields.io/badge/release-1.2.13-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Platform](https://img.shields.io/badge/Platform-%20Android%20%7C%20iOS%2FmacOS%20%7C%20Win32%20%7C%20POSIX-brightgreen.svg)](https://github.com/Tencent/MMKV/wiki/home)

中文版本请参看[这里](./README_CN.md)
Expand Down Expand Up @@ -28,8 +28,8 @@ Add the following lines to `build.gradle` on your app module:

```gradle
dependencies {
implementation 'com.tencent:mmkv:1.2.12'
// replace "1.2.12" with any available version
implementation 'com.tencent:mmkv:1.2.13'
// replace "1.2.13" with any available version
}
```

Expand Down
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ MMKV 是基于 mmap 内存映射的 key-value 组件,底层序列化/反序列

```gradle
dependencies {
implementation 'com.tencent:mmkv:1.2.12'
// replace "1.2.12" with any available version
implementation 'com.tencent:mmkv:1.2.13'
// replace "1.2.13" with any available version
}
```
从 v1.2.8 起, MMKV **迁移到 Maven Central**
Expand Down
4 changes: 4 additions & 0 deletions flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# MMKV for Flutter Change Log

## v1.2.14 / 2022-03-30
* Replace the deprecated `device_info` package with `device_info_plus`.
* Keep up with MMKV native lib v1.2.13.

## v1.2.13 / 2022-01-17
* Fix a bug that a subsequential `clearAll()` call may fail to take effect in multi-process mode.
* Hide some OpenSSL symbols to prevent link-time symbol conflict, when an App somehow also static linking OpenSSL.
Expand Down
2 changes: 1 addition & 1 deletion flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ android {
}

dependencies {
implementation 'com.tencent:mmkv-static:1.2.12'
implementation 'com.tencent:mmkv-static:1.2.13'
}
}
16 changes: 8 additions & 8 deletions flutter/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PODS:
- device_info (0.0.1):
- device_info_plus (0.0.1):
- Flutter
- Flutter (1.0.0)
- MMKV (1.2.12):
- MMKVCore (~> 1.2.12)
- MMKVCore (1.2.12)
- mmkvflutter (1.2.12):
- mmkvflutter (1.2.13):
- Flutter
- MMKV (>= 1.2.12)
- path_provider_ios (0.0.1):
- Flutter

DEPENDENCIES:
- device_info (from `.symlinks/plugins/device_info/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- Flutter (from `Flutter`)
- mmkvflutter (from `.symlinks/plugins/mmkvflutter/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
Expand All @@ -23,8 +23,8 @@ SPEC REPOS:
- MMKVCore

EXTERNAL SOURCES:
device_info:
:path: ".symlinks/plugins/device_info/ios"
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
Flutter:
:path: Flutter
mmkvflutter:
Expand All @@ -33,12 +33,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_ios/ios"

SPEC CHECKSUMS:
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
MMKV: f281020c9d9be5eb7a03ae746dc4deb570e46c23
MMKVCore: df0565f6b58463604731a68ba6cd89bc0b2d1d55
mmkvflutter: bc0bb663f20c9c8754600d57e9ab01829344a9ce
path_provider_ios: 7d7ce634493af4477d156294792024ec3485acd5
mmkvflutter: dfcdf1b58b7e4cb88a60903855a72de5a5632889
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02

PODFILE CHECKSUM: 5892152591d599b8a50589fd8872b0421e2fc7b5

Expand Down
68 changes: 54 additions & 14 deletions flutter/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
device_info:
device_info_plus:
dependency: transitive
description:
name: device_info
name: device_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
device_info_platform_interface:
version: "3.2.2"
device_info_plus_linux:
dependency: transitive
description:
name: device_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
device_info_plus_macos:
dependency: transitive
description:
name: device_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.2"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0+1"
device_info_plus_web:
dependency: transitive
description:
name: device_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
device_info_plus_windows:
dependency: transitive
description:
name: device_info_platform_interface
name: device_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.1.1"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -95,6 +123,18 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
matcher:
dependency: transitive
description:
Expand All @@ -115,7 +155,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.13"
version: "1.2.14"
path:
dependency: transitive
description:
Expand All @@ -129,21 +169,21 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.0.9"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
version: "2.0.12"
path_provider_ios:
dependency: transitive
description:
name: path_provider_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
version: "2.0.8"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -260,14 +300,14 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.5"
version: "2.5.0"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
version: "0.2.0+1"
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.5.0"
dart: ">=2.15.0 <3.0.0"
flutter: ">=2.8.0"
4 changes: 2 additions & 2 deletions flutter/ios/mmkvflutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Pod::Spec.new do |s|
s.name = 'mmkvflutter'
s.version = '1.2.12'
s.version = '1.2.13'
s.summary = 'MMKV is a cross-platform key-value storage framework developed by WeChat.'
s.description = <<-DESC
The MMKV, for Flutter.
Expand All @@ -19,7 +19,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'MMKV', '>= 1.2.12'
s.dependency 'MMKV', '>= 1.2.13'
s.platform = :ios, '9.0'

# Flutter.framework does not contain a i386 slice.
Expand Down
4 changes: 2 additions & 2 deletions flutter/lib/mmkv.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import 'dart:ffi'; // For FFI
import 'dart:io'; // For Platform.isX
import 'dart:typed_data';

import 'package:device_info/device_info.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:ffi/ffi.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -176,7 +176,7 @@ class MMKV {
} else {
final rootDirPtr = _string2Pointer(rootDir);
final androidInfo = await DeviceInfoPlugin().androidInfo;
final sdkInt = androidInfo.version.sdkInt;
final sdkInt = androidInfo.version.sdkInt ?? 0;
final cacheDir = await getTemporaryDirectory();
final cacheDirPtr = _string2Pointer(cacheDir.path);

Expand Down
Loading

0 comments on commit ec26215

Please sign in to comment.