From 1e27736704cf287aed0fb09b5e56cf2b876ade4b Mon Sep 17 00:00:00 2001 From: renpengfei Date: Thu, 17 Jun 2021 11:45:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=B3=A8=E9=87=8A=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/config.json | 2 +- .../securestoragetest/ExampleOhosTest.java | 4 +-- .../securestoragetest/ExampleTest.java | 2 +- .../ohos/securestoragelibrary/PRNGFixes.java | 1 - .../SecurePreferences.java | 26 +++++++++---------- .../securestoragelibrary/ExampleTest.java | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) rename entry/src/ohosTest/java/de/adorsys/{android => ohos}/securestoragetest/ExampleOhosTest.java (97%) rename entry/src/test/java/de/adorsys/{android => ohos}/securestoragetest/ExampleTest.java (68%) rename securestoragelibrary/src/test/java/de/adorsys/{android => ohos}/securestoragelibrary/ExampleTest.java (66%) diff --git a/entry/src/main/config.json b/entry/src/main/config.json index d38b7d3..e366763 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "de.adorsys.android.securestoragetest", + "bundleName": "de.adorsys.ohos.securestoragetest", "vendor": "adorsys", "version": { "code": 1000000, diff --git a/entry/src/ohosTest/java/de/adorsys/android/securestoragetest/ExampleOhosTest.java b/entry/src/ohosTest/java/de/adorsys/ohos/securestoragetest/ExampleOhosTest.java similarity index 97% rename from entry/src/ohosTest/java/de/adorsys/android/securestoragetest/ExampleOhosTest.java rename to entry/src/ohosTest/java/de/adorsys/ohos/securestoragetest/ExampleOhosTest.java index 1aa5bfb..f39643c 100644 --- a/entry/src/ohosTest/java/de/adorsys/android/securestoragetest/ExampleOhosTest.java +++ b/entry/src/ohosTest/java/de/adorsys/ohos/securestoragetest/ExampleOhosTest.java @@ -14,7 +14,7 @@ * */ -package de.adorsys.android.securestoragetest; +package de.adorsys.ohos.securestoragetest; import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; import org.junit.Test; @@ -34,7 +34,7 @@ public class ExampleOhosTest { @Test public void testBundleName() { final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); - assertEquals("de.adorsys.android.securestoragetest", actualBundleName); + assertEquals("de.adorsys.ohos.securestoragetest", actualBundleName); } /** diff --git a/entry/src/test/java/de/adorsys/android/securestoragetest/ExampleTest.java b/entry/src/test/java/de/adorsys/ohos/securestoragetest/ExampleTest.java similarity index 68% rename from entry/src/test/java/de/adorsys/android/securestoragetest/ExampleTest.java rename to entry/src/test/java/de/adorsys/ohos/securestoragetest/ExampleTest.java index 1b053c5..165e7ab 100644 --- a/entry/src/test/java/de/adorsys/android/securestoragetest/ExampleTest.java +++ b/entry/src/test/java/de/adorsys/ohos/securestoragetest/ExampleTest.java @@ -1,4 +1,4 @@ -package de.adorsys.android.securestoragetest; +package de.adorsys.ohos.securestoragetest; import org.junit.Test; diff --git a/securestoragelibrary/src/main/java/de/adorsys/ohos/securestoragelibrary/PRNGFixes.java b/securestoragelibrary/src/main/java/de/adorsys/ohos/securestoragelibrary/PRNGFixes.java index 519bb23..087d4b2 100644 --- a/securestoragelibrary/src/main/java/de/adorsys/ohos/securestoragelibrary/PRNGFixes.java +++ b/securestoragelibrary/src/main/java/de/adorsys/ohos/securestoragelibrary/PRNGFixes.java @@ -163,7 +163,6 @@ public final class PRNGFixes { */ private static String getDeviceSerialNumber() { // We're using the Reflection API because Build.SERIAL is only available - // since API Level 9 (Gingerbread, Android 2.3). try { return (String) System.class.getField("SERIAL").get(null); } catch (Exception ignored) { diff --git a/securestoragelibrary/src/main/java/de/adorsys/ohos/securestoragelibrary/SecurePreferences.java b/securestoragelibrary/src/main/java/de/adorsys/ohos/securestoragelibrary/SecurePreferences.java index f280376..3a8e62d 100644 --- a/securestoragelibrary/src/main/java/de/adorsys/ohos/securestoragelibrary/SecurePreferences.java +++ b/securestoragelibrary/src/main/java/de/adorsys/ohos/securestoragelibrary/SecurePreferences.java @@ -41,7 +41,7 @@ public final class SecurePreferences { } /** - * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the Android Device + * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the OpenHarmony Device * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -65,7 +65,7 @@ public final class SecurePreferences { } /** - * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the Android Device + * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the OpenHarmony Device * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -77,7 +77,7 @@ public final class SecurePreferences { } /** - * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the Android Device + * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the OpenHarmony Device * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -89,7 +89,7 @@ public final class SecurePreferences { } /** - * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the Android Device + * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the OpenHarmony Device * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -101,7 +101,7 @@ public final class SecurePreferences { } /** - * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the Android Device + * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the OpenHarmony Device * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -113,7 +113,7 @@ public final class SecurePreferences { } /** - * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the Android Device + * Takes plain string value, encrypts it and stores it encrypted in the SecureStorage on the OpenHarmony Device * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -129,7 +129,7 @@ public final class SecurePreferences { } /** - * Gets encrypted String value for given key from the SecureStorage on the Android Device, decrypts it and returns it + * Gets encrypted String value for given key from the SecureStorage on the OpenHarmony Device, decrypts it and returns it * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -153,7 +153,7 @@ public final class SecurePreferences { } /** - * Gets encrypted boolean value for given key from the SecureStorage on the Android Device, decrypts it and returns it + * Gets encrypted boolean value for given key from the SecureStorage on the OpenHarmony Device, decrypts it and returns it * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -165,7 +165,7 @@ public final class SecurePreferences { } /** - * Gets encrypted float value for given key from the SecureStorage on the Android Device, decrypts it and returns it + * Gets encrypted float value for given key from the SecureStorage on the OpenHarmony Device, decrypts it and returns it * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -177,7 +177,7 @@ public final class SecurePreferences { } /** - * Gets encrypted long value for given key from the SecureStorage on the Android Device, decrypts it and returns it + * Gets encrypted long value for given key from the SecureStorage on the OpenHarmony Device, decrypts it and returns it * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -189,7 +189,7 @@ public final class SecurePreferences { } /** - * Gets encrypted int value for given key from the SecureStorage on the Android Device, decrypts it and returns it + * Gets encrypted int value for given key from the SecureStorage on the OpenHarmony Device, decrypts it and returns it * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -201,7 +201,7 @@ public final class SecurePreferences { } /** - * Gets encrypted int value for given key from the SecureStorage on the Android Device, decrypts it and returns it + * Gets encrypted int value for given key from the SecureStorage on the OpenHarmony Device, decrypts it and returns it * * @param context Context is used internally * @param key Key used to identify the stored value in SecureStorage @@ -246,7 +246,7 @@ public final class SecurePreferences { } /** - * Clears all values from the SecureStorage on the Android Device and deletes the en/decryption keys + * Clears all values from the SecureStorage on the OpenHarmony Device and deletes the en/decryption keys * Means new keys/keypairs have to be generated for the library to be able to work * * @param context Context is used internally diff --git a/securestoragelibrary/src/test/java/de/adorsys/android/securestoragelibrary/ExampleTest.java b/securestoragelibrary/src/test/java/de/adorsys/ohos/securestoragelibrary/ExampleTest.java similarity index 66% rename from securestoragelibrary/src/test/java/de/adorsys/android/securestoragelibrary/ExampleTest.java rename to securestoragelibrary/src/test/java/de/adorsys/ohos/securestoragelibrary/ExampleTest.java index 9610fe7..2e2d695 100644 --- a/securestoragelibrary/src/test/java/de/adorsys/android/securestoragelibrary/ExampleTest.java +++ b/securestoragelibrary/src/test/java/de/adorsys/ohos/securestoragelibrary/ExampleTest.java @@ -1,4 +1,4 @@ -package de.adorsys.android.securestoragelibrary; +package de.adorsys.ohos.securestoragelibrary; import org.junit.Test; -- Gitee