forked from mosip/inji-wallet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mosip#1485 from tw-mosip/injimob-1456-sprint-29-re…
…lease [INJIMOB-1456] Sprint 29 release handover
- Loading branch information
Showing
186 changed files
with
6,426 additions
and
2,298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
android/app/src/main/java/io/mosip/residentapp/InjiPackage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.mosip.residentapp; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.facebook.react.ReactPackage; | ||
import com.facebook.react.bridge.NativeModule; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.uimanager.ViewManager; | ||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
|
||
public class InjiPackage implements ReactPackage { | ||
@NonNull | ||
@Override | ||
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactApplicationContext) { | ||
List<NativeModule> modules = new ArrayList<>(); | ||
|
||
modules.add(new InjiVciClientModule(reactApplicationContext)); | ||
modules.add(new RNPixelpassModule(reactApplicationContext)); | ||
modules.add(new RNSecureKeystoreModule(reactApplicationContext)); | ||
return modules; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactApplicationContext) { | ||
return Collections.emptyList(); | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
android/app/src/main/java/io/mosip/residentapp/InjiVciClientModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package io.mosip.residentapp; | ||
|
||
import android.util.Log; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.facebook.react.bridge.Promise; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
import com.facebook.react.bridge.ReactMethod; | ||
import com.facebook.react.bridge.ReadableArray; | ||
import com.facebook.react.bridge.ReadableMap; | ||
|
||
import io.mosip.vciclient.VCIClient; | ||
import io.mosip.vciclient.constants.CredentialFormat; | ||
import io.mosip.vciclient.credentialResponse.CredentialResponse; | ||
import io.mosip.vciclient.dto.IssuerMetaData; | ||
import io.mosip.vciclient.proof.jwt.JWTProof; | ||
|
||
|
||
public class InjiVciClientModule extends ReactContextBaseJavaModule { | ||
private VCIClient vciClient; | ||
|
||
public InjiVciClientModule(@Nullable ReactApplicationContext reactContext) { | ||
super(reactContext); | ||
} | ||
|
||
@ReactMethod | ||
public void init(String appId) { | ||
Log.d("InjiVciClientModule", "Initializing InjiVciClientModule with " + appId); | ||
vciClient = new VCIClient(appId); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return "InjiVciClient"; | ||
} | ||
|
||
@ReactMethod | ||
public void requestCredential(ReadableMap issuerMetaData, String jwtProofValue, String accessToken, Promise promise) { | ||
try { | ||
CredentialResponse response = vciClient.requestCredential(new IssuerMetaData( | ||
issuerMetaData.getString("credentialAudience"), | ||
issuerMetaData.getString("credentialEndpoint"), | ||
issuerMetaData.getInt("downloadTimeoutInMilliSeconds"), | ||
convertReadableArrayToStringArray(issuerMetaData.getArray("credentialType")), | ||
CredentialFormat.LDP_VC), new JWTProof(jwtProofValue) | ||
, accessToken); | ||
promise.resolve(response.toJsonString()); | ||
} catch (Exception exception) { | ||
promise.reject(exception); | ||
} | ||
} | ||
|
||
private String[] convertReadableArrayToStringArray(ReadableArray readableArray) { | ||
String[] stringArray = new String[readableArray.size()]; | ||
for (int i = 0; i < readableArray.size(); i++) { | ||
stringArray[i] = readableArray.getString(i); | ||
} | ||
return stringArray; | ||
} | ||
} |
Oops, something went wrong.