File tree Expand file tree Collapse file tree 3 files changed +5
-10
lines changed
app/src/main/java/org/matrix/TEESimulator/interception Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ abstract class BinderInterceptor : Binder() {
4141 * Skips the original call and immediately returns a custom reply parcel to the caller. The
4242 * provided parcel will be recycled after use.
4343 */
44- data class OverrideReply (val code : Int = 0 , val reply : Parcel ) : TransactionResult()
44+ data class OverrideReply (val reply : Parcel , val code : Int = 0 ) : TransactionResult()
4545
4646 /* *
4747 * Modifies the transaction's input data before forwarding it to the original binder method.
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ object InterceptorUtils {
5252 writeInt(KeyStore .NO_ERROR )
5353 }
5454 }
55- return BinderInterceptor .TransactionResult .OverrideReply (0 , parcel)
55+ return BinderInterceptor .TransactionResult .OverrideReply (parcel)
5656 }
5757
5858 /* * Creates an `OverrideReply` parcel containing a raw byte array. */
@@ -62,7 +62,7 @@ object InterceptorUtils {
6262 writeNoException()
6363 writeByteArray(data)
6464 }
65- return BinderInterceptor .TransactionResult .OverrideReply (KeyStore . NO_ERROR , parcel)
65+ return BinderInterceptor .TransactionResult .OverrideReply (parcel)
6666 }
6767
6868 /* * Creates an `OverrideReply` parcel containing a Parcelable object. */
@@ -75,7 +75,7 @@ object InterceptorUtils {
7575 writeNoException()
7676 writeTypedObject(obj, flags)
7777 }
78- return BinderInterceptor .TransactionResult .OverrideReply (0 , parcel)
78+ return BinderInterceptor .TransactionResult .OverrideReply (parcel)
7979 }
8080
8181 /* *
Original file line number Diff line number Diff line change @@ -168,12 +168,7 @@ class KeyMintSecurityLevelInterceptor(
168168 if (isAttestKeyRequest) attestationKeys.add(keyId)
169169
170170 // Return the metadata of our generated key, skipping the real hardware call.
171- val resultParcel =
172- Parcel .obtain().apply {
173- writeNoException()
174- writeTypedObject(response.metadata, 0 )
175- }
176- return TransactionResult .OverrideReply (0 , resultParcel)
171+ return InterceptorUtils .createTypedObjectReply(response.metadata)
177172 } else if (parsedParams.attestationChallenge != null ) {
178173 return TransactionResult .Continue
179174 }
You can’t perform that action at this time.
0 commit comments