how to execute the baksmali.jar in an android device - android

For the purpose of developing an Anti-malware on Android, I need to have the smali representation of an APK.
I'm trying to execute the the baksmali.jar directly on the device. I asked the author of the tool GitHub: Executing baksmali on an Android device.
I followed the steps according to the post
Stack overflow: How to execute the dex file in android with command?
I downloaded the v2.2b4 version
dx --dex --output=classes.dex baksmali.jar I used the dx tool from android/Sdk/build-tools/25.0.2
zip baksmali.zip classes.dex
adb push baksmali.zip /sdcard/ I'm using a genymotion emulator custom phone-4.4.4 API 19
adb shell mkdir /sdcard/dalvik-cache
adb shell ANDROID_DATA=/sdcard dalvikvm -cp /sdcard/baksmali.zip org.jf.baksmali.Main
After that, I'm getting this error message Unable to locate class 'org/jf/baksmali/Main'
Precisely
Unable to locate class 'org/jf/baksmali/Main'
java.lang.NoClassDefFoundError: org/jf/baksmali/Main
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jf.baksmali.Main" on path: DexPathList[[zip file "/sdcard/baksmali.zip"],nativeLibraryDirectories=[/system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
... 1 more
Suppressed: java.io.IOException: unable to open DEX file
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:296)
at dalvik.system.DexFile.<init>(DexFile.java:80)
at dalvik.system.DexFile.<init>(DexFile.java:59)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:230)
at dalvik.system.DexPathList.<init>(DexPathList.java:112)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:38)
at java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:116)
at java.lang.ClassLoader.access$000(ClassLoader.java:65)
at java.lang.ClassLoader$SystemClassLoader.<clinit>(ClassLoader.java:81)
at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:125)
... 1 more
I don't understand this error, the classe path is correct.
How can I fix this ?
Thank you in advance.

After moving around, I finally found the solution to the following problem:
" execute the baksmali.jar in an android device, ideally the execution is launched by an application targeting another application."
So, lets say we wont to develop an application that is able to "baksmali" (disassemble) another application, without requiring any special permission.
These are the steps to get the job done:
download the baksmali.jar v1.2.3
add the jar to the app/libs directory of the android studio project
right click on the jar and select the option "Add it as a Library"
(use the "Project->project" view to see the libs directory, you may not see it in the "Project->android" view)
you can use the org.jf.baksmali.main.mainmethode by passing the CLIarguments to that method using a String[]
Here is a helloWorld App illustrating the use cas:
GitHub: Baksmali Hello world
After launchig the application you should see folders in the /data/data/com.example.bartman.baksmalihelloworld/<name_of_baksmali_output>

Related

How to fix React Native app error in Android Studio?

I have the following error when I try to run my React Native app in Android Studio.
When running the application, it tries to start, but fails and displays the following error.
07/26 15:05:47: Launching 'app' on Pixel 3 API R.
$ adb shell am start -n "com.recetasdemiyaya/com.recetasdemiyaya.SplashActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 6259 on device 'Pixel_3_API_R [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/recetasdemiyay: Not late-enabling -Xcheck:jni (already on)
I/recetasdemiyay: Unquickening 13 vdex files!
W/recetasdemiyay: Unexpected CPU variant for X86 using defaults: x86
I/recetasdemiyay: The ClassLoaderContext is a special shared library.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
No Network Security Config specified, using platform default
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.recetasdemiyaya, PID: 6259
java.lang.RuntimeException: Unable to instantiate application com.recetasdemiyaya.MainApplication: java.lang.ClassNotFoundException: Didn't find class "com.recetasdemiyaya.MainApplication" on path: DexPathList[[zip file "/data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/base.apk"],nativeLibraryDirectories=[/data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/lib/x86, /data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/base.apk!/lib/x86, /system/lib, /system_ext/lib, /product/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:1211)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6521)
at android.app.ActivityThread.access$1300(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1885)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7464)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.recetasdemiyaya.MainApplication" on path: DexPathList[[zip file "/data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/base.apk"],nativeLibraryDirectories=[/data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/lib/x86, /data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/base.apk!/lib/x86, /system/lib, /system_ext/lib, /product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:202)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:76)
at androidx.core.app.CoreComponentFactory.instantiateApplication(CoreComponentFactory.java:49)
at android.app.Instrumentation.newApplication(Instrumentation.java:1158)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1203)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6521) 
at android.app.ActivityThread.access$1300(ActivityThread.java:229) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1885) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:216) 
at android.app.ActivityThread.main(ActivityThread.java:7464) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955) 
In the EVENT LOG section, it shows me the following error:
Unsupported Modules Detected: Compilation is not supported for
following modules: lottie-react-native, react-native-admob,
android-react-native-fbsdk, android-react-native-onesignal,
android-react-native-fast-image, android-react-native-blur,
android-react-native-webview, android-react-native-vector-icons,
android-react-native-gesture-handler,
android-react-native-linear-gradient, android-react-native-admob,
android-lottie-react-native, react-native-blur, react-native-fbsdk,
react-native-onesignal, react-native-gesture-handler,
react-native-vector-icons, react-native-linear-gradient,
react-native-fast-image, react-native-webview. Unfortunately you can't
have non-Gradle Java modules and Android-Gradle modules in one project
.
When I try to run the application in the terminal from the root of my project, with the react-native run-android command, the application shows for an instant, but it doesn't start working, but it doesn't show me errors.
However, when I run the react-native run-ios command the application works perfectly in my simulator.
My experience is little and my command of English is also little, so I do not know where to go and where to look within my project to correct the errors that Android Studio shows me.
I have updated Android Studio, as I have read similar problems before coming to ask, but I don't know how to eliminate LA CACHES / RESTART => INVALIDATE CACHES & RESTART, which I have seen in another question
What should I do for Invalidate Caches?
I'm still looking for a solution, but I can't find a way, I keep looking at other questions, but I think I'm not looking correctly, and that's why I'm here.
Can you help me ?
Thank you
1- close the project
2- close Android Studio IDE
3- delete the .idea directory
4- delete all .iml files
5- open Android Studio IDE and import the project
if issue still exist copy project to other location and open it again in Android studio.
Cleaning gradlew works for me
cd android && ./gradlew clean && cd ..

Android App Digital Persona couldn't find "libdpfr6.so"

I am developing an Android App that uses fingerprint reader Digital Persona 4500 UareU.
When I trying to get the readers I get this error:
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError:
dalvik.system.PathClassLoader[DexPathList
[[zip file "/data/app/com.zaimella.enrollment-1/base.apk"],
nativeLibraryDirectories=[
/data/app/com.zaimella.enrollment-1/lib/arm,
/system/lib,
/vendor/lib]]]
couldn't find "libdpfr6.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:984)
at java.lang.System.loadLibrary(System.java:1567)
at com.digitalpersona.uareu.jni.Dpfpdd.<init>(Dpfpdd.java:43)
at com.digitalpersona.uareu.dpfpdd.ReaderCollectionImpl.<init>(ReaderCollectionImpl.java:24)
at java.lang.Class.newInstance(Native Method)
at com.digitalpersona.uareu.UareUGlobal.GetReaderCollection(UareUGlobal.java:39)
Please HELP !!!
Thanks.
The SOLUTION !!!
1.- Install DigitalPersona SDK
2.- Get jniLibs from the installation: DigitalPersona\U.are.U SDK\Android\bin\android-21
3.- You must include the jniLibs folder into your project. See picture 1
4.- Build -> Make Project
5.- Be sure that jniLibs are included into your apk file. See picture 2
6.- Install the App using "adb install"
7.- BE HAPPY !!!
jniLibs folder into your project
jniLibs folder into your apk file

Unable to convert app bundle to APK in android

I am using Android studio 3.4.1.
I was trying to convert the App bundle to APK using the bundle tool. I was unable to generate the APK file. I tried using
Generate Apk file from aab file (android app bundle)
When I run the command
java -jar bundletool.jar build-apks --bundle=app.aab --output=app.apks
I got the below error.
Kindly suggest me a solution to generate the APK.
INFO: The APKs will be signed with the debug keystore found at 'C:\Users\~\
.android\debug.keystore'.
[BT:0.10.2] Error: com.android.tools.build.bundletool.model.Aapt2Command$Aapt2Ex
ception: Command '[C:\Users\~\AppData\Local\Temp\8658885577631656545\output
\windows\aapt2.exe, convert, --output-format, binary, -o, C:\Users\~\AppDat
a\Local\Temp\6789457478435634974\binary.apk, C:\Users\~\AppData\Local\Temp\
6789457478435634974\proto.apk]' didn't terminate successfully (exit code: -10737
41701). Check the logs.
java.lang.RuntimeException: com.android.tools.build.bundletool.model.Aapt2Comman
d$Aapt2Exception: Command '[C:\Users\~\AppData\Local\Temp\86588855776316565
45\output\windows\aapt2.exe, convert, --output-format, binary, -o, C:\Users\Yamu
na\AppData\Local\Temp\6789457478435634974\binary.apk, C:\Users\~\AppData\Lo
cal\Temp\6789457478435634974\proto.apk]' didn't terminate successfully (exit cod
e: -1073741701). Check the logs.
at com.android.tools.build.bundletool.io.ConcurrencyUtils.waitFor(Concur
rencyUtils.java:59)
at com.android.tools.build.bundletool.io.ConcurrencyUtils.waitForAll(Con
currencyUtils.java:42)
at java.util.function.Function.lambda$andThen$1(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.android.tools.build.bundletool.io.ApkSerializerManager.serializeA
pks(ApkSerializerManager.java:180)
at com.android.tools.build.bundletool.io.ApkSerializerManager.populateAp
kSetBuilder(ApkSerializerManager.java:101)
at com.android.tools.build.bundletool.commands.BuildApksManager.executeW
ithZip(BuildApksManager.java:229)
at com.android.tools.build.bundletool.commands.BuildApksManager.execute(
BuildApksManager.java:110)
at com.android.tools.build.bundletool.commands.BuildApksCommand.execute(
BuildApksCommand.java:524)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain
.java:74)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain
.java:46)
Suppressed: java.io.UncheckedIOException: java.nio.file.FileSystemExcept
ion: C:\Users\~\AppData\Local\Temp\8658885577631656545: failed to delete on
e or more files; see suppressed exceptions for details
at com.android.tools.build.bundletool.io.TempDirectory.close(Tem
pDirectory.java:59)
at com.android.tools.build.bundletool.commands.BuildApksCommand.
execute(BuildApksCommand.java:525)
... 2 more
Caused by: java.nio.file.FileSystemException: C:\Users\~\AppData\Lo
cal\Temp\8658885577631656545: failed to delete one or more files; see suppressed
exceptions for details
at com.google.common.io.MoreFiles.throwDeleteFailed(MoreFiles.ja
va:791)
at com.google.common.io.MoreFiles.deleteRecursively(MoreFiles.ja
va:537)
at com.android.tools.build.bundletool.io.TempDirectory.close(Tem
pDirectory.java:57)
... 3 more
Suppressed: java.nio.file.DirectoryNotEmptyException: C:\Users\Y
amuna\AppData\Local\Temp\8658885577631656545\output\windows
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unkno
wn Source)
at sun.nio.fs.AbstractFileSystemProvider.delete(Unknown
Source)
at java.nio.file.Files.delete(Unknown Source)
at com.google.common.io.MoreFiles.deleteRecursivelyInsec
ure(MoreFiles.java:665)
at com.google.common.io.MoreFiles.deleteDirectoryContent
sInsecure(MoreFiles.java:685)
at com.google.common.io.MoreFiles.deleteRecursivelyInsec
ure(MoreFiles.java:658)
at com.google.common.io.MoreFiles.deleteDirectoryContent
sInsecure(MoreFiles.java:685)
at com.google.common.io.MoreFiles.deleteRecursivelyInsec
ure(MoreFiles.java:658)
at com.google.common.io.MoreFiles.deleteRecursively(More
Files.java:526)
... 4 more
Caused by: java.util.concurrent.ExecutionException: com.android.tools.build.bund
letool.model.Aapt2Command$Aapt2Exception: Command '[C:\Users\~\AppData\Loca
l\Temp\8658885577631656545\output\windows\aapt2.exe, convert, --output-format, b
inary, -o, C:\Users\~\AppData\Local\Temp\6789457478435634974\binary.apk, C:
\Users\~\AppData\Local\Temp\6789457478435634974\proto.apk]' didn't terminat
e successfully (exit code: -1073741701). Check the logs.
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(Abstrac
tFuture.java:502)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.j
ava:481)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(Ab
stractFuture.java:83)
at com.android.tools.build.bundletool.io.ConcurrencyUtils.waitFor(Concur
rencyUtils.java:49)
... 10 more
Caused by: com.android.tools.build.bundletool.model.Aapt2Command$Aapt2Exception:
Command '[C:\Users\~\AppData\Local\Temp\8658885577631656545\output\windows
\aapt2.exe, convert, --output-format, binary, -o, C:\Users\~\AppData\Local\
Temp\6789457478435634974\binary.apk, C:\Users\~\AppData\Local\Temp\67894574
78435634974\proto.apk]' didn't terminate successfully (exit code: -1073741701).
Check the logs.
at com.android.tools.build.bundletool.model.Aapt2Command$CommandExecutor
.execute(Aapt2Command.java:62)
at com.android.tools.build.bundletool.model.Aapt2Command$1.convertApkPro
toToBinary(Aapt2Command.java:36)
at com.android.tools.build.bundletool.io.ApkSerializerHelper.writeToZipF
ile(ApkSerializerHelper.java:159)
at com.android.tools.build.bundletool.io.ApkSerializerHelper.writeToZipF
ile(ApkSerializerHelper.java:144)
at com.android.tools.build.bundletool.io.SplitApkSerializer.writeToDisk(
SplitApkSerializer.java:75)
at com.android.tools.build.bundletool.io.SplitApkSerializer.writeSplitTo
Disk(SplitApkSerializer.java:53)
at com.android.tools.build.bundletool.io.ApkSetBuilderFactory$ApkSetArch
iveBuilder.addSplitApk(ApkSetBuilderFactory.java:105)
at com.android.tools.build.bundletool.io.ApkSerializerManager$ApkSeriali
zer.serialize(ApkSerializerManager.java:376)
at com.android.tools.build.bundletool.io.ApkSerializerManager.lambda$nul
l$3(ApkSerializerManager.java:184)
at com.google.common.util.concurrent.TrustedListenableFutureTask$Trusted
FutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:117)
at com.google.common.util.concurrent.InterruptibleTask.run(Interruptible
Task.java:38)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(Tru
stedListenableFutureTask.java:77)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
You need to download the latest bundletool.jar, After downloading bundle tool you need to open a terminal with the same path as bundle tool located. perform below command you can generate APKS.
1 Below command creates a set of unsigned APKs.
java -jar bundletool.jar build-apks --bundle=app.aab --output=unsigned.apks
2 Below command creates a set of Signed APKs.
java -jar bundletool.jar build-apks --bundle=app.aab --output=signed.apks --ks=test.jks --ks-key-alias=replaceyouralieas
Above command will ask you to enter your Keystore password, you need to enter your Keystore password.
3 Below command will find correct apk for your device & install into the device
java -jar bundletool.jar install-apks --apks=signed.apks
For more detail
Fix permissions or take ownership of C:\\Users\~\Appdata\Local\Temp... it cannot delete there. That profile path with a ~ is even quite strange for Windows, because ~ indicates the current user's home directory on Linux. Actually, ~ would have to be the current Windows user name, so that it would inherit the permissions from the current user's profile directory ...which it doesn't, and that's exactly why it fails.
Linking C:\\Users\~ to C:\\Users\username might be an easy way to work around the problem, when not being able to change the ~ for temporary storage.
Fell free to file an issue on GitHub, if the latest version of bundletool still picks up the user profile directory wrongfully. Could image that the Linux sub-system might interfere, because that ~ is not "normal" for Windows.
Hi Your using Android Studio, My Theme is why don't you follow traditional Approach in Android Studio.
Step 1 --> Open Android Studio and Select Build.
Step 2 --> Select Build Bundle/ APK Then you can see 2 Options Build APK and Build Bundle.
Step 3 --> Select Build APK for APK (It is for Normal APK).
For signed APK also same theme
You might know this things but I don't your requirement to use Commands and conversion from .aab to .apk

"error=2, No such file or directory" when Hosting an executable within Android application

Problem Description
I'm am working with an android application that is hosting an arm executable located in the internal storage (/data/data/APPNAME/files/EXECUTABLE).
When I check the file like this :
filePath = context.getFilesDir().getPath()+"/SMILExtract-static"
Process process = Runtime.getRuntime().exec("file " + filePath);
the shell output is:
/data/user/0/app.me.phonestudy/files/SMILExtract-static: ELF shared object, 32-bit LSB arm, dynamic (/usr/lib/libc.so.1), for Android 21, built by NDK r15c (4203891), stripped
so the file must obviously exist.
Yet when I make the file executable and execute it:
Runtime.getRuntime().exec("/system/bin/chmod 777 " + filePath);
Runtime.getRuntime().exec(filePath);
I get this error:
04-04 22:26:41.774 24708-24896/app.me.phonestudy E/AndroidRuntime: FATAL EXCEPTION: data Processing Thread
Process: app.me.phonestudy, PID: 24708
java.lang.RuntimeException: java.io.IOException: Cannot run program "/data/user/0/app.me.phonestudy/files/SMILExtract-static": error=2, No such file or directory
Caused by: java.io.IOException: Cannot run program "/data/user/0/app.me.phonestudy/files/SMILExtract-static": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:692)
at java.lang.Runtime.exec(Runtime.java:525)
at java.lang.Runtime.exec(Runtime.java:422)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)
at java.lang.ProcessImpl.start(ProcessImpl.java:128)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at java.lang.Runtime.exec(Runtime.java:692) 
at java.lang.Runtime.exec(Runtime.java:525) 
at java.lang.Runtime.exec(Runtime.java:422) 
at
Question
Why cant the file be found when it obviously exists at the given path?
My only lead is this post: https://askubuntu.com/questions/133389/no-such-file-or-directory-but-the-file-exists which mentions compatibility issues when trying to run a 32-bit binary on a 64-bit system that doesn't have 32-bit support installed. Since this post is not specifically for android systems it didnt really help me in solving my problem.
I appreciate your advice.
I believe either it can't find the material, or you didn't install it correctly.

Apktool error on mac

When I try to run the apktool to decompile my apk it gives off an error:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file
at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:199)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:83)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
Caused by: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:55)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:38)
at brut.androlib.res.util.ExtFile.getDirectory(ExtFile.java:55)
at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:197)
... 3 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:128)
at java.util.zip.ZipFile.<init>(ZipFile.java:145)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:53)
... 6 more
I followed this guide. http://www.adventuresofanentrepreneur.net/creating-a-mobile-appsgames-company/how-to-unpack-pack-an-apk-file
Am I missing some files it needs to operate?
I checked all the other solution but now I found i was using jdk1.6 which was preinstalled on my machine. Maybe a java update might solve this problem. The apktool documentation explicitly mentions that it needs minimum of jdk 1.7. More info here:https://code.google.com/p/android-apktool/
try unzip your apk file first
apk is a zipfile the message said it cannot unzip the apk first
so try your self to unzip the apk file to find whether it is a real apk
This error means Apktool cannot open the Zipfile to read the files it wants (classes.dex in this case). Try using a regular Zip program (Like 7zip or Winrar) and try and unzip the apk. If this works, then apktool is at fault and you should report a bug. However, I believe it will fail, in which case you need to figure out why that is. It could be any of the following reasons:
Apk utilizes the "general access bit" hack, which no longer runs on Android, thus apktool removed support for it.
Apk has a password on it.
Apk was improperly downloaded, thus not complete

Categories

Resources