# pedant/safe-java-js-webview-bridge

为WebView中的Java与JavaScript提供【安全可靠】的多样互通方案

Repository: https://github.com/pedant/safe-java-js-webview-bridge
Canonical: https://ross.abutalabs.com/products/safe-java-js-webview-bridge
Homepage: http://pedant.github.io/2014/07/04/webview-js-java-interface-research/
Language: JavaScript
License Family: other
Last push: 2019-10-05T02:30:55+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4440, "days_push": 2525, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2415, forks 561 (observed 2026-08-28T04:06:50.282586+00:00)

## What it is
An Android library providing a safe alternative to WebView's addJavascriptInterface for Java-JavaScript communication, using WebChromeClient prompt-based injection to avoid the remote code execution vulnerability on Android < 4.2. It supports async callbacks, method overloading, and all common JS parameter types.

## Use cases
- call native Java methods from JavaScript in an Android WebView
- secure JS-to-Java bridge for hybrid Android apps
- avoid addJavascriptInterface security vulnerability on old Android versions
- support async callbacks between web page JS and native code
- build hybrid apps with safe WebView native interop

## When to choose
- building a hybrid Android app that must support Android versions below 4.2 safely
- you need a lightweight drop-in WebView JS bridge with async callback support

## When to avoid
- targeting only Android 4.2+ where @JavascriptInterface is sufficient
- you need an actively maintained library with recent updates and support
- building cross-platform apps where a modern framework bridge is available

## Facets
- artifact type: library
- maturity: abandoned
- function: security, sdk, developer-tools
- domain: mobile-development, web-development, security, android-tools
- platform: jvm
- tags: webview, hybrid-app, javascript-bridge, android, js-java-interop, mobile

## Member repositories
- pedant/safe-java-js-webview-bridge (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:50.282586+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:33:11.876345+00:00, confidence not recorded.
  - readme: https://github.com/pedant/safe-java-js-webview-bridge (fetched 2026-08-28T04:06:50.282586+00:00, sha eca6495bb40a)
  - homepage: http://pedant.github.io/2014/07/04/webview-js-java-interface-research/ (fetched 2026-08-29T10:14:04.733309+00:00, sha dd54469aad55)
- Data as of 2026-08-30T08:39:29.467469+00:00.
