Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: wallet-services and request() function added #16

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

grvgoel81
Copy link
Collaborator

@grvgoel81 grvgoel81 commented Dec 11, 2024

Motivation and Context

  • Fetch config API added.
  • Wallet-services added.
  • request() function(signatures) added.

Jira Link: https://toruslabs.atlassian.net/browse/PD-4249 , https://toruslabs.atlassian.net/browse/PD-4255, https://toruslabs.atlassian.net/browse/PD-4252

Description

  • Fetch config API added.
  • Wallet-services added.
  • request() function(signatures) added.

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code requires a db migration.

grvgoel81 and others added 16 commits December 11, 2024 13:58
Signed-off-by: Gaurav Goel <[email protected]>
Signed-off-by: Gaurav Goel <[email protected]>
Signed-off-by: Gaurav Goel <[email protected]>
Signed-off-by: Gaurav Goel <[email protected]>
super.onCreate(savedInstanceState)
supportActionBar?.hide()
setContentView(R.layout.activity_webview)
webView = findViewById(R.id.webView)

Check warning

Code scanning / CodeQL

Android WebView settings allows access to content links Medium

Sensitive information may be exposed via a malicious link due to access to content:// links being allowed in this WebView.

Copilot Autofix AI 4 days ago

To fix the problem, we need to explicitly disable access to content:// URLs in the WebView settings. This can be done by calling setAllowContentAccess(false) on the WebSettings object of the WebView. This change should be made in the onCreate method where the WebView settings are configured.

Suggested changeset 1
singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt b/singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt
--- a/singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt
+++ b/singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt
@@ -78,2 +78,3 @@
             webSettings.setSupportMultipleWindows(true)
+            webSettings.setAllowContentAccess(false)
 
EOF
@@ -78,2 +78,3 @@
webSettings.setSupportMultipleWindows(true)
webSettings.setAllowContentAccess(false)

Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
}

val webSettings: WebSettings = webView.settings
webSettings.javaScriptEnabled = true

Check warning

Code scanning / CodeQL

Android WebView JavaScript settings Medium

JavaScript execution enabled in WebView.

Copilot Autofix AI 4 days ago

To fix the problem, we need to disable JavaScript execution in the WebView settings. If JavaScript is necessary for the application's functionality, we should ensure that only content from trusted sources is loaded using encrypted channels (e.g., HTTPS with certificate verification). In this case, we will disable JavaScript execution by setting webSettings.javaScriptEnabled to false.

Suggested changeset 1
singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt b/singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt
--- a/singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt
+++ b/singlefactorauth/src/main/java/com/web3auth/singlefactorauth/WebViewActivity.kt
@@ -74,3 +74,3 @@
             val webSettings: WebSettings = webView.settings
-            webSettings.javaScriptEnabled = true
+            webSettings.javaScriptEnabled = false
             webSettings.domStorageEnabled = true
EOF
@@ -74,3 +74,3 @@
val webSettings: WebSettings = webView.settings
webSettings.javaScriptEnabled = true
webSettings.javaScriptEnabled = false
webSettings.domStorageEnabled = true
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
}
}

webView.addJavascriptInterface(this, "JSBridge")

Check warning

Code scanning / CodeQL

Access Java object methods through JavaScript exposure Medium

JavaScript interface to Java object added in Android WebView.
@grvgoel81 grvgoel81 changed the title feat: wallet-services and request() function added. mid-commit feat: wallet-services and request() function added Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant