How to remove permissions from Huawei Ads Kit - permissions

we found there are many additional permissions(not used by our app) in the ad kit. Any one please let us know if they are able to be removed? Generally users are very sensitive to permissions, especially as they are not required for the app functionalities.

If your app does not require any of the additional permissions, add the code similar to the following in the AndroidManifest.xml file to remove the permission:
<manifest ... xmlns:tools="http://schemas.android.com/tools">
...
<uses-permission android:name="android.permission.INTERNET" tools:node="remove" />
...
</manifest>
For more information please refer this link of SDK Data Security
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/publisher-service-personal-data-0000001050066921#section8547110181017

Related

React native problem with android:exported="true" in other library

React native application. Despite having entered in the manifest android:exported="true" i still have this problem in the build phase. It almost seems that some installed plugins did not insert it.
I read in some posts that proposed as a temporary solution to downgrade to version 30 of the android SDK, but i cannot because with that version it does not allow me to compile.
React Native 0.68
Android SDK version 33
Android Gradle Plugin version 7.3.0
From Merged Manifest
Error: android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. mobile_app.app debug manifest, line 26 Error: android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. mobile_app.app debug manifest, line 33
Based on the response from Aleja Duque-Torres, here's a temporary solution by adding the following code segment to your AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="...your package name"
xmlns:tools="http://schemas.android.com/tools"> <!-- ADD THIS LINE -->
<!-- Other Content -->
<application
.../>
<!-- ADD STARTS HERE -->
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
android:exported="false"
tools:replace="android:exported"/>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
android:exported="false"
tools:replace="android:exported"/>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
android:exported="false"
tools:replace="android:exported"/>
<!-- ADD ENDS HERE -->
</application>
</manifest>
Then do a build folder clean and run the project again. Hope this helps!
P.s. my guess is that this problem is due to some dependency package getting messed up. If someone else has any insight please feel free to shed some light on it!
solution:
In Git-bash run: * ./gradlew assembleDebug --stacktrace --info | tee my-logs.txt
Search "InstrumentationActivityInvoker"
Open file and add android:exported="true" on activity
Same issue, But I can't know the reason for it. It happens when I have updated macos, Do you have any information?

Expo Apple Pay Stripe Merchant Identifier Issue

I am trying to implement Apple Pay on my Expo managed app.
I followed the documentation here https://stripe.com/docs/apple-pay except adding the capability in XCode (because it's an Expo app and it doesn't use Expo).
I have included my merchant ID in the plugins folder in my app.json.
And I have also wrapped my whole app in the <StripeProvider /> and included the merchantIdentifier there.
<StripeProvider merchantIdentifier="merchant.xxx.xxx.xxx" >
<App />
</StripeProvider>
enter code here
I believe that I've followed the documentation laid out by Expo and Stripe.
If I run expo config --type introspect I can see the entitlement there:
ios: {
entitlements: {
'aps-environment': 'development',
'com.apple.developer.in-app-payments': [
'merchant.com.xxx.xxx'
]
},
I then run eas build -p ios and create an ipa file. I then upload that to TestFlight to give the functionality a test on a real device.
But as soon as I try to call presentApplePay(), I get the error You must provide merchantIdentifier.
What am I missing here? Any help would be greatly appreciated.
You must include the publishableKey as well.

Is there a way to remove default permissions in react-native without ejecting?

I want to remove default android permissions in react-native app:
READ_PHONE_STATE,
WRITE_EXTERNAL_STORAGE
READ_EXTERNAL_STORAGE.
The only way I found to do it, is to modify AndroidManifest.xml :
https://facebook.github.io/react-native/docs/removing-default-permissions.
My question is: there is a way to do it without ejecting my app? As I don't want to loose the features which Expo provides.
Take a loot at the docs.
Where they say:
Note: If you don't specify android.permissions inside your app.json, by default your standalone Android app will require all of the permissions listed above.
Also look at:
In order to request permissions in a standalone Android app, you need to specify the corresponding native permission types in the android.permissions key inside app.json read more about configuration. The mapping between Permissions values and native permission types is as follows
You can add in your app.json only the permissions you want:
{
...
"permissions": [ ... ]
}

Storage Permission in Flutter

I am trying to get storage permission in the initstate() function of the class.I used two packages - Simple_Permissions and Permission package. But both give the same error to me.
FYI - I have put the permission in manifest already.
"E/SimplePermission( 6405): set to never ask againandroid.permission.WRITE_EXTERNAL_STORAGE
I/SimplePermission( 6405): Requesting permission status : 4
I/flutter ( 6405): permission request result is PermissionStatus.deniedNeverAsk"
What I understood from this is that this error should come if the permission was set to "never ask again" by the user . But it is the first time I am requesting storage permission in my app .
What I have tried:
Uninstalling and reinstalling the app.
Using 2 different permission packages
Running app on different Android Versions, different emulators.
Also:
I request 2 permissions in my app, one for location and other for writing storage.
When I go to the settings --> installed apps --> permissions --> I CAN see the permission for location and I can turn it on/off. But I CANNOT see permission for storage.
Have you added the below code to android manifest file?
uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
Another way to access storage using permission_handler package
dependencies:
permission_handler: ^5.0.1
Code Snippet
status.isUndetermined is used to determine whether we had asked for permission yet or not.
var status = await Permission.storage.status;
if (status.isUndetermined) {
// You can request multiple permissions at once.
Map<Permission, PermissionStatus> statuses = await [
Permission.storage,
Permission.camera,
].request();
print(statuses[Permission.storage]); // it should print PermissionStatus.granted
}
Note: Don't forget to add permission in AndroidMenifest for android & info.plist for iOS.
This may be happening because another plugin is setting android:maxSdkVersion attribute on your WRITE_EXTERNAL_STORAGE declaration in the AndroidManifest.xml Try replacing the line in AndroidManifest.xml with:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:remove="android:maxSdkVersion"/>
This fixed the issue for me.

PROVIDE_BACKGROUND permission not longer needed?

According to https://developer.android.com/training/wearables/watch-faces/service.html, I need the two privileges shown here from my manifest file:
<!-- Required to act as a custom watch face. -->
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<!-- So we can keep the screen on and start vibrations -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
However, starting recently (perhaps since I upgraded my watch to 6.0?) I see the following in the log:
06-07 12:14:24.609 470-493/? W/PackageManager: Unknown permission com.google.android.permission.PROVIDE_BACKGROUND in package com.pipperpublishing.refwatch
I've Googled for any changes in the permission model, perhaps associated with the new model in 6.0, but can't find anything about this.
Any thoughts?
UPDATE: Looking at https://developer.android.com/reference/android/Manifest.permission.html it's clear that PROVIDE_BACKGROUND is no longer there, but I can't find anything that says it's been replaced or why it's no longer needed.
I relayed this question over to the Wear development community on G+, and according to a Google dev advocate there, this permission was never actually used - and is safe to remove from your manifests.
Reference: https://plus.google.com/+SterlingUdell/posts/hvec9y93Gtf