//Add interface to webview webView.addJavascriptInterface( new WebAppInterface(getApplicationContext()), "Android" ); class WebAppInterface { Context mContext ; /** * Instantiate the interface and set the context */ WebAppInterface(Context c) { mContext = c; } /** * Show a toast from the web page */ @JavascriptInterface public void showToast(String toast) { Toast. makeText ( mContext , toast, Toast. LENGTH_SHORT ).show(); } //Create a toast / event in JavaScript <input type="button" value="Say hello" onClick="showAndroidToast('Hello Android!')" /> <script type="text/javascript"> function showAndroidToast(toast) { Android.showToast(toast); } </script>
# Create public and private key with keyStore. # Get KeyPairGenerator instance by providing algo and provider (algo: RSA, provider: AndroidKeyStore ) # Create AlgorithmParameterSpec and initialize to KeyPairGenerator instance. # Generate Key Pairs , kpGenerator .generateKeyPair(); # Signs the data using the key pair stored in the Android Key Store. # Get KeyStore instance with provider ( AndroidKeyStore ) # Load the key pair from the Android Key Store using alias # Get Signature and init with private key. # Sign the data, store the result as a Base64 encoded String.
using apktool, following command will give the resources as well.
ReplyDeleteapktool.bat d *.apk