File tree Expand file tree Collapse file tree 5 files changed +18
-30
lines changed 
androidMain/kotlin/com/liftric/kvault 
iosMain/kotlin/com/liftric/kvault Expand file tree Collapse file tree 5 files changed +18
-30
lines changed Original file line number Diff line number Diff line change @@ -24,19 +24,23 @@ sourceSets {
2424#### Android  
2525
2626``` kotlin 
27- val  store =  KVault (context)
27+ val  store =  KVault (context,  " <fileName> " 
2828``` 
2929
30+ |  Parameter           |  Description                         | 
31+ |  :------------------ |  :---------------------------------- | 
32+ |  fileName (optional) |  Name of the shared preferences file | 
33+ 
3034#### iOS  
3135
3236``` kotlin 
33- val  store =  KVault (serviceName  =   null ,  accessGroup  =   null )
37+ val  store =  KVault (" < serviceName> " ,  " < accessGroup> " 
3438``` 
3539
36- |  Parameter    |  Description                         | 
37- |  :----------- |  :---------------------------------- | 
38- |  serviceName  |  Used to categories objects.          | 
39- |  accessGroup  |  Used to share objects between apps.  | 
40+ |  Parameter               |  Description                         | 
41+ |  :---------------------  |  :---------------------------------- | 
42+ |  serviceName (optional)  |  Used to categories objects           | 
43+ |  accessGroup (optional)  |  Used to share objects between apps   | 
4044
4145### Setting  
4246
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ object Android {
66}
77
88object  Versions {
9-     const  val  Gradle  =  " 7.0.0 " 
10-     const  val  Kotlin  =  " 1.5.30 " 
11-     const  val  Versioning  =  " 2.14.0 " 
9+     const  val  Gradle  =  " 7.1.1 " 
10+     const  val  Kotlin  =  " 1.6.10 " 
11+     const  val  Versioning  =  " 2.15.1 " 
1212    const  val  Crypto  =  " 1.1.0-alpha03" 
1313    const  val  RoboElectric  =  " 4.5.1" 
14-     const  val  TestCore  =  " 1.2 .0" 
14+     const  val  TestCore  =  " 1.4 .0" 
1515}
1616
1717object  Libs {
Original file line number Diff line number Diff line change 11distributionBase =GRADLE_USER_HOME
22distributionPath =wrapper/dists
3- distributionUrl =https\://services.gradle.org/distributions/gradle-7.2 -all.zip
3+ distributionUrl =https\://services.gradle.org/distributions/gradle-7.4 -all.zip
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -5,14 +5,14 @@ import android.content.SharedPreferences
55import  androidx.security.crypto.EncryptedSharedPreferences 
66import  androidx.security.crypto.MasterKey 
77
8- actual  open  class  KVault (context :  Context ) {
8+ actual  open  class  KVault (context :  Context ,  fileName :   String?  =  null ) {
99    private  val  encSharedPrefs:  SharedPreferences 
1010
1111    init  {
1212        val  masterKey =  MasterKey .Builder (context).setKeyScheme(MasterKey .KeyScheme .AES256_GCM ).build()
1313        encSharedPrefs =  EncryptedSharedPreferences .create(
1414            context,
15-             " secure-shared-preferences" 
15+             fileName  ? :   " secure-shared-preferences" 
1616            masterKey,
1717            EncryptedSharedPreferences .PrefKeyEncryptionScheme .AES256_SIV ,
1818            EncryptedSharedPreferences .PrefValueEncryptionScheme .AES256_GCM 
Original file line number Diff line number Diff line change @@ -7,11 +7,9 @@ import platform.Security.*
77import  platform.darwin.OSStatus 
88import  platform.darwin.noErr 
99
10- internal  val  NSBundle .Companion .mainIdentifier
11-     get() =  this .mainBundle.bundleIdentifier? :  " com.liftric.KVault" 
12- 
1310/* *
1411 * Keychain wrapper. 
12+  * Note: Using the deprecated init() the service name was the apps bundle identifier or if null "com.liftric.KVault". 
1513 * 
1614 * @param serviceName Name of the service. Used to categories entries. 
1715 * @param accessGroup Name of the access group. Used to share entries between apps. 
@@ -21,20 +19,6 @@ actual open class KVault(
2119    val  serviceName :  String?  = null ,
2220    val  accessGroup :  String?  = null 
2321) {
24-     /* *
25-      * Initiates a Keychain with the main bundle identifier as the service name and without an access group. 
26-      * If the main bundle identifier is null, it will fallback to `com.liftric.KVault`. 
27-      */  
28-     @Deprecated(
29-         """ 
30-         Will be removed in a future version,  
31-         please use the primary constructor.  
32-         Check your service name before migrating. 
33-         """  ,
34-         level =  DeprecationLevel .WARNING 
35-     )
36-     constructor () :  this (NSBundle .mainIdentifier, null )
37- 
3822    /* *
3923     * Saves a string value in the Keychain. 
4024     * @param key The key to store 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments