Apktools on Mac - macos

I went downloaded the Apktools from the website and got 2 files: Apktool.txt and Apktool_2.2.2. I renamed the Apktool_2.2.2 to Apktools.jar per the instructions. I then went to terminal and this was what I did:
Last login: Fri Mar 17 12:08:55 on ttys000
Roberts-MBP:~ Robert$ cd documents
Roberts-MBP:documents Robert$ cd metronomeapp/apktool
Roberts-MBP:apktool Robert$ **java -jar apktool.jar**
Apktool v2.2.2 - a tool for reengineering Android apk files
with smali v2.1.3 and baksmali v2.1.3
Copyright 2014 Ryszard Wiśniewski <brut.alll#gmail.com>
Updated by Connor Tumbleson <connor.tumbleson#gmail.com>
usage: apktool
-advance,--advanced prints advance information.
-version,--version prints the version then exits
usage: apktool if|install-framework [options] <framework.apk>
-p,--frame-path <dir> Stores framework files into <dir>.
-t,--tag <tag> Tag frameworks using <tag>.
usage: apktool d[ecode] [options] <file_apk>
-f,--force Force delete destination directory.
-o,--output <dir> The name of folder that gets written. Default is apk.out
-p,--frame-path <dir> Uses framework files located in <dir>.
-r,--no-res Do not decode resources.
-s,--no-src Do not decode sources.
-t,--frame-tag <tag> Uses framework files tagged by <tag>.
usage: apktool b[uild] [options] <app_path>
-f,--force-all Skip changes detection and build all files.
-o,--output <dir> The name of apk that gets written. Default is dist/name.apk
-p,--frame-path <dir> Uses framework files located in <dir>.
For additional info, see: http://ibotpeaches.github.io/Apktool/
For smali/baksmali info, see: https://github.com/JesusFreke/smali
Roberts-MBP:apktool Robert$ **./apktool d metronome.apk**
-bash: ./apktool: No such file or directory
Roberts-MBP:apktool Robert$ **apktool d metronome.apk**
-bash: apktool: command not found
Roberts-MBP:apktool Robert$
You can see in the bold what I entered. On the 2nd and 3rd bold statements, I did it both ways because I found info that one of them works on windows and one on mac and since the mac one didn't work I wanted to try the windows one to see what it would say. Both the files are in the same directory with the apk file (metronome.apk) Does anyone know why this isn't working and what I can do to resolve it?
Thanks.
Robert

Try java -jar apktool.jar d metronome.apk
To elaborate, apktool.jar is not a command itself. It's a java Jar file that can be executed by the Java runtime.

Related

Windows using hidden file rather than directory in paths...Why?

I (and my colleague) are having this problem with 32-bit applications on a 64-bit Windows 7 OS. We have also found the same problems when we invoke a 64-bit application and pass a path as described below as a parameter in cmd.exe.
Given the path "C:\dir1\dir2\file1.txt", we have some 32-bit applications that don't appear to be able to consistently resolve that path and find the file if there is a hidden file of a particular naming structure causing it to lose it's way.
For example, given the directory/file structure:
\dir1
\dir2
\file1.txt
\.dir2Blah
Of importance is that the "hidden" file's name starts with the same characters as those which indicate a directory at that same level of the hierarchy. What comes after that in the hidden file's name is irrelevant. It could be called ".dir2Whatever".
The problem is that more often than not (but not consistently always) some 32-bit applications we use can't find the file1.txt file. We're told it can't be found or it doesn't exist, etc. in the application. Using Process Monitor, we found the reason appears to be that while the path being asked for is C:\dir1\dir2\file1.txt, the path being evaluated by the the Windows system is C:\dir1\.dir2Blah\file1.txt.
We have found that some 32-bit applications appear to be able to work fine with those (what I would call) erroneous paths and successfully find the files in question but others do not.
As I said above, we have also found we can reproduce the problem with 64-bit applications if we try to open the file through a cmd.exe prompt; for example, "textpad.exe \dir1\dir2\file1.txt".
We've "googled" this problem for 2 days because we're completely stumped and cannot believe that no one else has ever encountered this if it's so "easy" to reproduce. My colleague and I are both able to cause the failure; not consistently, but file access will fail more than half the time when we set up the structure I described.
I've included a picture of Process Monitor showing this failure in two applications but succeeding in a third...here.
Can anyone tell me what is going on? First, why is it changing the path to use that hidden file rather than the directory name provided? And, more importantly, how can we make it stop ;-)?
Cheers,
jtm
Added later:
Here's the "dir /x" output for a directory where I'm having this problem.
24/05/2017 12:17 PM <DIR> .
24/05/2017 12:17 PM <DIR> ..
24/05/2017 12:17 PM 12 BLAHTS~1 .blahtst
23/05/2017 03:06 PM 104 JSHINT~1 .jshintrc
24/05/2017 12:16 PM <DIR> blah
24/05/2017 12:16 PM 0 blank.txt
24/05/2017 12:15 PM 6,624 INDEX~1.HTM index.html
24/05/2017 10:48 AM <DIR> js
It also indicates how we stumbled on the problem. I have an html file that is trying to load a JavaScript file under the /js directory, but there is also a .jshintrc file at the same level and my old Apache server can't find the files to serve them. If I remove the .jshintrc file, I can get around this, but this project isn't one I created and I'm leery of just removing things willy nilly.

Maven error: Could not find or load main class .usr.share.maven.boot.plexus-classworlds-2.x.jar

I have recently upgraded my Ubuntu from 14.04 to 16.04 and started getting the following error when running any mvn commands (version 3.3.9): Error: Could not find or load main class .usr.share.maven.boot.plexus-classworlds-2.x.jar. My environment variables are declared as follows:
$JAVA_HOME: /usr/lib/jvm/java-8-oracle
$PATH: /usr/local/texlive/2015/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$M2_HOME: /usr/share/maven
$M2: /usr/share/maven/bin
When trying to find a solution, I've tried removing the M2 and M2_HOME variables as suggested on various threads, which resulted in getting a different error: Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher. I have also tried running apt-get remove --purge maven and installing it again as well as downloading the .tar.gz archive, but in both cases, nothing has changed.
When looking into the /usr/share/maven/boot folder, there is a chain of symlinks pointing from plexus-classworlds-2.x.jar -> /usr/share/java/plexus-classworlds2-2.5.2.jar. Am I missing some dependencies? Or are there any old configuration files that did not get removed by --purge?
EDIT: When I execute mvn as root, I get the Launcher error instead of plexus-classworlds-2.x. Also, I have completely removed and reinstalled all plexus libraries, yet with no change.
Check if /usr/share/maven/boot has multiple jars with pattern /usr/share/maven/boot/plexus-classworlds-*.jar.
Mine was something like:
drwxr-xr-x 2 root root 4096 Dec 23 14:21 ./
drwxr-xr-x 6 root root 4096 Nov 14 2015 ../
-rw-r--r-- 1 root root 52684 Dec 12 2015 plexus-classworlds-2.5.2.jar
lrwxrwxrwx 1 root root 34 Dec 10 2015 plexus-classworlds-2.x.jar -> ../../java/plexus-classworlds2.jar
This messes up /usr/share/maven/bin/mvn bash script and executes a wrong java command.
I had to remove the jar and leave only the symbolic link.

how to change extended file attributes of files on mac?

I had some iOS projects in my macbook,one day I copied them to my pc which is based on windows system, then some day I copied them back to my macbook and I found the projects can not run.
I Opened one of the projects with Xcode, it says "builde successfully",but the app can not be deployed on the iPhone Simulator even if the Simulator is running!?!?!?! Then I check the files using "ls -l" command and found that the difference between normal Xcode project files and the new created Xcode project files is just a symbol.
files with problem:
drwx------+ 49 dingvimer staff 1.6K
normal file:
drwx------# 60 dingvimer staff 2.0K
How can I change that '+' symbol to '#' and get the project run normally?
I will appreciate your kindness of helping me to figure it out (^-^).
You can use ls -l# to see extended attributes. It will show you something like:
drwxr-xr-x# 5 cody staff 170 Mar 30 08:46 test.xcodeproj
LastUpgradeCheck 4
LastUpgradeCheck - is the name of attribute (sometimes there can be something like com.apple.blablabla) and 4 - is the value.
Use xattr command to set/delete extended attributes. See man xattr (its quite short and there are some examples).
Note, that you'll probably need to fix whole project directory.

mar file generation in MDC

I am trying to generate complete.mar file, in firefox build. when I try to generate complete.mar file, the following error occurs.
Sathi#HREF-22F4E8F33B /c/href/FF-5.1/tools/update-packaging
$ sh make_full_update.sh complete.mar new
/c/href/FF-5.1/tools/update-packaging/new /c/href/FF-5.1/tools/update-packaging
precomplete file is missing!
From http://old.nabble.com/Problem-creating-MAR-file.-td32154053.html:
That file is generated as part of the build process. If you need to
generate it manually you can cd into the root directory where the
files you are creating the complete mar are located and run the
createprecomplete.py python script.

Why is xcode giving me these building warnings and errors?

I created an app that plays a sound when you press a button and it was working fine initially. I'm not sure what happened, I deleted one of the files and now xcode keeps giving me a warning in reference to a file Not being found. I've deleted and recreated the file, commented out the code using the file, and cleared but build but nothing seems to be working. I'm new to xcode and app development. Here's the errors I keep getting:
Check dependencies
[WARN]Warning: Multiple build commands for output file /Users/adrienneiverson/Library/Developer/Xcode/DerivedData/SpeakUp1-aoakahingahxuwfhopwfckqlxewc/Build/Products/Debug-iphonesimulator/SpeakUp1.app/Bye.mp3
Warning: Multiple build commands for output file /Users/adrienneiverson/Library/Developer/Xcode/DerivedData/SpeakUp1-aoakahingahxuwfhopwfckqlxewc/Build/Products/Debug-iphonesimulator/SpeakUp1.app/Bye.mp3
CpResource ../../Sounds/Mp3/Bye.mp3 /Users/adrienneiverson/Library/Developer/Xcode/DerivedData/SpeakUp1-aoakahingahxuwfhopwfckqlxewc/Build/Products/Debug-iphonesimulator/SpeakUp1.app/Bye.mp3
cd "/Users/adrienneiverson/Desktop/SURE PROGRAM 2011 - GA TECH/SpeakUp1"
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -resolve-src-symlinks "/Users/adrienneiverson/Desktop/SURE PROGRAM 2011 - GA TECH/SpeakUp1/../../Sounds/Mp3/Bye.mp3" /Users/adrienneiverson/Library/Developer/Xcode/DerivedData/SpeakUp1-aoakahingahxuwfhopwfckqlxewc/Build/Products/Debug-iphonesimulator/SpeakUp1.app
error: /Users/adrienneiverson/Desktop/SURE PROGRAM 2011 - GA TECH/SpeakUp1/../../Sounds/Mp3/Bye.mp3: No such file or directory
error: /Users/adrienneiverson/Desktop/SURE PROGRAM 2011 - GA TECH/SpeakUp1/../../Sounds/Mp3/Bye.mp3: No such file or directory
I have no idea what multiple build commands they're talking about and the file is located in the directory that they're saying its not in...I'm lost....
Have you cleared the build folder?
Or is that what you meant by I've deleted and recreated the file, commented out the code using the file, and cleared but build but nothing seems to be working.?
Tjeu

Resources