[Android] Can we change something in Manifest located in .aar file?

1,501 views
Skip to first unread message

studentvz20

unread,
Jun 10, 2016, 7:39:48 AM6/10/16
to Google Mobile Ads SDK Developers
Hi,

I'm using Google Mobile Ads Plugin in Unity 5.3.4.f1. It is working ok for now but I tried to add Google Analytics V4 plugin. At first it didn't work (it needs old gpgs lib which gets removed by jar resolver) but I then added manually play-services-analytics-9.0.2.aar and play-services-analytics-impl-9.0.2.aar and it work great. But one problem, it adds optional permission WAKE_LOCK. Inside Unity I can't do anything to reove it because it pulls it from Manifest located in .aar file. I tryed this method (http://stackoverflow.com/a/34933166) but then I get Manifest merge error.

Then I removed this permission from AndrdroiManifest located in two .aar files (extracted it, modifed it and returned it back to .aar file). Now I don't have this permission and everything works.

Am I allowed to do this? To tamper with .aar file. I don't want to get ban because of detection that .aar files were modifed.

This is maybe a bit offtopic but analytics git forum is abandoned.

Thank you on your help and sorry for my bad english.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jun 10, 2016, 11:34:20 AM6/10/16
to Google Mobile Ads SDK Developers
Hi there,

Nothing on this forum is off topic even if it tangibly involves our SDK. You do not have to manually add any dependencies for Google Analytics and instead I would suggest you to do this - 
  • Create a new project and import our latest plugin (3.0.4) and make sure that you are able to compile and build on your Android device.
  • Then, go to Assets > PlayServicesResolver > Editor and open AdMobDependencies.cs file. 
    • In the Mono Editor, add this - 
    • svcSupport.DependOn("com.google.android.gms", "play-services-analytics", "LATEST");
  • Next, download the latest Google Analytics V4 plugin and import the Unity package. 
  • Finally, restart the Unity IDE and right click on Assets > PlayServiceResolver (make sure that you are on Android platform) and select Google Play Services > Resolve Client Jars. You will notice that all the required dependencies are now added into Assets > Plugins > Android folder. You will now be able to build without any issues.
Let us know if you need anything else.

Thanks,
Veer Busani
Mobile Ads SDK Team
Message has been deleted
Message has been deleted

studentvz20

unread,
Jun 10, 2016, 12:31:22 PM6/10/16
to Google Mobile Ads SDK Developers
Thank you very much on your support, it is great to have someone who is helping us.

Mine problem is not building, everything works great. My problem is optional permission that I can't remove from my build (in my first post you can see what is going on):

<!-- Optional permission for Analytics to run. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />

Another question, just for info, why is admob plugin adding support-v4-23.1.1.arr and not support-v4-24.0.0.aar?

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jun 10, 2016, 4:04:50 PM6/10/16
to Google Mobile Ads SDK Developers
Hi there,

I would not recommend that you remove this permission and I would not be able to talk about policy as this forum is for the SDK side of things. As to the WAKE_LOCK permission, rather then editing the aar file itself, which I understand is a very easy thing to do, you can use tools such as ApkTool to decompile, edit the manifest and recompile your Unity generated APK. It would not be possible to override the Unity generated Android Application Manifest to remove a user permission. The other workaround would be to generate the Google Android Project and open it in Android Studio to edit your Manifest file (I would prefer to do this).

Also, internally as to why the SDK is calling v 23.1.1 by default, I would not be able to say. But you can always update the dependencies to any version you want either manually or through the Jar Resolver.

Thanks,
Veer Busani
Mobile Ads SDK Team

Reply all
Reply to author
Forward
0 new messages