{"id":19645802,"url":"https://github.com/approov/quickstart-android-java-grpc","last_synced_at":"2026-06-13T11:31:33.566Z","repository":{"id":39704961,"uuid":"440943206","full_name":"approov/quickstart-android-java-grpc","owner":"approov","description":"Quickstart for integrating Approov with Android apps in Java that make API requests you wish to protect using GRPC.","archived":false,"fork":false,"pushed_at":"2025-12-30T21:07:40.000Z","size":3703,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-01-03T15:24:33.519Z","etag":null,"topics":["android","approov","approov-quickstart","grpc","java","rasp"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/approov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-22T18:00:45.000Z","updated_at":"2025-12-30T18:27:29.000Z","dependencies_parsed_at":"2025-02-26T23:45:13.355Z","dependency_job_id":"4bf062a8-5735-45a6-989b-6907ad4c81c0","html_url":"https://github.com/approov/quickstart-android-java-grpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/approov/quickstart-android-java-grpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/approov%2Fquickstart-android-java-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/approov%2Fquickstart-android-java-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/approov%2Fquickstart-android-java-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/approov%2Fquickstart-android-java-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/approov","download_url":"https://codeload.github.com/approov/quickstart-android-java-grpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/approov%2Fquickstart-android-java-grpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34283388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","approov","approov-quickstart","grpc","java","rasp"],"created_at":"2024-11-11T14:35:27.585Z","updated_at":"2026-06-13T11:31:33.559Z","avatar_url":"https://github.com/approov.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Approov Quickstart: Android Java GRPC\n\nThis quickstart is written specifically for native Android apps that are written in Java and use [`GRPC-Java`](https://github.com/grpc/grpc-java) for making the API calls that you wish to protect with Approov. If this is not your situation then check if there is a more relevant Quickstart guide available.\n\nThis page provides all the steps for integrating Approov into your app. Additionally, a step-by-step tutorial guide using our [Shapes App Example](https://github.com/approov/quickstart-android-java-grpc/blob/master/SHAPES-EXAMPLE.md) is also available.\n\nTo follow this guide you should have received an onboarding email for a trial or paid Approov account.\n\n## ADDING APPROOV SERVICE DEPENDENCY\nThe Approov integration is available via [`maven`](https://mvnrepository.com/repos/central). This allows inclusion into the project by simply specifying a dependency in the `gradle` files for the app.\nThe `Maven` repository is already present in the gradle.build file so the only import you need to make is the actual service layer itself:\n\n```\nimplementation(\"io.approov:service.grpc:3.5.3\")\n```\n\nMake sure you do a Gradle sync (by selecting `Sync Now` in the banner at the top of the modified `.gradle` file) after making these changes.\n\nThis package is actually an open source wrapper layer that allows you to use Approov easily with `GRPC-Java`. It has a further dependency to the closed source [Approov SDK](https://github.com/approov/approov-android-sdk).\n\n## MANIFEST CHANGES\nThe following app permissions need to be available in the manifest to use Approov:\n\n```xml\n\u003cuses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" /\u003e\n\u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n```\n\nNote that the minimum SDK version you can use with the Approov package is 21 (Android 5.0).\n\nPlease read the [Targeting Android 11 and Above](https://approov.io/docs/latest/approov-usage-documentation/#targeting-android-11-and-above) section of the reference documentation if targeting Android 11 (API level 30) or above.\n\n## INITIALIZING APPROOV SERVICE\nIn order to use the `ApproovService` you must initialize it when your app is created, usually in the `onCreate` method:\n\n```Java\nimport io.approov.service.grpc.ApproovService;\n\npublic class YourApp extends Application {\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        ApproovService.initialize(getApplicationContext(), \"\u003center-your-config-string-here\u003e\");\n    }\n}\n```\n\nThe `\u003center-your-config-string-here\u003e` is a custom string that configures your Approov account access. This will have been provided in your Approov onboarding email.\n\nThis initializes Approov when the app is first created. ApproovService is a static class which makes its methods available to call from anywhere in your code. All calls to `ApproovService` and the SDK itself are thread safe.\n\n## USING APPROOV SERVICE\n\nYou can then create secure pinned GRPC channels by using the `ApproovChannelBuilder` instead of the usual ManagedChannelBuilder:\n\n```Java\nimport io.approov.service.grpc.ApproovChannelBuilder;\n...\n\n    // open GRPC managed channel\n    String host = \"grpc.example.com\";\n    int port = 443;\n    ManagedChannel channel = ApproovChannelBuilder.forAddress(host, port).build();\n```\n\nAdd Approov enabled remote procedure call stubs by adding an `ApproovClientInterceptor` which adds the `Approov-Token` header and may also substitute header values when using secrets protection:\n\n```Java\nimport io.approov.service.grpc.ApproovClientInterceptor;\n...\n\n    // Get calling stub\n    ExampleGrpc.ExampleBlockingStub stub = ExampleGrpc.newBlockingStub(channel);\n    stub = stub.withInterceptors(new ApproovClientInterceptor(channel));\n```\n\nApproov errors will generate an `ApproovException`, which is a type of `IOException`. This may be further specialized into an `ApproovNetworkException`, indicating an issue with networking that should provide an option for a user initiated retry.\n\n## CHECKING IT WORKS\nInitially you won't have set which API domains to protect, so the interceptor will not add anything. It will have called Approov though and made contact with the Approov cloud service. You will see logging from Approov saying `UNKNOWN_URL`.\n\nYour Approov onboarding email should contain a link allowing you to access [Live Metrics Graphs](https://approov.io/docs/latest/approov-usage-documentation/#metrics-graphs). After you've run your app with Approov integration you should be able to see the results in the live metrics within a minute or so. At this stage you could even release your app to get details of your app population and the attributes of the devices they are running upon.\n\n## NEXT STEPS\nTo actually protect your APIs and/or secrets there are some further steps. Approov provides two different options for protection:\n\n* [API PROTECTION](https://github.com/approov/quickstart-android-java-grpc/blob/master/API-PROTECTION.md): You should use this if you control the backend API(s) being psrotected and are able to modify them to ensure that a valid Approov token is being passed by the app. An [Approov Token](https://approov.io/docs/latest/approov-usage-documentation/#approov-tokens) is short lived crytographically signed JWT proving the authenticity of the call.\n\n* [SECRETS PROTECTION](https://github.com/approov/quickstart-android-java-grpc/blob/master/SECRETS-PROTECTION.md): This allows app secrets, including API keys for 3rd party services, to be protected so that they no longer need to be included in the released app code. These secrets are only made available to valid apps at runtime.\n\nNote that it is possible to use both approaches side-by-side in the same app.\n\nSee [REFERENCE](https://github.com/approov/quickstart-android-java-grpc/blob/master/REFERENCE.md) for a complete list of all of the `ApproovService` methods.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapproov%2Fquickstart-android-java-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapproov%2Fquickstart-android-java-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapproov%2Fquickstart-android-java-grpc/lists"}