6 Star 4 Fork 1

HarmonyOS-TPC / hawk

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Hawk

Hawk,Secure, simple key-value storage for OpenHarmonyOS

图片

引入方式

通过DevEco studio 2.0+,并下载SDK Native 版本2.0+ 方式一 在entry的gradle中集成如下操作: 如果使用har,请将har放到entry中的libs 修改implementation fileTree(dir: 'libs', include: ['.jar','.har'])增加*.har

如果引入lib中的har包,请引入 compile 'com.google.code.gson:gson:2.8.2'

compile 'com.google.code.gson:gson:2.8.2'

方式二:

allprojects{
    repositories{
        mavenCentral()
    }
}
implementation 'io.openharmony.tpc.thirdlib:hawk:1.0.2'

Initialize

Hawk.init(context).build();

Usage

Save any type (Any object, primitives, lists, sets, maps ...)

Hawk.put(key, T);

Get the original value with the original type

T value = Hawk.get(key);

Delete any entry

Hawk.delete(key);

Check if any key exists

Hawk.contains(key);

Check total entry count

Hawk.count();

Get crazy and delete everything

Hawk.deleteAll();

More options

  • Everything is pluggable, therefore you can change any layer with your custom implementation.
  • NoEncryption implementation is provided out of box If you want to disable crypto.
Hawk.init(context)
  .setEncryption(new NoEncryption())
  .setLogInterceptor(new MyLogInterceptor())
  .setConverter(new MyConverter())
  .setParser(new MyParser())
  .setStorage(new MyStorage())
  .build();

Entry运行要求

通过DevEco studio,并下载SDK 将项目中的build.gradle文件中dependencies→classpath版本改为对应的版本(即你的IDE新建项目中所用的版本)

License

Copyright 2016 Orhan Obut

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Repository Comments ( 0 )

Sign in to post a comment

About

Hawk,Secure, simple key-value storage for OpenHarmonyOS expand collapse
Java
Apache-2.0
Cancel

Releases

No release

hawk

Contributors

All

Activities

Load More
can not load any more
1
https://toscode.gitee.com/HarmonyOS-tpc/hawk.git
git@toscode.gitee.com:HarmonyOS-tpc/hawk.git
HarmonyOS-tpc
hawk
hawk
master

Search

挂件 关闭按钮