apptool decompile with AND APKTOOL - android

i want to decompile my recent apk to test is it.
i run the code
C:\Users\admin\apktool d OwnApp.apk
but it's getting error with :
Input file (OwnApp.apk) was not found or was not readable.
why am i getting this?

Procedure for decoding .apk files, step-by-step method:
Step 1:
1). Make a new folder and copy over the .apk file that you want to decode.
2). Now rename the extension of this .apk file to .zip (e.g. rename from filename.apk to filename.zip) and save it.
3). Now you can access the classes.dex files, etc. At this stage you are able to see drawables but not xml and java files, so continue.
Step 2:
1). Now extract this .zip file in the same folder (or NEW FOLDER).
2). Download dex2jar and extract it to the same folder (or NEW FOLDER).
3). Move the classes.dex file into the dex2jar folder.
4). Now open command prompt and change directory to that folder (or NEW FOLDER). 5). Then write d2j-dex2jar classes.dex (for mac terminal or ubuntu write ./d2j-dex2jar.sh classes.dex) and press enter.
6). You now have the classes.dex.dex2jar file in the same folder.
7). Download java decompiler, double click on jd-gui, click on open file, and open classes.dex.dex2jar file from that folder: now you get class files.
8). Save all of these class files (In jd-gui, click File -> Save All Sources) by src name. At this stage you get the java source but the .xml files are still unreadable, so continue.
Step 3:
1). Now open another new folder
2). Put in the .apk file which you want to decode
3). Download the latest version of apktool AND apktool install window (both can be downloaded from the same link) and place them in the same folder
4). Open a command window apktool d myApp.apk (where myApp.apk denotes the filename that you want to decode)
5). now you get a file folder in that folder and can easily read the apk's xml files.
this solutions is extracted from this StactOverflow site Check Here
you can download all the required libraries from here libraries

Recompiling apk using apktool for MAC:-
Process to DeCompile APK(Android Package):
Open terminal and cd to apk directory
type su
apktool d <../../pathToMyAPK>
Process to ReCompile APK(Android Package):
Open terminal and cd to apk directory
type su
apktool b <../../pathToMyAPKFolder>
New apk is generated in  pathToMyAPK/dist/NewAPP.apk
->Now we need to sign the apk to be able to port to device.
To sign an apk:
jarsigner -verbose -keystore <path of my-keystore.keystore> <path of apk> alias_name

For Decompile, Run Apktools Over CMD like C:\\example: apktool d x.apk

Related

Android unzip archive that contains symlink

I've been working on something that requires me to extract files from a zip archive on an Android system that contains symlinks.
When I try to create an archive using zip --symlinks command on the Android filesystem, the symlinks are stored correctly.
When I try to extract the files on a Linux system, ls shows that the symlink links point to the correct place (e.g symlink -> /storage/emulated/legacy).
However, when I use unzip in the adb shell, the extracted symlink don't point to the desired location.
How can I extract the symlinks and make them point to the location they pointed before they were archived? Is it even possible?

Couchbase,Where to add config.json for windows Installation?

I am trying to implement Couch base in my android app following the couchbase tutorial link here
I need to add a config.json file to create my own database link rather than using its default database "Sync_gateway".According to explanation it should be inside bin directory inside a data folder but I can't find a bin directory as I installed sync gatway from .exe file. I don't find run it by any command other than clicking the .exe file. What I am I missing?
If you have installed sync_gateway in Windows then open the file location for the sync_gateway.exe it will be usually in the directory "C:\Program Files (x86)\Couchbase" . You have to place your configure.json in that directory . Now open windows command prompt and do 'cd C:\Program Files (x86)\Couchbase' and run the command 'sync_gateway.exe configure.json' . Ensure that your configure.json file is perfect and does not have any syntax errors. your Sync gateway will now load with your specified configure.json

How to get apk expansion files after installed application?

I use livecode for developed. My project larger than 50MB. It's can't publish to google play store. So I build standalone application without resource files. And I create obb file with jobb.
Step by Step
My project package name is com.tester.guru Version name is 3.0 and Version code is 3
I set signing to "Sign for development only" (for simple install application to my device.)
I set install location to "Allow External Storage"
I create obb file with jobb. Command below:
jobb -d resources directory -o main.3.com.tester.guru.obb -k guruasean -pn com.tester.guru -pv 3
Now I have 2 files:APK file and main.3.com.tester.guru.obb file
Copy the installation file (.apk) to the SD Card and Install it.
Copy the obb file to /Android/obb/
After I do 7 steps and run application. It not show image because image wrong path.
How do I do for solve this problem.

How to unzip, edit and zip an android apk

I have an android apk and I deleted my source code and dont have the project again, I want to change the version code of the old apk. my question is how do I unzip and repack the apk so I can use the. am using a mac system. I saw so many things for windows but i couldnt find for mac.I need help please
unzip apk files
The simplest method is executing unzip command:
unzip xxx.apk -d xxx
A directory xxx will be generated to store unzipped files.
Actually, .apk files are same as .zip files. Execute command file XXX.apk to see that.
get readable text files from apk
If you want readable text files such as the manifest file, I would suggest you to use the apktool. We could install the apktool easily with Homebrew:
brew install apktool
then get the readable text files:
apktool d xxx.apk
after the previous command, a xxx directory contains readable text files and others would be there.
edit zip files
If you want to edit a zip file in place, the Keka might be a good option.
To give a complete answer for unpacking, editing and packing on Mac:
Unpacking / Unzipping
As Liu Tao stated, the easiest way to unpack a *.apk file on mac is to use the following command:
unzip xxx.apk -d xxx
This is because an *.apk file is nothing else than a zip file. Again, as Liu Tao stated, this can be found out with the file command.
file xxx.apk
Which will show an output that looks something like this:
xxx.apk: Zip archive data, at least v2.0 to extract
Editing
I think this is self-explanatory. Go into the folder to which you exported the *.apk contents and edit them as you would usually do.
Packing / Zipping
On Mac, this is also quite straight-forward.
You can use the zip command to pack all the files back into an *.apk file.
zip -r xxx.apk xxx/
You want to use APKTool. It will handle the unzip and rebuild for you: http://ibotpeaches.github.io/Apktool/

Modified and re-signed app doesn't retrieve file names

I have "updated" an old Mac to Mac OS X 10.7.5. I have installed JDK 1.7.0_72 on this Mac. I'm trying use a LiveCode standalone application on my old Android tablet with Android version 2.3.3.
The unmodified standalone, built with the option "sign for development only" runs fine on my tablet, but video won't display.
First, I built the app for Android, using LiveCode 6.6.2 for Windows. Then I copied it over to my Mac. I used
$ java -jar apktool.jar decode /Volumes/Macintosh\ HD/Users/User/Desktop/apk\ tool/MyApp.apk app
to decompile the apk file. It appeared in a folder with the name "app" in my Home directory, with subdirectories:
app
AndroidManifest.xml
apktool.yml
assets/
doc/
links.txt
pic/
vid/
Demos/
Examples/
Other/
Simple Animation.mp4
Vimeo Pro Example.html
Tutorials/
SQL.html
build/
lib/
res/
smali/
The contents of the assets folder is included by LiveCode's standalone builder. I created all of these files and folders during project development. The folders in the vid folder contain several HTML files and one mp4 file. I have listed only a few of the html files in the file tree.
I changed the file AndroidManifest.xml by replacing the line
<application android:label="MyApp" android:debuggable="false">
with
<application android:label="MyApp" android:debuggable="false" android:hardwareAccelerated="true">
After this, I rebuilt the app, using apktool again. I used sudo, because here it said I had to use sudo:
$ sudo java -jar /Volumes/Macintosh\ HD/Users/User/Desktop/apk\ tool/apktool_1.5.2.jar b -a /Volumes/Macintosh\ HD/Developer/android-s-d-k-mac_x86/platform-tools/aapt
It appears that if you use sudo once, you have to use sudo all the time. So, now I had to sign it using
$ sudo jarsigner -verbose -sigalg SHAwithRSA -digestalg SHA1 -keystore /Volumes/Macintosh\ HD/Users/User/app/dist/MyApp.apk myalias
I verified that it was signed and changed the name of the file then aligned the file
/Volumes/Macintosh HD/Users/User/app/dist/MyApp.apk
to
/Volumes/Macintosh HD/Users/User/app/dist/MyApp_unaligned.apk
I aligned the file using
$ zipalign -v 4 /Volumes/Macintosh\ HD/Users/User/app/dist/MyApp_unaligned.apk /Volumes/Macintosh\ HD/Users/user/app/dist/MyApp.apk
This file should work on my Android tablet. I'm able to start and run the file, but my app doesn't see any of the files in the sub folders of folder vid/, except for Simple Animation.mp4. However, it does notice that there are files. A repeat loop that checks all folders in folder vid/ for files creates a list, but the lines in the list are empty, one line for each file, meaning that it can't figure out what the names of the files are. Needless to say, I checked that all files are included in the new apk file.
What may cause this?
If you wonder about the file paths: I started my Mac from an external disk and used the files on the internal disk. So, /Volumes/Macintosh HD isn't the system disk here.

Categories

Resources