How to prevent Admob ad ids from leaked by android hackig app - java

I have developed an android app. All the things are working fine but the main problem is, using the Hack App Data anyone can see the ad codes which is a very dangerous threat.
Now how can i prevent hack app to open my application or edit my application data or how can i prevent hack app data to access this sensitive information?
note: I have turned off android:exported="false" and also add <permission android:protectionLevel="signature"
android:name="apricot.com.newshunt"/> to my menifest file

you can set the Copy Protection to On in the Android Market upload page. It's near the bottom. I doubt it is fool-proof but it can help keep some of the people likely to do this from being able to.
You should add the view in Java instead of XML and obfuscate your code.

Related

Is it possible to clear the android application cache at API 21

Is it possible to write a function to clear the app cache on my app. I know that I can go to app settings and clear it that way but I want to be able to do that within my own app in code when its finished processing.
Any suggestions would be greatly appreciated.
I have tried Clear Cache in Android Application programmatically but the app still shows that the cache is not cleared.
I have also looked at How to delete app cache for all apps in Android M? but have not been able to write something to do this.
I have added <permission android:name="android.permission.CLEAR_APP_CACHE"/>to the manifest but this does not seem to make any difference.

What permissions are considered collection of users' data?

I have recently rolled out a simple app and it is currently still in review. When I filled out the questions I remember that I was asked whether my app collects data or not and I stated no. I am wondering if I chose the right option since I am not so sure now.
These are my permissions in my manifest file:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
I also am not sure if this log code is considered collection of data which is part of my app.
Log.d("TAG", "The interstitial ad wasn't ready yet.");
and
Log.d(LOG_TAG, "onStart");
These log code segments are the same ones available on the ad guide pages for android developers, I've integrated, app open ads, interstitial and banner ads. Also all the permissions are purely to allow the user to be able to see the ads so I'm not sure if this is considered collecting data. My application can work without any internet connection.
I have also made my app available to users from the ages of 6 and above as I believe that it is simple enough to use. Do I need to add in any special code that asks for permission because of this or does my app have to be made specifically for a certain age group if its below the ages of 13? I read through the policies but I don't consider that I'm collecting data or have violated any policies, or showing any type of inappropriate ads as I have disabled all these types of potential ads in my admob account for this specific ad. I'm not sure if I've done everything right or not, can someone tell me how this should be handled as I have not added any targeting code in my app. Its just the basic ad code that I have added to my app.
We cannot determine what if you collect user data from manifest file, but depend on your manifest.
android.permission.ACCESS_NETWORK_STATE is needed for accessing ConnectivityManager (mainly for monitoring network connections in general), while android.permission.ACCESS_WIFI_STATE grants access to WifiManager (for managing all aspects of Wi-Fi connectivity in particular).
In the latest release of Google Play, Google removed the need to ask permission for internet as "most apps need it anyways nowadays". However, for users who have older versions, it is still recommended to leave the code below in your manifest.
If the app doesn't contain any ads:
You can simply remove/ignore it by adding tools:node="remove" in the AndroidManifest.xml file.
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
Even if another third-party library asks for this specific permission, the build will be forced not to merge it in your final Manifest file. You can get more info from this SO answer.
Also you can read about all permission from this link.
Finally, don't worry depend on your manifest they can't be determine if you collect user data or not.

Permission.Write.Settings only granted to system apps - needed to change screen brightness - will code also work on Google Play?

My app has to adjust the screen brightness of the phone. To do so, I needed the following permission:
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Android Studio shows the following error, when I hover over the permission:
Permission is only granted to system apps
But: the code still works when I upload it to my phone. Can somebody explain me why? Furthermore, I'd need to know, if this code will also work, if the user downloads the app from Google Play.
Is there a different approach to change the screen brightness?

Audio Flickering on Bluetooth Device from My Android App

I have an Android app which is basically a Player. My users sometimes uses my app with a connected Bluetooth device like Speaker, Headphone, Car etc.
I have no special code to use or manage Bluetooth. But since Android OS managing it, my users able to use Bluetooth devices without any development from my side.
Lately i got some feedback that my app not playing well on Bluetooth devices and sound freezing or flickering. And they are saying they have no problems with other apps like Spotify, Youtube etc. Also i could not find any issue in my tests.
So any idea what problem can be? Is there anything i can implement to prevent it. Is there any way that i can reproduce that problem?
I don't know it will fix the issue. But for a try, can you please provide the following permission in your app's AndroidManifest.xml
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

How to turn airplanemode ON on Android programatically on API23

I'm trying to turn airplanemode on on Android but I got the following message:
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE
From my point of view (and some researches):
(1) I'm using all necessary permission to do that:
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
(2) The code is not wrong:
Settings.Global.putInt(
context.getContentResolver(),
Settings.Global.AIRPLANE_MODE_ON, 1);
Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
intent.putExtra("state", true);
context.sendBroadcast(intent);
I know that the app needs to be installed as a system app, so I'm installing that under /system/app/my-app/ (I tried /system/priv-app/my-app/ too) and added all the permissions to the folder and to the apk.
The last thing that I tried was the include of android:sharedUserId="android.uid.system" at the AndroidManifest.xml, but doing that the application disappears.
What am I missing here, after all those attempts?
ps: The device is rooted.
Thanks in advance
It seems although Airplane Mode has become a Constant value as of API Level 17 as per the Android development documentation.
Why are you turning airplane mode on? Is there a certain functionality you are trying to accomplish?
I would've posted this in the comments, but I don't have enough rep... tfw

Categories

Resources