use cmd "java -jar apktool.jar b D:\smali > nul" to get apk - apktool

I find the apk's AndroidManifest.xml,
platformBuildVersionCode="23"
platformBuildVersionName="6.0-2438415"
not original
platformBuildVersionCode="26"
platformBuildVersionName="8.0.0""
What's happen? why apktool can change platformBuildVersionCode and platformBuildVersionName? I don't know how to fix it.
original:
after:

Apktool just runs the aapt1/aapt2 binary at the end of the build procedure. This means you are re-running the code that sets those platform variables.
There is intended functionality right now.
That would require a change in Apktool at the aapt level, which would require modifying 3 platforms (unix/mac/win) for both aapt versions.

Related

Decompiling MCP error (version 9.18) returns 'Decompile Failed'

I have decided to take on MCP and have downloaded it, however, when running the decompile.bat, it returns an error.
(I'm running 32-bit Windows 10)
Here is what it returned:
'"C:\Program Files\Java\jdk1.8.0_65\bin\java" -jar runtime\bin\fernflower.jar -din=1 -rbr=1 -dgs=1 -asc=1 -rsy=1 -iec=1 -jvn=1 -log=WARN "-e=jars\libraries\net/java/jinput\jinput\2.0.5\jinput-2.0.5.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl-platform\2.9.4-nightly-20150209\lwjgl-platform-2.9.4-nightly-20150209-natives-windows.jar" "-e=jars\libraries\com/ibm/icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar" "-e=jars\libraries\tv/twitch\twitch-external-platform\4.5\twitch-external-platform-4.5-natives-windows-32.jar" "-e=jars\libraries\org/apache/httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar" "-e=jars\libraries\org/apache/logging/log4j\log4j-api\2.0-beta9\log4j-api-2.0-beta9.jar" "-e=jars\libraries\org/apache/commons\commons-lang3\3.3.2\commons-lang3-3.3.2.jar" "-e=jars\libraries\net/java/jutils\jutils\1.0.0\jutils-1.0.0.jar" "-e=jars\libraries\net/java/dev/jna\jna\3.4.0\jna-3.4.0.jar" "-e=jars\libraries\com/paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar" "-e=jars\libraries\net/sf/jopt-simple\jopt-simple\4.6\jopt-simple-4.6.jar" "-e=jars\libraries\com/google/guava\guava\17.0\guava-17.0.jar" "-e=jars\libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar" "-e=jars\libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar" "-e=jars\libraries\org/apache/commons\commons-compress\1.8.1\commons-compress-1.8.1.jar" "-e=jars\libraries\net/java/dev/jna\platform\3.4.0\platform-3.4.0.jar" "-e=jars\libraries\com/paulscode\codecjorbis\20101023\codecjorbis-20101023.jar" "-e=jars\libraries\com/paulscode\soundsystem\20120107\soundsystem-20120107.jar" "-e=jars\libraries\com/paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl_util\2.9.4-nightly-20150209\lwjgl_util-2.9.4-nightly-20150209.jar" "-e=jars\libraries\commons-codec\commons-codec\1.9\commons-codec-1.9.jar" "-e=jars\libraries\org/apache/httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl\2.9.4-nightly-20150209\lwjgl-2.9.4-nightly-20150209.jar" "-e=jars\libraries\commons-io\commons-io\2.4\commons-io-2.4.jar" "-e=jars\libraries\com/mojang\realms\1.7.39\realms-1.7.39.jar" "-e=jars\libraries\com/mojang\authlib\1.5.21\authlib-1.5.21.jar" "-e=jars\libraries\com/google/code/gson\gson\2.2.4\gson-2.2.4.jar" "-e=jars\libraries\tv/twitch\twitch\6.5\twitch-6.5.jar" "-e=jars\libraries\com/paulscode\codecwav\20101023\codecwav-20101023.jar" "-e=jars\libraries\tv/twitch\twitch-platform\6.5\twitch-platform-6.5-natives-windows-32.jar" "-e=jars\libraries\net/java/jinput\jinput-platform\2.0.5\jinput-platform-2.0.5-natives-windows.jar" "-e=jars\libraries\org/apache/logging/log4j\log4j-core\2.0-beta9\log4j-core-2.0-beta9.jar" "-e=jars\libraries\io/netty\netty-all\4.0.23.Final\netty-all-4.0.23.Final.jar" temp/minecraft_ff_in.jar temp\src\minecraft' failed : 1
Decompile failed
This is caused by the decompilation system running out of RAM. I'm not entirely sure why it's happening, but it also was happening to me.
If you're using Minecraft Forge's ForgeGradle, see this. You can either edit the gradle options file ( .gradle/gradle.properties in your user folder) and add org.gradle.jvmargs=-Xmx2G to it, or you can set the options variable to -Xmx2G (in a command prompt, run set GRADLE_OPTS=-Xmx2G and then gradlew setupDecompWorkspace).
However, given that you referenced decompile.bat, you probably are using MCP without Forge. (Which is fine but forge does make mods easier/more compatible; you may want to consider doing this if you're making a more permanent mod rather than just messing about.) In this case, you can edit MCP's configuration to increase the given RAM.
In the MCP folder, open the conf folder and then open mcp.cfg with a text editor of your choice. Then, find this line (near the bottom)
CmdFernflower = %s -jar %s -din=1 -rbr=0 -dgs=1 -asc=1 -log=WARN {indir} {outdir}
and replace it with this:
CmdFernflower = %s -Xmx2G -jar %s -din=1 -rbr=0 -dgs=1 -asc=1 -log=WARN {indir} {outdir}
(You may need to change other lines also adding -Xmx2G before -jar but it doesn't seem to be needed from my experience).
This will run the decompiler with additional RAM.
Alternatively, if you don't want to mess around with the MCP configuration, MCP910 doesn't seem to have this issue. It works with 1.8.0 instead of 1.8.8, but should still do everything you want.
I know, this answer comes very late, but you should install the 64-bit Version of Java. With the 32-Bit Version, it doesn't work...
I don't know if you can install this on your 32-Bit System, but you can try it. On my 86-Bit System (Windows 8) it works!

Running JHipster Gradle task from Intellij IDEA

This error happens when I run with Gradle through from Intellij IDEA.. but from console everything works fine... someone knows why?
Executing external task 'run --stacktrace'... :compileJava UP-TO-DATE
:compileScala UP-TO-DATE :bower FAILED
org.gradle.api.tasks.TaskExecutionException: Execution failed for task
':bower'.
Caused by: java.io.IOException: Cannot run program "bower" (in
directory "/Users/eduardo/Development/projects/jhipster"): error=2, No
such file or directory
I contacted JetBrains support about this. The one thing they suggested was running IntelliJ from the command line, which is working for me:
open -a "/Applications/IntelliJ IDEA 15.app"
At a guess, you are running IntelliJ on OSX, maybe with a brew install of bower?
Recent versions of OSX (at least 10.10.1) don't let you easily set the PATH for graphical applications (launchctl seems to have a bug in regards to PATH). Combined with there being no way to modify the current environment PATH for launching subprocesses in Java, this results in being unable to find the bower executable. A Complete rundown of the root problem can be seen here (Setting the environment for ProcessBuilder), but essentially IntelliJ must have your PATH set correctly in order for non standard PATHs to be searched.
My solution for now is a complete hack taken from https://apple.stackexchange.com/a/51737 - essentially, create a wrapper script:
create /Application/IntelliJ\ IDEA\ 14.app/Contents/MacOS/idea.sh with contents of:
#!/bin/sh
. ~/.bash_profile
logger "`dirname \"$0\"`/idea"
exec "`dirname \"$0\"`/idea" $#
then chmod +x /Application/IntelliJ\ IDEA\ 14.app/Contents/MacOS/idea.sh
then edit /Application/IntelliJ\ IDEA\ 14.app/Contents/Info.plist and set CFBundleExecutable to idea.sh
lastly, run /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/IntelliJ\ IDEA\ 14.app
It's a hack, but it works... and until Apple fixes launchctl, it's the only solution I've come up with.

Cannot auto configure pydev in eclipse

I have installed PyDev successfully, I have python 3.4.0 installed successfully and the folder containing python.exe is in my path and I can run it from the command line.
However, when I go to window\preferences\pydev\interpreters\python interpreter and select 'quick auto-config' to configure it using normal python I get an error saying 'auto configurator could not find a valid interpreter... Note the system environment variables used for Jython are PATH and PYTHONHOME.'
Unless this is a bug in the text I am not selecting Jython (I get a different error if I select IronPython, btw, so this is not a generic error message).
The trace is as follows:
Errors getting info on discovered interpreter(s).
See error log for details.
java.lang.RuntimeException: java.io.IOException: Cannot run program "python": CreateProcess error=2, The system cannot find the file specified
As I say, python.exe is in my path.
You have to install the actual python package separately from here https://www.python.org/download
Close LiClipse/Eclipse => Download Python Here: https://www.python.org/download
=> reopen LiClipse => Auto Config for the interpreter Will WORK!
I found the answer, but I'll leave this up in case anyone else gets it. It's a pretty stupid auto config option if you ask me ;)
In the higher level window\preferences\pydev\interpreters\ preference you need to untick jython and ironpython.
No idea why given I selected the Python sub-preference specifically.

Command /usr/bin/lipo failed with exit code 1 error

I have finally finished my app and I was getting ready to upload when this sudden error hit me and I have no idea what to do. I have checked other posts saying to change the code signing identity and I have done this but no luck. I tried every single option in the identity and no change. If anyone knows what is going on I would really appreciate it since I would simply just like to submit my app.
Here is what else it says in the erorr log:
/usr/bin/lipo: /Users/teddy/Library/Developer/Xcode/DerivedData/grocery_stores-dcyubhefhrcjhtcxbhldfpukdgdz/Build/Intermediates/grocery stores.build/Release-iphoneos/grocerystores.build/Objects-normal/armv7/grocery stores and /Users/teddy/Library/Developer/Xcode/DerivedData/grocery_stores-dcyubhefhrcjhtcxbhldfpukdgdz/Build/Intermediates/grocery stores.build/Release-iphoneos/grocery stores.build/Objects-normal/armv7/grocery stores have the same architectures (armv7) and can't be in the same fat output file
Command /usr/bin/lipo failed with exit code 1
I solved this issue by changing the value of the Valid Architecture found in Project > Build Settings > Architectures from the default "armv6 armv7" to "armv7". Hope this helps.
It's hard to see what exactly is happening without the command you are running. It looks to me like you are specifying the same input file twice, namely the arm7 version and lipo is telling you you can't add 2 arm7 versions of grocery stores to the universal file. Can you please enter the entire lipo command you are running? From the lipo man page:
-create
Take the input files (or file) and create one universal output file from them.
Do you possibly have the same file listed twice here?
Try changing your build target to a simulator build, clean and re-run.
In my case I used pods and oped projectFile instead of project workspace
In my case it was building a project on simulator in a release scheme, changed it to debug and it worked.

help building castle dynamic proxy

So I pulled the source from https://svn.castleproject.org/svn/castle/DynamicProxy/trunk/
Open it up in vs.net 2008
problems:
vs.net can't open the assembly.cs
assembly signing failed
What am I doing, rather NOT doing?
Update
So I downloaded nant, setup the .bat file in my PATH so it works in cmd prompt.
I ran:
nant default.build
Getting this error:
build failed, \buildscripts\common-project.xml (48,3)
invalid element . Unknown task or datatype.
How exactly do I build the dynamicProxy project now?
update
This is what I did, see screenshot:
oh and my nant is:
#echo off
"E:\dev\tools\nant-bin\nant-0.86-nightly-2009-05-05\bin\Nant.exe" %*
http://img697.imageshack.us/img697/5623/castlebuildscreenshot.png http://img697.imageshack.us/img697/5623/castlebuildscreenshot.png
You can read the FM (how to build.txt). :)
You need to run the build script first using NAnt (http://nant.sf.net). This will generate the assembly.cs file. Take a look at the .build files in the tree to see what they are doing.
As for the assembly signing failing, check the project settings to get rid of references to CastleKey.snk. It should sign it using DynProxy.snk (in theory).
UPDATE:
The issue with NUnit is now fixed. Do a clean check out. I really have no idea why you're getting that error. Which version of NAnt are you using? Make sure you have the latest (earlier do not have support for .NET 3.5)
You should be able to just pull the source from the trunk, and build with nant (I just did that and it worked). Ok, I lied, looks like the reference to NUnit is wrong, so the unit test project will not build correctly:
BUILD FAILED - 0 non-fatal error(s), 1 warning(s)
D:\OLD\DynamicProxy\buildscripts\common-project.xml(295,5):
'nunit-console.exe' failed to start.
The system cannot find the file specified
Total time: 1.2 seconds.
BUILD FAILED
Nested build failed. Refer to build
log for exact reason.
Total time: 3.4 seconds.
However the important stuff (assemblyinfo generation) will succeed and you should be able to just open Castle.DynamicProxy2-vs2008.sln, fix the reference to the NUnit assembly hit F5 and build the code with no issues.
I just did it on a clean check out, and it worked.
Generally if you're planning to do modifications in DP codebase, it is advised to go to the Castle user group first, and discuss it there.