Skip to content

VGS Show - Android SDK that enables you to securely display sensitive data https://www.verygoodsecurity.com/docs/vgs-show

License

Notifications You must be signed in to change notification settings

verygoodsecurity/vgs-show-android

Repository files navigation

UT license AI Agent Ready

VGS Show Android SDK allows you to securely reveal data for your users without having to have that data pass through your systems. It provides customizable UI elements for showing users' sensitive data securely on Android devices.

Table of contents


Dependencies

Dependency Version
Min SDK 21
Target SDK 34
org.jetbrains.kotlin:kotlin-gradle-plugin 1.9.22
androidx.appcompat:appcompat 1.6.1
com.squareup.okhttp3:okhttp 4.12.0

Structure

  • VGSShow SDK - provides an API for interacting with the VGS Vault
  • app - sample application to act as the host app for testing the SDK during development

AI Agent Integration

Use AGENTS.md as the single authoritative context for autonomous coding agents integrating or maintaining VGSShowSDK.

Minimal System Prompt Example:

You are an autonomous engineering agent integrating the VGS Show Android SDK into an existing Kotlin app. Use the full contents of AGENTS.md as the authoritative policy.

Constraints:

  • Only public, non-deprecated APIs.
  • No raw sensitive data in logs/tests.
  • Securely display sensitive data.

Goals:

  1. Add a secure VGSTextView to display sensitive data and a VGSImageView to display a sensitive image.
  2. Add redacted logging for all revealed data.
  3. Provide unit tests for revealing and displaying data.

Return: Modified Kotlin source files only, no secrets.


Integration

For integration you need to install the Android Studio and a JDK on your machine.

Integrate the VGS Show SDK to your project.
If you are using Maven, add the following to your build.gradle file.
dependencies {
    implementation "androidx.appcompat:appcompat:<version>"
    implementation "com.google.android.material:material:<version>"

    implementation "com.verygoodsecurity:vgsshow:<version>"
}
Add secure views to R.layout.activity_main layout file .
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
  
    <com.verygoodsecurity.vgsshow.widget.VGSTextView
        android:id="@+id/infoField"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:contentPath="<CONTENT_PATH>"
        app:gravity="center"
        app:textColor="@android:color/black"
        app:textStyle="bold" >
    </com.verygoodsecurity.vgsshow.widget.VGSTextView>

    <com.verygoodsecurity.vgsshow.widget.VGSImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        app:contentPath="<CONTENT_PATH_TO_IMAGE>" />

</LinearLayout>
To initialize VGSShow you have to set your vault id and Environment type.
Use subscribe(VGSView) to attach secure views to VGSShow.
class MainActivity : AppCompatActivity() {
    private lateinit var vgsShow: VGSShow
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        vgsShow = VGSShow(this, "<VAULT_ID>", VGSEnvironment.Sandbox())

        val infoField = findViewById<VGSTextView>(R.id.infoField)
        vgsShow.subscribe(infoField)

        val imageView = findViewById<VGSImageView>(R.id.imageView)
        vgsShow.subscribe(imageView)
    }
}
Revealing Sensitive Data.
Call requestAsync to reveal and send data on VGS Server.
class MainActivity : AppCompatActivity() {

    private lateinit var vgsShow: VGSShow
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        
        vgsShow = VGSShow(this, "<VAULT_ID>", VGSEnvironment.Sandbox())
        vgsShow.subscribe(findViewById<VGSTextView>(R.id.infoField))
        vgsShow.subscribe(findViewById<VGSImageView>(R.id.imageView))

        findViewById<Button>(R.id.revealButton)?.setOnClickListener {
            vgsShow.requestAsync("/post",
                VGSHttpMethod.POST,
                mapOf("<FIELD_NAME>" to "<REVEAL_ALIAS>")
            )
        }
    }
}
Receive responses.
To retrieve response you need to implement VGSOnResponseListener.
class MainActivity : AppCompatActivity() {

    private lateinit var vgsShow: VGSShow

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        vgsShow = VGSShow(this, "<VAULT_ID>", VGSEnvironment.Sandbox())
        vgsShow.subscribe(findViewById<VGSTextView>(R.id.infoField))
        vgsShow.subscribe(findViewById<VGSImageView>(R.id.imageView))

        findViewById<Button>(R.id.revealButton)?.setOnClickListener {
            vgsShow.requestAsync("/post",
                VGSHttpMethod.POST,
                mapOf("<FIELD_NAME>" to "<REVEAL_ALIAS>")
            )
        }

        vgsShow.addOnResponseListener(object : VGSOnResponseListener {
            override fun onResponse(response: VGSResponse) {
                when(response) {
                    is VGSResponse.Success -> {
                        val code = response.code
                    }
                    is VGSResponse.Error -> {
                        val code = response.code
                        val message = response.message
                    }
                }
            }
        })
    }
}

Releases

To follow VGS Show SDK updates and changes check the releases page.

License

VGSShow Android SDK is released under the MIT license. See LICENSE for details.