Please help.
I need repack android.jar
Yesterday i read android source codes and i realize that classes have more methods than casual sdk provide.
So
1.download android 2.2 rev 1.1
2.Unjar it
3.unjar android 2.2 rev 3 from sdk
4.Replace classes
5.repack to jar
6.rewrite android.jar in sdk folder
Some classes causes warning due to missing objects. So you can delete them or replace from default.
But i have problem with classes that does not been in native android.jar. eclipse see namespace of package but classes not.
Idea: because android.jar contain only empty stub classes. it is only compiler reference and eclipse use it only to know android api.
So is absolutely right add stub if they exist in android system.
Question: why android not support all api functions?
Is somewhere cookbook "how to"
Create own android.jar?
"Try google" is not answer.
Sent from my HTC Wildfire using XDA App
Related
I recently worked on a theme for some home alternative apps but when I tried to compile it in Eclipse, things seemed to be missing (for example Keytool and Jarsigner) which are not in my SDK directory anywhere.
I was able to get the theme to work by using the APK from someone else's, replacing the images with mine and signing using the Autosign tool downloaded from XDA but I was unable to change the name of the app in the Manifest.
So my question is, is there a way to compile in Windows at all? Reading the guide on the developers.android page didn't answer anything for me.
Also, would there be anyone willing to walk me through that? If not, just knowing if its possible is enough for me.
Windows 7 64-bit
im on windows 7 64 and I can compile my apps without any problem. right click on the folder of your app -> android tools -> export as signed / unsigned (which ever you prefer)
The "keytool" and "jarsigner" programs are in the JDK, which you'll need to get from Oracle (formerly known as Sun). Set the JAVA_HOME environment variable to the JDK directory; in my case, C:\Program Files\Java\jdk1.6.0_18, and add the JDK's bin path--in my case, C:\Program Files\Java\jdk1.6.0_18\bin--to your PATH environment variable. You may need to logoff/logon or reboot for everything to settle out. If you get the latest JDK, the paths should end in _20 instead of _18.
jarsigner is not needed in eclipse as eclipse will sign and zipalign the apk for you.
File | Export
Choose Android | Export Android Application
Create a new keystore via the tool and it will automatically sign and zipalign creating a nice new apk for you
Is there a way to compile .java file to .class file and execute it
I wanted to compile c/c++/java programs, not for my phone but in my phone...
I searched but did not find an easy way for it.
At last I found out a real easy way to compile c/c++ by using adosbox for android.
I copied the turbo c 'tc' folder from my pc to my sdcard and used adosbox like command promt to go to 'bin' folder in tc and start tc.exe...
Then I could easily write and compile programs just like i did on the pc
But still no luck for java programs...
I copied the reqired java folder and then used adosbox to run the command "javac file.java" but it said "This Program Cannot Be Run in DOS Mode"
So if there is any other way to compile java programs in my phone
please help
Thanx in advance
Try looking at Eclipse, although Eclipse is a large desktop IDE, it includes its own Java compiler written in Java (in the part called "JDT core"), and if (as I hope) that Java compiler is not copyrighted by Sun/Oracle, you (or someone else already maybe) may be able to compile that part of Eclipse into a "native" Dalvik/Android App.
Googling the issue, I see that others have been asking for an Android port of Eclipse too, so maybe there will be some momentum going for this soon.
Hope you guys can give me some much sought advice.
I've been attempting to build a JAR file that packages it's own JARs as internal class dependencies, but without exposing those inner JAR dependencies to the outside world. I'm guessing this needs to happen, otherwise the link process for building an Eclipse Android project would fail if not.
So my problem is such:
If I have an internal dependency on say dom4j-1.6.1.jar, I don't want to prevent someone from being able to add my JAR to an Eclipse Android project and including their own dom4j package dependency (possibly a different version). If the internal JAR dependency is exposed they will experience a duplicate resource conflict when attempting to build their project.
e.g. java.lang.IllegalArgumentException: already added: Lcom/google/gson/DefaultTypeAdapters$ByteTypeAdapter;
Here is what I tried to date:
So I have a regular Android project in Eclipse which adds in my packaged JAR as an dependency.
I refered to the Oracle docs, however there is a footnote about the inclusion of JAR files within JARs.
Note: The Class-Path header points to classes or JAR files on the local network, not JAR files within the JAR file or classes accessible over internet protocols. To load classes in JAR files within a JAR file into the class path, you must write custom code to load those classes. For example, if MyJar.jar contains another JAR file called MyUtils.jar, you cannot use the Class-Path header in MyJar.jar's manifest to load classes in MyUtils.jar into the class path.
So I decided to try the Fat Jar Eclipse Plug-In from SourceForge.
It's an Eclipse Plug-In for deploying a project into one "fat" executable jar file containing all referenced libraries. References are taken from the project settings, so no manual configuration is necessary.
I did manage to execute my build using this method, however did have to manually hack the packaged JAR file to remove the reference to the annotations package which was causing a conflict with my Android test project by being referenced twice.
So now I am left with a project that builds and executes, but exposes those inner JAR dependency packages to my Android project.
I would appreciate any advice you guys can provide. I hope my explanation is clear enough.
Steps:
(Yes, you need Jailbreak first.)
Download CsBox.zip from this thread.
Unzip the CsBox folder to your user's folder (in my case it's C:\Users\ssaaxx\Desktop\Scripts\)
Get Notepad++ and run it (from the App porting thread)
In Notepad++, Create and save a C# code snippet (A sample code snippet can be found in TestCSharp.cs.txt attachment)
In Notepad++, click "Run" menu --> "Run..." --> Input following text and run (or you can save it as a command shortcut if you want to)
C:\Users\ssaaxx\Desktop\Scripts\CsBox\RunCsSnippet.bat "$(FULL_CURRENT_PATH)"
There you go!
* Do use the right folder path for you.
------------------
How does it work?
Windows RT ships with a CSharp compiler (csc.exe), except it's not working by default because of missing some referenced dlls.
So I commented out the missing references from the rsp file, and it worked.
After this it's just some basic scripting and Notepad++ integration.
-----------------
Edit: fixed a bug. thanks Calebsem.
Edit: Hide compiler output when compiling succeeds.
cool!
Very cool little hack! I've been looking forward to a way to program C# on the Surface!
Just to demonstrate what this "scratchpad" is capable of, I'll update this reply with some handy scripts:
1. Script to enable Adobe Flash for specified website / domain: EnableFlash.zip
...
* Download the zip and unzip the cs file. Load it in Notepad++ and run.
ssaaxx said:
Steps:
How does it work?
Windows RT ships with a CSharp compiler (csc.exe), except it's not working by default because of missing some referenced dlls.
So I commented out the missing references from the rsp file, and it worked.
After this it's just some basic scripting and Notepad++ integration.
Click to expand...
Click to collapse
Thanks for the cool utility and guide! I was able to work it out to compile a multi-file .NET project. One snag that I hit in the endeavor was about the resources. ResGen.exe does not come on the RT version of Windows. I used my desktop to compile the various resources and then stuff them into the directory tree. At last, the program I re-built was completed and launched well. It consists of an exe and two dll files. All's well for that experiment. Unsure if I can make the time to do a clean room build of ResGen.exe for ARM.
I'm surprised this topic didn't get as many posts as it did. Found this thread through a youtube video, and this has got to be one of the best kept secrets for code development on the RT. A quick replacement of the csc.rsp file after toying with permissions, and adding the csc.exe to my PATH basically allows command-line C# building.
Wondering if the missing DLLs actually appear on different versions of RT. Not that these specific namespaces are something I regularly use, but it would be nice not to have to comment things out this way.
ssaaxx said:
Steps:
(Yes, you need Jailbreak first.)
Download CsBox.zip from this thread.
Unzip the CsBox folder to your user's folder (in my case it's C:\Users\ssaaxx\Desktop\Scripts\)
Get Notepad++ and run it (from the App porting thread)
In Notepad++, Create and save a C# code snippet (A sample code snippet can be found in TestCSharp.cs.txt attachment)
In Notepad++, click "Run" menu --> "Run..." --> Input following text and run (or you can save it as a command shortcut if you want to)
C:\Users\ssaaxx\Desktop\Scripts\CsBox\RunCsSnippet.bat "$(FULL_CURRENT_PATH)"
There you go!
* Do use the right folder path for you.
------------------
How does it work?
Windows RT ships with a CSharp compiler (csc.exe), except it's not working by default because of missing some referenced dlls.
So I commented out the missing references from the rsp file, and it worked.
After this it's just some basic scripting and Notepad++ integration.
-----------------
Edit: fixed a bug. thanks Calebsem.
Edit: Hide compiler output when compiling succeeds.
Click to expand...
Click to collapse
i dont work, he says "WARNING CS2008 NO ORIGINAL FILE SPECIFICATED"
i post an image (sorry but is in italian)
i need to do pentesting for developer, but all my decompiling tools failed to show proper code, take a look at my issue on github, what issue i'm facing :
https://github.com/leibnitz27/cfr/issues/235
Is there option in some others java bytecode decompilers which can decompile and desugar lambda, so it displays proper code. I wasn't been able to do pentest because of this, i can't read code, not even try to exploit it at all.
The Java bytecode decompiler in IntelliJ IDEA is a built-in tool that allows you to read compiled bytecode as if it were human-readable Java code.
jwoegerbauer said:
The Java bytecode decompiler in IntelliJ IDEA is a built-in tool that allows you to read compiled bytecode as if it were human-readable Java code.
Click to expand...
Click to collapse
just checked (IntelliJ IDEA), and tried, still no luck, as i know it uses Fernlower, which i already tried. (i have problems, with improper decopmilaton/desugaring java bytecode, and it throws multiple .class files with $$Lambda$ extention)
and this is my first time to see this retrolambda, for which i never heard before.
i wish i could decompile it manually, but i can't as before 2 days i didn't knew what is retrolambda, let alone manually decompile it.
resources, how i can manually decompile and understand retrolambda, are welcome, i will check in their git repository if i can find anything, some instrutions.