Apk decompile error: d2j-dex2jar command not found - apk

I try to get source code from an .apk
I followed the steps from right here
Is there a way to get the source code from an APK file? but on Step 2.4 when I wrote on my cmd dex2jar path> d2j-dex2jar classes.dex I get
"'d2j-dex2jar' is not recognized as an internal or external command, operable program or batch files."
any solutions ?

for dex2jar 2.0 version please follow below steps to generate jar
download dex2jar (https://sourceforge.net/projects/dex2jar/files/)
extract folder
goto folder in command prompt
chmod u+x d2j_invoke.sh
chmod u+x d2j-dex2jar.sh
put desired apk to decompile in dex2jar folder
sh d2j-dex2jar.sh -f -o output_jar.jar my_app.apk
This will generate output_jar.jar in same folder

Use dex2jar classes.dex instead of d2j-dex2jar classes.dex
And please check which version of dex2jar is with you.
if it is dex2jar-2.x jar file then , please try to download dex2jar-0.0.9.15 jar file.

Add permission with: chmod +x d2j-dex2jar.sh
Then run it with: ./d2j-dex2jar.sh app.apk

place all the apk file, coverted zip, apktool, apktool install, dex2jar, jd-gui folders under a single folder...
open command prompt(admin)..
then goto the directory of your newly created folder..
then type... d2j-dex2jar classes.dex , press enter...
thats it ur problem is solved...cheezzz
no need to add any xtra permissions...it workwed for me..it'll work for you too...

If you have downloaded the d2j-dex2jar-2.x then it would not contain the d2j-dex2jar.sh file
so, try to download the dex2jar-0.0.9.15 from the link
dex2jar-0.0.9.15
Finally extract this zip file and you will find the d2j-dex2jar.sh file.
Hopefully this will help you!

Just goto the folder where you put your classes.dex file then just run the command in command prompt
http://i.stack.imgur.com/8X3aP.png
-Make sure you have downloaded the dex2jar latest version which is dex2jar-2.0.
download it with this link
https://sourceforge.net/projects/dex2jar/
-It will then make your classes.dex file to executable jar 'classes-dex2jar.jar'

you must use dex2jar-0.0.9.15 to decompile apk older version dos'nt work correctly because missing some files via extension bat

Related

Install pandoc with no administrator access

I'm am using rmarkdown to generate a word output and need pandoc to do so. Unfortunately I do not have administrator access on my work computer so I can't run the installer or use the install.pandoc() option.
I have tried downloading both the .zip and .tar.gz files from the github site and tried to install them manually using the "install" tab in RStudio, but get the error:
Warning in install.packages :
cannot open compressed file 'pandoc-2.2.1-windows-x86/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
Here states "If you prefer not to use the msi installer, we also provide a zip file that contains pandoc’s binaries and documentation. Simply unzip this file and move the binaries to a directory of your choice."
maybe I don't know what they mean by "move the binaries to a directory of your choice." - When I unzip the files, I still cannot access the package.
Side note - I have defined .libpaths() to allow me to install other packages, but i cannot get pandoc to work.
Any suggestions on how to do this?
Pandoc is a terminal application and does not require R-Studio to install it unziping the .tar.gz file with
linux: tar -xzvf filename.tar.gz
for windows the binary is the program pandoc itself that is unzipped from the zip file
simply unzip the file and pandoc should already be installed in the unzipped folder
after unzipping you might want to move pandoc.exe (for windows) int the directory where the project is located so that it is recognized
So there are two steps in this process for me to get it to work.
1: Install Pandoc
First download the MSI from https://github.com/jgm/pandoc/releases/
If you have trouble installing the MSI by right clicking on it, try creating a batch file with the contents:
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"
Then drag and drop the MSI on to this batch file and it will install without asking for any admin privileges.
2:
You'll need to tell the script to find Pandoc if its not running in RStudio already:
if(Sys.getenv("RSTUDIO") != "1"){rmarkdown::find_pandoc(dir = Sys.getenv("pandoc_path"))}
For me Sys.getenv("pandoc_path") = C:/Users/[username]/AppData/Local/Pandoc

cp: cannot stat ‘build/docker/gotools/bin/protoc-gen-go’: No such file or directory

I try to build hyperledger fabric, and have installed the project as the guide in http://hyperledger-fabric.readthedocs.io/en/latest/Setup/Chaincode-setup/#option-1-vagrant-development-environment.
When I try to 'make peer', command is shown as:
vagrant#ubuntu-1404:/opt/gopath/src/github.com/hyperledger/fabric/devenv$
cp: cannot stat 'build/docker/gotools/bin/protoc-gen-go': No such file
or directory
I looked into the folder and didn't find the file protoc-gen-go. Does it indicate that I missed few steps when I was setting up the envrionment?
Step 1: Run
$go get -u github.com/golang/protobuf/protoc-gen-go
Download protoc-gen-go
Step 2: cp
$ cp $GOPATH/bin/protoc-gen-go build/docker/gotools/bin/
Then continue your make.
You can find the file protoc-gen-go in path: $GOPATH/bin, then copy this file to $GOPATH/src/github.com/hyperledger/fabric/build/docker/gotools/bin/.
If all things has done, you can run: make peer and it will work.
I had a same problem. Maybe your GOPATH and GOROOT variables are conflicted with your customized paths.
I solved the problem like this:
Delete /usr/lib/go
Delete /usr/local/go
Download protoc-gen-go ($go get -u github.com/golang/protobuf/protoc-gen-go)
protoc-gen-go binary is created at your go workspace
copy the protoc-gen-go binary to fabric/build/docker/gotools/bin/
BUILD AS make peer
I hope this would helpful to you
Can you try to:
cd /opt/gopath/src/github.com/hyperledger/fabric/
make peer
and see if it works? Looks like you are in the devenv subdir.
I had the same issue when Docker was returning permissions issues causing the build to fail.
Once that happens, the build process won't work successfully even after you fix the Docker issues.
Instead, once Docker is repaired, delete the gotools folder and run make again:
Makefile:245: recipe for target 'build/docker/gotools' failed
make: *** [build/docker/gotools] Error 126
user#:~/go/src/github.com/hyperledger/fabric$ rm -rf build/docker/gotools/
user#:~/go/src/github.com/hyperledger/fabric$ make all

Decompiling apk using apktool

I need to decompile & recompile an apk on windows...
I am following this link Reverse Engineer APK
The issue is I can't find the file that makes requests (refer to above link)"Find the file that makes requests grep -r "RequestUtil.java" "
I tried using WindowsGrep software, but unable to find such file.
I don't know if I am on the wrong track.
Any help will be appreciated.
Thanks
After decompiling apk, change directory to the com.instagram.android/smali: cd com.instagram.android/smali
Search RequestUtil.java by Windows search or following command in command prompt: dir /s *RequestUtil.java*
If the RequestUtil.java not found, it does not exists! Make sure you decompile the correct version of apk.

How to unzip files in a Heroku Buildpack

I'm writing a custom Heroku buildpack (heroku-buildpack-fantom) for Fantom, and as part of the compile script I've downloaded a .zip file (from a language vendor), but how do I unzip it?
unzip is not a recognised command.
gunzip exists but I can't use it to unzip .zip files.
What am I missing?
Even though (by default) Linux does not come pre-installed with unzip, the Heroku dyno does have a jar command. So the following works okay:
> jar xf wotever.zip
Be sure to run the 'file' command on it. I got a .zip file from SourceForge that was actually bzip2 encoded and Heroku has both the bunzip2 decoder and the -j (--bzip2) option on tar to handle it.

Error when opening .tar.gz via Shell to install Apache Maven

Machine:
Mac OSX 10.5.8 32-bit.
Goal:
To install apache maven per its websites instructions, in order to install the JUNG package according to its install instructions, so I can use the JUNG classes in various Java GUIs.
What I Did:
Downloaded a .tar.gz file, and using the shell, moved it to a directory (using mv) I created for it (using mkdir), usr/local/apache-maven per the website directions
I downloaded the file apache-maven-3.0.4-bin.tar.gz. Next I tried extracting the file using tar -zxvf apache-maven-3.0.4-bin.tar.gz.
Error:
I get an error message when I try to extract the apache-maven .gz (install?) file in shell.
tar: apache-maven-3.0.4/direcoryandfile: Cannot open: No such file or directory
...
apache-maven-3.0.4/lib/ext: Cannot mkdir: No such file or directory apache-maven-3.0.4/lib/ext/README.txt
tar: apache-maven-3.0.4/lib/ext/README.txt: Cannot open: No such file or directory tar:
Error exit delayed from previous errors
Instructions:
For the maven building
Extract the distribution archive, i.e. apache-maven-3.0.4-bin.tar.gz to the directory you wish to install Maven 3.0.4... The subdirectory apache-maven-3.0.4 will be created from the archive.
...
for the JUNG installation
Appendix: How to Build JUNG
Get Maven
Download and install maven2 from maven.apache.org: http://maven.apache.org/download.html. At time of writing (early June 2012), the latest version was maven-3.0.4. Install the downloaded maven2 (there are installation instructions on the Maven website).
Follow the installation instructions and confirm a successful installation by typing 'mvn --version' in a command terminal window.
Self-Rectification Attempts
From what I can tell the archive file is missing some directories or something. I tried deleting the file, redownloading the .tar.gz file from a different mirror and repeating the process. Same result. Thanks again for the help
Background:
I'm trying to install the JUNG package to my system's Java, so I can write object-oriented code using various GUIs (Ecliplse, Dr. Java) using the classes in JUNG. I don't understand how the building/installing process works, and how I can get what I build/install to work on various GUIs and the command line. I'm new to shell and the command line, and mostly have experience using a simple IDE (DrJava, Python IDLE, R GUI) to write and compile object-oriented code.
To unpack a tar.gz archive you need to do it either in two steps:
gunzip apache-maven-3.0.4.tar.gz
tar -xf apache-maven-3.0.4.tar
or you might try to do it in a single step:
tar -zxf apache-maven-3.0.4.tar.gz
Two Step Process:
1. Extract the .tar from the .tar.gz using gunzip, and -v for having gunzip print what its doing. gunzip -v apache-maven-3.0.4.tar.gz
2. Extract the .tar file using tar, -x for telling the program to do an extraction, -v for having tar print what its doing, and -f for tar to know that the following file is the archive and appending with sudo so tar has permission to create directories. sudo tar -xvf apache-maven-3.0.4.tar

Resources