diff --git a/.buildscripts/build-and-deploy-snapshot.sh b/.buildscripts/build-and-deploy-snapshot.sh deleted file mode 100755 index e8ca6a13bc9c72e980bf0c29f0df2b7041d4ed1b..0000000000000000000000000000000000000000 --- a/.buildscripts/build-and-deploy-snapshot.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -echo -e "\033[0;32m ./gradlew :securestoragelibrary:clean \033[0m" -./gradlew :securestoragelibrary:clean --stacktrace - -echo -e "\033[0;32m ./gradlew :securestoragelibrary:install \033[0m" -./gradlew :securestoragelibrary:build --stacktrace - -echo -e "\033[0;32m ./gradlew :securestoragelibrary:bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_API_KEY -PdryRun=false \033[0m" -./gradlew :securestoragelibrary:bintrayUpload -PbintrayUser="$BINTRAY_USERNAME" -PbintrayKey="$BINTRAY_API_KEY" -PdryRun=false --stacktrace \ No newline at end of file diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index 2d72ee5bd4caff1b2903837838bc11783c4272df..0000000000000000000000000000000000000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: SecureStorage Pull Request Workflow - -on: - pull_request: - branches-ignore: - - 'gh-pages' - -jobs: - assemble: - name: AssembleDebug SecureStorage - runs-on: macOS-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: AssembleDebug SecureStorage - run: bash ./gradlew assembleDebug --stacktrace - - test: - needs: assemble - name: Test SecureStorage - runs-on: macOS-latest - strategy: - matrix: - api-level: [21, 22, 23, 25, 29] - target: [default] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Test SecureStorage - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ matrix.api-level }} - target: ${{ matrix.target }} - arch: x86_64 - profile: Nexus 6 - script: ./gradlew connectedAndroidTest --stacktrace \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index 4a25a64a911d68313dc2b31327639c0646e1308f..0000000000000000000000000000000000000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: SecureStorage Push Workflow - -on: - push: - branches-ignore: - - 'gh-pages' - -jobs: - assemble: - name: AssembleDebug SecureStorage - runs-on: macOS-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: AssembleDebug SecureStorage - run: bash ./gradlew assembleDebug --stacktrace \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml deleted file mode 100644 index e8bb0759a6f1204d656a6409576637726bb8db5d..0000000000000000000000000000000000000000 --- a/.github/workflows/tag.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: SecureStorage Tag Workflow - -on: - push: - branches: - - master - tags: - - '*' - -jobs: - assemble: - name: AssembleDebug SecureStorage - runs-on: macOS-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: AssembleDebug SecureStorage - run: bash ./gradlew assembleDebug --stacktrace - - test: - needs: assemble - name: Test SecureStorage - runs-on: macOS-latest - strategy: - matrix: - api-level: [21, 22, 23, 25, 29] - target: [default] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Test SecureStorage - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ matrix.api-level }} - target: ${{ matrix.target }} - arch: x86_64 - profile: Nexus 6 - script: ./gradlew connectedAndroidTest --stacktrace - - publish: - needs: [assemble, test] - name: Publish SecureStorage - runs-on: macOS-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Publish SecureStorage - env: - BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }} - BINTRAY_USERNAME: andev - run: bash .buildscripts/build-and-deploy-snapshot.sh \ No newline at end of file diff --git a/.gitignore b/.gitignore index 350ff01e4c3e2574c8b955b0703ac4500fa8bce0..0526d3faec963dfb6502e219bcca516287c7c891 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,15 @@ *.iml -.gradle -!/gradle/wrapper/gradle-wrapper.jar /local.properties -.idea -!.idea/codeStyleSettings.xml +/.idea +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml .DS_Store -/build \ No newline at end of file +/build +/captures +.externalNativeBuild +.cxx +/.gradle \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..aeb0216830815e1d88ca1d0e617a2d57baf07870 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# 0.0.1-SNAPSHOT + +ohos 第一个版本,完整实现了原库的全部 api \ No newline at end of file diff --git a/README.OPENSOURCE b/README.OPENSOURCE new file mode 100644 index 0000000000000000000000000000000000000000..31bcf3dec1c30c88450117c606e57b0ec3e42f64 --- /dev/null +++ b/README.OPENSOURCE @@ -0,0 +1,19 @@ +[ + + { + + "Name": "secure-storage-android", + + "License": "Apache License", + + "License File": "LICENSE", + + "Version Number": "1.1.0", + + "Upstream URL": "https://github.com/adorsys/secure-storage-android", + + "Description": "Storing Credentials Securely on Android Devices" + + } + +] \ No newline at end of file diff --git a/README.md b/README.md index a5fcb9ac89f96374f986537321996e52dd58f823..64c86fdfbd87d92e6be523f897c3c1e248a6d212 100644 --- a/README.md +++ b/README.md @@ -1,149 +1,453 @@ -# Secure Device Storage - Android +# secure-storage-ohos +### 项目介绍 +- 项目名称:secure-storage-ohos工具类 +- 所属系列:openharmony第三方组件适配移植 +- 功能:RSA非对称加密 +- 项目移植状态:移植完成 +- 调用差异:无 +- 基线版本: Release 0.0.2 +- 开发版本:sdk5,DevEco Studio2.1 Release +- 编程语言:Java -## Storing Credentials Securely on Android Devices +### 效果演示 -[![Actions Status](https://github.com/adorsys/secure-storage-android/workflows/SecureStorage%20Pull%20Request%20Workflow/badge.svg)](https://github.com/adorsys/secure-storage-android/actions) -[![Download](https://api.bintray.com/packages/andev/adorsys/securestoragelibrary/images/download.svg) ](https://bintray.com/andev/adorsys/securestoragelibrary/_latestVersion) -[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Secure%20Storage%20Android-blue.svg?style=flat)](https://android-arsenal.com/details/1/5648) -[![API](https://img.shields.io/badge/API-18%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=18) -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) -[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/) +![0](/gif/0.gif) + +### 安装教程 +1. 在项目根目录下的build.gradle文件中添加。 +``` +allprojects { + repositories { + maven { + url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + } + } +} +``` -### Introduction - -Storing credentials securely on a device is in many occasions necessary. You probably don't want to rely only on the separation of processes of the Android OS but make sure the stored values are also encrypted. -To make that possible we have combined the Android Keystore and the SharedPreferences. The keystore is used for generating cryptographic keys, the values are then encrypted with these keys and subsequently securely stored in the SharedPreferences. +2. 在entry模块下的build.gradle文件中添加依赖。 -The secure part about this solution is that those generated keys are never exposed to the kernel when the device is equipped with a “Trusted Execution Environment”. A so called TEE is a secure area inside the main processor of a smartphone which runs code isolated from other processes. That means even if the device gets compromised or hacked those keys can’t be extracted. Already a lot of modern Android phones out there are equipped with a TEE (mostly because it’s often used to play DRM protected material) and it even is a requirement for Google’s Android Nougat certification — so every phone running Android Nougat and later will come with a TEE installed. +``` +dependencies { + implementation project(path: ':securestoragelibrary') +} +``` -SecureStorage uses its own dedicated private SharedPreferences to prevent conflicts with other possible SharedPreference instances and ensure that the content of the SecureStorage can only be accessed from the app which uses this library. +在sdk5,DevEco Studio2.1 Release下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 + +### 使用说明 +secure-storage + +1. 布局文件定义,提供控件:secure-storage + +```xml + + + + + + + + + + + +