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
// The current demo stage | |
config.currentDemoStage = DEMO_STAGE.HMAC_DYNAMIC_SECRET_PROTECTION |
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
/** The current demo stage */ | |
val currentDemoStage = DemoStage.HMAC_DYNAMIC_SECRET_PROTECTION |
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
var secret = SHIPFAST_HMAC_SECRET | |
var hmac | |
... | |
... | |
var obfuscatedSecretData = Buffer.from(secret, 'base64') | |
var shipFastAPIKeyData = new Buffer("QXBwcm9vdidzIHRvdGFsbHkgYXdlc29tZSEh") | |
for (var i = 0; i < Math.min(obfuscatedSecretData.length, shipFastAPIKeyData.length); i++) { | |
obfuscatedSecretData[i] ^= shipFastAPIKeyData[i] | |
} | |
var obfuscatedSecret = new Buffer(obfuscatedSecretData).toString('base64') |
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
val secret = HMAC_SECRET | |
var keySpec: SecretKeySpec | |
... | |
... | |
val obfuscatedSecretData = Base64.decode(secret, Base64.DEFAULT) | |
val shipFastAPIKeyData = loadShipFastAPIKey(context).toByteArray(Charsets.UTF_8) | |
for (i in 0 until minOf(obfuscatedSecretData.size, shipFastAPIKeyData.size)) { | |
obfuscatedSecretData[i] = (obfuscatedSecretData[i].toInt() xor shipFastAPIKeyData[i].toInt()).toByte() | |
} | |
val obfuscatedSecret = Base64.encode(obfuscatedSecretData, Base64.DEFAULT) |
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
// The current demo stage | |
var currentDemoStage = DEMO_STAGE.HMAC_STATIC_SECRET_PROTECTION |
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
// The current demo stage | |
var currentDemoStage = DEMO_STAGE.HMAC_DYNAMIC_SECRET_PROTECTION |
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
/** The current demo stage */ | |
val currentDemoStage = DemoStage.APPROOV_APP_AUTH_PROTECTION |
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
// The current demo stage | |
config.currentDemoStage = DEMO_STAGE.APPROOV_APP_AUTH_PROTECTION | |
// The Approov token secret | |
config.approovTokenSecret = 'PUT-YOUR-APPROOV-TOKEN-SECRET-HERE' |
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
OkHttpClient.Builder() | |
.hostnameVerifier(ApproovHostnameVerifier(OkHttpClient().hostnameVerifier())) | |
.build() |
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
OkHttpClient.Builder() | |
.hostnameVerifier(ApproovHostnameVerifier(OkHttpClient().hostnameVerifier())) | |
.build() |