How to see the AndroidManifest.xml of my imported packages? - android

Let's say I have the following import inside my application build.gradle file:
implementation "com.facebook.android:facebook-android-sdk:4.28.0"
I want to see the AndroidManifest.xml of this package. How do I go about doing this?

You can check it in your AS,For example,I want to check com.android.support:design-27.0.2's AndroidManifest.xml file
step 1
step 2
step 3
Reedit for step 1

Download the aar by searching in this website :
https://search.maven.org/search?q=a:facebook-android-sdk
Then extract the aar file using 7ZIP and you will see the android manifest however, I believe you won't see the full file content due to some protections against reverse engineering.
You can download it as JAR instead and use some tools to try to decompile it.

You can find the aar file in the
cd ~/.gradle/caches/modules-2/files-2.1/com.facebook.android/facebook-android-sdk
directory, unzip the aar, you will get the file.

Related

How to download aar and pom file from jitpack.io manually?

One of my clients has a restricted environment to fetch few transitive dependencies in the Android studio.
One of dependecy DSBridge-Android which is serving by jitpack.io is failing to fetch due to network restrictions.
I couldn't find the option to download AAR and POM files manually to put into project directly.
Any one has idea to download depenedencies manually which are serving by https://jitpack.io/
Thanks in advance :)
Finally, I found a solution!!
Open following URL format in browser then it will download respective jar/aar/pom/etc file. You can find the file path in the log file.
https://jitpack.io/FILE_PATH
Let me explain with one example:
Let's say I want the AAR and POM file of https://jitpack.io/#wendux/DSBridge-Android
Open the log file of the version that you want as follows
Scroll down till you find the Files: section as follows
Then copy the file path of the required file and open it in the browser with https://jitpack.io/FILE_PATH format. The file will be downloaded now.
Ex: https://jitpack.io/com/github/wendux/DSBridge-Android/v3.0.0/DSBridge-Android-v3.0.0.aar
Happy Coding!!

how to change manifest in debug folder

I did clone android project from GitHub and i wanted to change it.
the app got permission for .ACCESS_COARSE_LOCATION. but there isn't any permission like that.
I searched that permission in the app folder and i found it in another manifest with this path AppName/build/intermediates/manifests/full/debug
I tried to remove this permission but when i open project in android studio the permission come back!
what should i do to remove this?
consider there isn't any permission like that in the main manifest in android studio.
As Code-Apprentice said all the files under the build folder are auto-generated when you compile your app. Editing it won't have any effect, rather you should try to analyse from where this permission is coming!
Manifest is getting merged with libraries and other modules and then merged manifest actually goes into the apk. You can always analyse merged manifest apk by checking "Merged Manifest" tab and click on permission or any components to see from which modules/libraries it is exactly coming!
All files under the build folder are generated when you compile your app. Editing these files directly will have no effect. Instead, you need to edit the source that these files are generated from. Some of the generated AndroidManifest.xml comes from the app/build.gradle file and the rest comes from app/src/main/AndroidManifest.xml. You should edit these as needed.

How to compile AndroidManifest.xml programmatically on Android?

I want to know how to implement a apk editor which can edit app name and version.
A way I can figure out takes several steps:
unzip apk file
modify app name and version in AndroidManifest.xml
replace the AndroidManifest.xml with the modified one
compress them into a new apk file
sign and align it
I can do all the steps above except Step 2. The AndroidManifest.xml file is compiled and cannot be parsed as normal xml file. I know apktool can compile and decompile it but I cannot find a easy way to run apktool on Android after several hours searching. I also cannot find any open-source apk editors(what I need is not only a apk editor, I want to develop another app based on it).
Finally I find some projects for reading and writing AXML(Android XML) and resources.arsc:
ArscEditor
axml
So I can wirte an apk builder with them. For more information, see my repo Auto.js-ApkBuilder.

How can I add a jar to an APK & make the APK refer to it without Eclipse?

This may seem a bit weird, but I need to implement it.
I have an APK & I dont have its source code.
Now I can break the apk , modify & repack it, but while doing so, I need to add my custom jar to it & make the app/apk refer this library/jar at run time.
If I just create a folder libs inside the apk & put my jar inside, I get a NoClassDefFound error.
Any idea how to implement it using ANT or any other tool ?
Thanx in advance
The Jar(s) you attach in your android project, are not copied into APK.
What happens is that, The code of your Jar(s) file becomes part of your Android code. That means you can not simply place(or copy) Jar files in your APK.
But, There is a way around. In APK, your source code can be found in the classes.dex file.
What you need to do is, follow the steps
1 - Extract APK using winRAR
2 - Convert classes.dex to Jar using dex2jar
3 - Extract Jar file
4 - You will have source code in *.class, You can use JdGUI to convert it to *.java.
Now, you can create new android project and use the code.
This is not possible. All the classes are already compiled. You will need to "build" the APK again so that proper references could be remapped.

Using apktool to decompile apk file

I tried extracting apk file using apktool. I followed steps mentioned below.
Is there a way to get the source code from an APK file?
but i am not able to get it completely.I am not sure about where to put the apktool and how to decompile apk file.
i got following error while running apktool command
C:\Windows\System32>apktool.bat
Unable to access jarfile C:\Windows\System32\apktool.jar
Please help me to sort this out.
Thanks in advance
I faced the same problem. I my case i discovered that the jar file is present in a separate package and i had to download apktool1.5.2.tar.bz2 in addition to apktool-install-windows-r05-ibot.tar.bz2 .
Then i extracted the jar file and placed it in the same directory as apktool.
Hope it helps.
I also had this problem, then i noticed this in apktool.After done that,apktool gone well.
Rename downloaded jar to apktool.jar
I would create a folder called "apktool" somewhere where it won't be deleted ( a safe spot ).
Download the wrapper file & the apktool file itself via the Google code page (linked below). This is 2 files. One is a wrapper, OS specific, along with aapt ( which is needed for rebuild), and the other is simply apktool.jar which is the main application.
Once that is done, go into Environment Variables (PATH) for Windows, and add that current directory to it. So you can access apktool / aapt anywhere via command prompt.
http://code.google.com/p/android-apktool/
ApkTool + Dex2Jar + any java decompiler? Comon! This is old style :0)
Try NEW open-source APK and DEX decompiler called Jadx: https://sourceforge.net/projects/jadx/files/
It has also online version here: http://www.javadecompilers.com/apk/
I have followed https://ibotpeaches.github.io/Apktool/install/ link for windows and renamed jar file as "apktool.jar" with extra jar extension (ie.apktool.jar.jar) so I was getting "Error: Unable to access jarfile C:\APKtool\apktool.jar".
After renaming properly (removing extra .jar extension) , I am able to use "apktool.jar" properly.
I know it is silly mistake, but some time it happens :)
Those who are still facing same issue, follow below steps:
Download "https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/windows/apktool.bat"
download latest apktool from https://bitbucket.org/iBotPeaches/apktool/downloads/
Rename apktool_version.jar to apktool.jar
Put .bat and .jar in same folder.
Run apktool.bar d "path of apkfile/example.apk"

Categories

Resources