You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an example code in java to add Dialog function as JavaScript Interface to a WebView:
publicclassMainActivityextendsAppCompatActivity {
WebViewwebView;
@OverrideprotectedvoidonCreate(BundlesavedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webView = findViewById(R.id.interface_web);
// opening the html file in webviewwebView.loadUrl("file:///android_asset/test.html");
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setSupportZoom(true);
webView.addJavascriptInterface(this, "Dialog");
}
@JavascriptInterfacepublicvoidshowMsg(Stringfname, Stringpswd) {
AlertDialog.Builderbuilder = newAlertDialog.Builder(MainActivity.this);
builder.setTitle("Confirmation").setMessage("UserName:\t" + fname + "\nPassword:\t" + pswd)
.setPositiveButton("Ok", newDialogInterface.OnClickListener() {
@OverridepublicvoidonClick(DialogInterfacedialogInterface, inti) {
Toast.makeText(getApplicationContext(), " Data Saved Locally", Toast.LENGTH_SHORT).show();
// You can use shared preference or db here to store The Data
}
});
builder.create().show();
}
}
Everything in this code can be written with frida except using the annotation "@JavascriptInterface",
without the "@JavascriptInterface" annotation the Dialog function will not be available in the WebView...
The text was updated successfully, but these errors were encountered:
Don't expect anyone to work on this. You can try to implement it at mkdex.js + class-factory.js and make a PR. If there's an existing class in your process with this signature I would recommend to hook/modify the functions and create a new instance of it. Alternatively you compile your class to a dex and use a dex class loader
Here's an example code in java to add Dialog function as JavaScript Interface to a WebView:
Everything in this code can be written with frida except using the annotation "@JavascriptInterface",
without the "@JavascriptInterface" annotation the Dialog function will not be available in the WebView...
The text was updated successfully, but these errors were encountered: