How to get apk expansion files after installed application? - android

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.

Related

apptool decompile with AND APKTOOL

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

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.

How to create .obb file for my android project?

i am creating a app and my app size 80 mb and i want to make .obb file for publishing app on play store. i tried google and also try This but not getting please give me proper way for how to create .obb file.
You Just Write the similar code like this in command prompt and get the .obb file in tools folder>>
C:\>C:\Development\Android\adt-bundle-windows-x86-20140321\sdk\tools\jobb -d C:\
Myworkspace\ImageTargets\assets\ -o Imagetargets.obb -k globe -pn com.ib.globeap
p.activity -pv 200 -v

How to compile Android Application with system permissions

I need to compile an application with system permissions in order to use target application com.android.settings. For now while I try to run my apk I get the error message
Test run failed: Permission Denial:
starting instrumentation
ComponentInfo{com.jayway.test/android.test.InstrumentationTestRunner}
from pid=354, uid=354 not allowed
because package com.jayway.test does
not have a signature matching the
target com.android.settings
How can I compile my application with system permissions?
After having some search I found how to sign my application with system (platform) key.
System signatures are located in directory <root-of-android-source-tree>/build/target/product/security. You can use them to sign your application with system privileges.
Add to manifest android:sharedUserId="android.uid.system"
Download System signatures files:
platform.x509.pem
platform.pk8
link:
https://android.googlesource.com/platform/build/+/android-8.0.0_r17/target/product/security/
Sign app through terminal (java -jar signapk.jar platform.x509.pem platform.pk8 unsigned.apk signed.apk) (first you must put all files to one folder), or make certificate with keytool-importkeypair to make google_certificate.keystore and then
link for keytool-importkeypair download and explanation:
https://github.com/getfatday/keytool-importkeypair
After that steps install your signed system app to your device. Good luck!!!
The anser for me was simply delete the debug.keystore file. The default storage location for AVDs is in ~/.android/ on OS X and Linux, in C:\Documents and Settings\.android\ on Windows XP, and in C:\Users\.android\ on Windows Vista.
In Eclipse I "cleaned" the project, uninstalled the App and the TestApp from the emulator and - voila everything ran fine again.

Categories

Resources