android-security

How to address “Remediation for JavaScript Interface Injection Vulnerability”?

南楼画角 提交于 2019-12-01 10:50:38
Google has asked me to address https://support.google.com/faqs/answer/9095419 in my Android app, which basically means not to use the JavaScript injection mechanism for a web page loaded via HTTP. Not using this mechanism (option 1) doesn't work for me. Setting android:usesCleartextTraffic to false also doesn't work, as the app uses non-HTTPS traffic elsewhere. So that leaves me with "you can ensure that any affected WebViews do not load any URLs with HTTP schemes via loadUrl" - which I'm happy to do, as my app only uses file:/// URLs to load content into the WebView, which should be fine

Android check if lockscreen is set

不问归期 提交于 2019-12-01 05:19:49
i need to check if the lockscreen does have a Pin or something more secure (Password, Fingerprint etc.). Im able to check if there is a Pin, Password or a Pattern. KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); return keyguardManager.isKeyguardSecure(); My Problem is that i cant detect if the lockscreen is a Pattern or something lower. I tried this: int lockPatternEnable = Settings.Secure.getInt(cr, Settings.Secure.LOCK_PATTERN_ENABLED); but its deprecated and throws me an error. I also tried this: long mode2 = Settings.Secure.getLong

Programmatically accept call in Nougat

橙三吉。 提交于 2019-11-30 00:15:32
From one year, I have been working over IOT product and the application attached was working fine. Now I am not able to accept call programmatically in higher versions of android. Feature is very important to product. Any help is highly appreciated. Before security patch update November 2016 , Runtime.getRunTime.exec("Command") was working fine to accept call programmatically. Runtime.getRuntime().exec("input keyevent " +Integer.toString(KeyEvent.KEYCODE_HEADSETHOOK)); How to make it possible in Nougat version of android. Looking for any sort of hack. I have opened a thread for the

Google Play Security alert about Google Cloud Platform (GCP) API keys

喜夏-厌秋 提交于 2019-11-28 11:09:54
问题 We were using a GCP API key on multiple platforms (Android, iOS, Web) for Google map, Location search (api/place/autocomplete) , static Google Map, etc. Now I wanted to create a new/separate Key for Android App so I can add appropriate restrictions like package name SHA1 and used APIs. I've created a new key, Changed it into the App after that map is working fine but Location search API is kept throwing an exception- This IP, site or mobile application is not authorized to use this API key.

android Google Play Warning: SSL Error Handler Vulnerability

柔情痞子 提交于 2019-11-28 09:18:24
I use the gorbin/ASNE SDK in my app. I recently received an email from Google with the following subject : "Google Play Warning: SSL Error Handler Vulnerability". In this email, Google explains that my app has an ["unsafe implementation of the WebViewClient.onReceivedSslError handler"] and they recommended me to ["To properly handle SSL certificate validation, change your code to invoke SslErrorHandler.proceed() whenever the certificate presented by the server meets your expectations, and invoke SslErrorHandler.cancel() otherwise"] here's my implementation of the method : public void

How to fix unsafe implementation of X509TrustManager in Android app

会有一股神秘感。 提交于 2019-11-28 03:51:32
Google has advised that I have an unsafe implementation of the interface X509TrustManager in my Android application and need to change my code as follows: To properly handle SSL certificate validation, change your code in the checkServerTrusted method of your custom X509TrustManager interface to raise either CertificateException or IllegalArgumentException whenever the certificate presented by the server does not meet your expectations. For technical questions, you can post to Stack Overflow and use the tags “android-security” and “TrustManager.” How can the following code be modified to fix

an unsafe implementation of the interface X509TrustManager from google

烈酒焚心 提交于 2019-11-27 19:56:09
I hava an app in Google Play, I received a mail from Google saying that: Your app(s) listed at the end of this email use an unsafe implementation of the interface X509TrustManager. Specifically, the implementation ignores all SSL certificate validation errors when establishing an HTTPS connection to a remote host, thereby making your app vulnerable to man-in-the-middle attacks. To properly handle SSL certificate validation, change your code in the checkServerTrusted method of your custom X509TrustManager interface to raise either CertificateException or IllegalArgumentException whenever the

Google Play Security Alert - Your app is using an unsafe implementation of the HostnameVerifier

二次信任 提交于 2019-11-27 09:30:37
Recently one of my app got a security alert from Google Play as below. You app is using an unsafe implementation of the HostnameVerifier . And refer a link to Google Play Help Center article for details regarding to fixing and deadline of vulnerability. Below is my code. HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier(){ public boolean verify(String arg0, SSLSession arg1) { return true; }}); Anyone can explain with example about, what changes should I do to fix this warning? Stan Same here - Insecure Hostname Verifier Detected in APK Your app is using an unsafe

Google Play warning and “unsafe implementation of X509TrustManager”

那年仲夏 提交于 2019-11-27 04:37:24
问题 We had received mail regarding “You are using an unsafe implementation of X509TrustManagfer”. To resolve this issue we have applied solution from http://transoceanic.blogspot.in/2011/11/android-import-ssl-certificate-and-use.html Here we have generated new BKS key store and pass this Key Store SSLSocketFactory. This Factory is responsible for verification of Server certificate. We have already existing Keystore but it is not in .BKS formate . That’s why we have created new one for specially

How to get Usage Access Permission programmatically

匆匆过客 提交于 2019-11-27 03:29:12
问题 My app needs to have Usage Access Permission in order to get information about the current running app on user's phone. I am able to successfully implement it using the following code with the help from the following link. Usage Access apps Here is my working code public void showDialog() { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { @SuppressWarnings("WrongConstant") UsageStatsManager usm = (UsageStatsManager) getSystemService("usagestats"); long time =