NoClassDefFoundError - Android Software Development

hi,
i' trying to use an external library in my android sourcecode, but i fail at executing after successful compiling with a "NoClassDefFoundError"
i set the CLASSPATH to the external JAR File i want to use, and imported that jar file as a library, but still the same error.
what is missing, or where am i wrong?
please help

Agassiz said:
i set the CLASSPATH to the external JAR File
Click to expand...
Click to collapse
And how do you do that? As far as I know Java does not have an API to modify CLASSPATH at runtime.

oh i forgot to mention, that i use Eclipse to code android apps
ok after adding a JAR file into my project (not a library - like i did before), the time to build the workspace takes a very long time... everytime i type ctrl+s for saving even one new character, the workspace is being rebuilt, that takes about 5 to 10 seconds... thats really annoying...

Agassiz said:
hi,
i' trying to use an external library in my android sourcecode, but i fail at executing after successful compiling with a "NoClassDefFoundError"
i set the CLASSPATH to the external JAR File i want to use, and imported that jar file as a library, but still the same error.
what is missing, or where am i wrong?
please help
Click to expand...
Click to collapse
Copy the jar you are using into a folder in your project, such as assets.
In eclipse:
right click on your project.
Go to properties.
Click on java build path.
Click on the libraries tab
Click add JAR
Select your JAR and press ok. press ok to exit the project properties.
Your application should now find the class you are looking for.

corruptor64 said:
Copy the jar you are using into a folder in your project, such as assets.
In eclipse:
right click on your project.
Go to properties.
Click on java build path.
Click on the libraries tab
Click add JAR
Select your JAR and press ok. press ok to exit the project properties.
Your application should now find the class you are looking for.
Click to expand...
Click to collapse
hey thanks a lot this worked out.
but eclipse is very slow now. if i remove the JAR file it runs fast like always... the jar file's size is just 3,6MB :/

Related

[App] Execute Apps Automatically (14 Jan 10) Source Code Included

I use Sashimi alot and the only gribe I have with it is that I cannot Automatically Setup My Applications within Sashimi. I know it will run all exe files that is placed within the \Sashimi\Auto\EXE folder but it cant execute .lnk files. So this little app has three files which you simply dump in \Sashime\Auto\EXE folder.
There will be a file called Executefiles.txt
Any apps in there will be executed automatically after Sashimi is done with its installation
I use 1. Pimbackup.exe
2. Galarm
3. Audio notes
4. Magicall
Theres a config file where you can specify whether it should auto close or wait for a keypress to exit
O yes Source Code is in vs2008 used C#. Graphics aint good. But it doesnt need to be. I only spent about an hour and half on the app
aren't executable (AND lnk files) automatically executed when placing them in \Windows\Startup directory? or is this some Sashimi related thing. Whatever Sashimi is!?
RAMMANN said:
aren't executable (AND lnk files) automatically executed when placing them in \Windows\Startup directory? or is this some Sashimi related thing. Whatever Sashimi is!?
Click to expand...
Click to collapse
When you flash a new rom Sashimi is used to install al your cabs automatically and do reg imports and copy files etc. So now when you are done installing everything you obviously need to run certain apps to chage settings and this app will help you execute these apps once sashime is done installing
Have a look at sashimi here : http://www.winmo-experts.com/viewtopic.php?f=7&t=4
Forgot
Forgot to add you can even install cab files with it
ok I see. Thanks for explanation.
Thx you. Will look into it.
Thanks for the source code, now i can excute a .lnk without error.
last try fail with process.start, shellexcuteex and mortscript
vua777 said:
Thanks for the source code, now i can excute a .lnk without error.
last try fail with process.start, shellexcuteex and mortscript
Click to expand...
Click to collapse
No problem i battleded my backside of as well to get it to work. It would only execute .exe files initially but now it will do .cab .lnk and properly .html as well cause it passes it to the shell instead off trying to execute it itself. What app are you trying to write? You will see there a waitcomplete or something. if you remove that line it will start the process and still continue to run the app in the foreground. that command makes it execute the app and wait for it to finish before carying on with code. The only problem with that is if you would execute an app and minimize it then your code will wait indefinately for the app to exit before it will continue

[Utility][Tool]baksmali/smali

- What is baksmali/smali?
smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation. The syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)
The names "smali" and "baksmali" are equivalents of "assembler" and "disassembler" respectively.
- Author of the tool
JesusFreke
- Why we need it?
Android apk and jar files will include java classes to execute certain functionality. With baksmali, you will be able to disassemble the java classes into editable form (smalis) so you can do your editing and modding involving java script. Once you done changing, you need to assemble all classes to a readable form for android, i.e, classes.dex and here comes the role of assembler (Smali).
Since we have apk manager, do we still need this tool?
Yes and No!!! Because some apk managers even if they do support jar files but once they decompile smalis, they will remove some lines (.line, .parameter, ...etc) which are in my opinion are useful to locate some codes. So the choice is yours.
- What does this tool do?
Simply it baksmali classes.dex of android apk and jar files into editable form (smalis) to do your changes; then assemble it back (smali).
- Will it affect apk and jar original signature?
No, it will preserve original signature.
- Got problem?
During assembling (smali), you may got error message. You can check log file to locate what is wrong that make the manager stop assembling the file or post the log file for developers to look into it.
- What are the steps to work with this tool?
Run Baksmali_tool.bat file, this will create all needed folders in the first run.
1. Put android apk or jar file in "put-file-here" folder. If Current-file status is set to None, then either you need to set a file in option #3 or you forget putting valid file in "put-file-here" folder.
2. When Current-file status is set to your file, you can disassemble its classes.dex by option #1.
3. Classout folder with name of file project will be created in "project" folder; make your changes there.
4. If finished your changes, assemble classout folder by option #2.
5. If everything is OK, a new file will be created in "finish" folder with tag (Modded_) in its name, push it to your device by option #3 if it was system apk or jar; and if it was non system apk file, install it by option #4.
- Latest stable version
Latest stable baksmali/smali version: 2.2.2 (30.10.2017)
baksmali v. 2.2.2 - Download (bitbucket.org)
smali v. 2.2.2 - Download (bitbucket.org)
baksmali/smaly previous versions - Download (bitbucket.org)
- Latest beta version
Latest beta baksmali/smali version:
- Changelog
baksmali/smali wiki and changelog (github)
- Where can I download latest source code?
You can visit
baksmali/smali source page (github)
and you can download the latest smali and baksmali code versions.
- Special Thanks to XDA Portal Team
Special thanks to XDA Portal Team for featuring this utility
XDA Portal Team
..
hi m8,
thanks for this nice tool
will try it next time I make a new theme
sent from my G-Note
great work majd keep it up
no credit to the author of smali/baksmali? :/
iBotPeaches said:
no credit to the author of smali/baksmali? :/
Click to expand...
Click to collapse
I think the authers are these guys ([email protected], [email protected], JesusFr.. @gmail.com) from project page.. aren't they??? if so I will update OP
majdinj said:
I think the authers are these guys ([email protected], [email protected], JesusFr.. @gmail.com) from project page.. aren't they??? if so I will update OP
Click to expand...
Click to collapse
Yes, thats the same person. I'd just put JesusFreke, as thats his username.
Version 1.1 is online
version 1.2 is online
some bugs fixed
Grate dev, Great tool...tnx majdini:fingers-crossed:
What a great idea to simplify life ^^.
Thanks majdinj.
majdinj said:
Backsmali / Smali Manager​
What is Backsmali / Smali?
smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation. The syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)
The names "smali" and "baksmali" are equivalents of "assembler" and "disassembler" respectively.
Why we need it?
Android apk and jar files will include java classes to execute certain functionality. With backsmali, you will be able to disassemble the java classes into editable form (smalis) so you can do your editing and modding involving java script. Once you done changing, you need to assemble all classes to a readable form for android, i.e, classes.dex and here comes the role of assembler (Smali).
Since we have apk manager, do we still need this tool?
Yes and No!!! Because some apk managers even if they do support jar files but once they decompile smalis, they will remove some lines (.line, .parameter, ...etc) which are in my opinion are useful to locate some codes. So the choice is yours.
What does this tool do?
Simply it backsmali classes.dex of android apk and jar files into editable form (smalis) to do your changes; then assemble it back (smali).
Will it affect apk and jar original signature?
No, it will preserve original signature.
Got problem?
During assembling (smali), you may got error message. You can check log file to locate what is wrong that make the manager stop assembling the file or post the log file for developers to look into it.
What are the steps to work with this manager?
Run Backsmali_tool.bat file, this will create all needed folders in the first run..
1. Put android apk or jar file in "put-file-here" folder. If Current-file status is set to None, then either you need to set a file in option #3 or you forget putting valid file in "put-file-here" folder.
2. When Current-file status is set to your file, you can disassemble its classes.dex by option #1.
3. Classout folder with name of file project will be created in "project" folder; make your changes there.
4. If finished your changes, assemble classout folder by option #2.
5. If everything is OK, a new file will be created in "finish" folder with tag (Modded_) in its name, just rename it to its original name and push it to your device; don't forget to fix permissions as well.
If backsmali and smali code are outdated, what to do?
Just visit codes owner page, and download the latest smali and backsmali code versions and put them in "tools" folder (make sure to rename them to baksmali and smali without version number)
Future development?
Feel free to report any bugs or suggestion to improve upcoming releases :good:
Download
- Backsmali-Manager_v1.2 @ 11/June/2013 (The most recent one)
- Backsmali-Manager_v1.1 @ 7/June/2013 (old)
- Backsmali-Manager_v1 @ 6/June/2013 (old)
Change-log:
@ 11/June/2013 (v1.2):
- Fixed bug of file path in Read Log option.
- Fixed number 10 file that was not shown in Set Current-file option.
@ 7/June/2013 (v1.1):
- Deleting the folder and file in project and finish folder of same project name before backsmali or smali (no more overlapping :fingers-crossed.
- Added Read log file functionality in the main menu.
- Ability to open classout folder after backsmali.
- Ability to open finish folder after smali.
- Ability to renamed finished modded file to its original name.
- Neat smali and compression processing (i.e, hidden processing ).
- Fixed set Current-file option to visualize only apk and jar files.
@ 6/June/2013 (v1.0):
- First release of Backsmali / smali manager
Click to expand...
Click to collapse
i don't know how to start editing this smali file
badagila said:
i don't know how to start editing this smali file
Click to expand...
Click to collapse
Editing smali means to modify your jar or apk file to do certain new function, check the second thread in my signature in OP... you will find a lot editing tutorials of smalis of some android apps :laugh:
majdinj said:
Editing smali means to modify your jar or apk file to do certain new function, check the second thread in my signature in OP... you will find a lot editing tutorials of smalis of some android apps :laugh:
Click to expand...
Click to collapse
ok dude thanks
Hi, your work is featured here: http://ajqi.com/baksmali-smali-manager-windows-tool/
Keep it up!
VERY NICE!
Good Work..
I dont know much about smali backsmali.. but one confusion..
Is this tool also applicable if the files (apks or jars) we want to modify are odexed?
OJ said:
Good Work..
I dont know much about smali backsmali.. but one confusion..
Is this tool also applicable if the files (apks or jars) we want to modify are odexed?
Click to expand...
Click to collapse
No, actually classes.dex are made from the odex files.
If files are odexed, then there will be no classes.dex in apks or jar files. That's why it won't be applicable then
Version 1.3 is online
Change log:
- Added adb push finished file to device system partition (for system files).
- Ability to choose whether to reboot device after pushing files to device.
- Added adb install finished apk (for non-system files).
- Adjustable Java heap memory size.
- Adjustable finished file compression level.
- Updated Smali and Backsmali codes (date 15/6/2013).
@ 23/June/2013 (v1.4):
- Added Pull apk or jar From Android Device to the main menu.
- Added zipaligning process during Smali (better RAM management).
- Fixed apk installing process (added signing process step for installing apk process).
- Added direct link to this xda page in update option.
- More script polishing...
@ 29/June/2013 (v1.5-FINAL):
- Fixed adb remount bug for some ROMs in push option.
- Baksmali argument is updated; now you can choose whether to baksmali with x argument (retain .line, .parameter, .prologue, and .local) or b argument (remove .line, .parameter, .prologue, and .local).
Hi,
i've XP&Backsmali / Smali Manager v1.5 and i want baksmali framework.jar but i got error message(attachment)
I think wrong is slash (should be a backslash)
the same error is after i select 1(baksmali*)and then x and Y or
--------------------------------------------------------------and then b and Y
*baksmali or backsmali?

[TOOL][GUI][Reverse engineer] Decompile APK to JAR Full Decompile :: One Click

Reverse engineer "Perfect software" , managed to convert apk to a jar file and decompile it using JD(via dex2jar)
The program uses 3 tools (apktool.jar, dex2jar.bat, jad.exe)
I've updated all lib/scripts ,apktool.jar 1.5.2, dex2jar 0.0.9.15
in attach you will find
Fragment.apk I've tested with this tool and works fully !!,look on OutPut_Fragment.zip to see the result
Download:
DeCompileAPK.zip
To Start
Works on Windows7/8
1. Scan dir for “apk” file or look for the file with “APK File Directory”.
Scan has a “subfolders” flag ,in the “Options” tab.
2. Double click on the found file it will be transferred to the “APK File Directory”.
3. Write or look for the output directory. Leaving this line empty will put all
the project output files under the directory “OutPut” where this program is executed.
If there is an output directory name, a directory “OutPut_” + APK file name
will be created.
3. Press the Decompile KEY.
4. All Dos messages will be seen in the “Decompile OutPut” panel.
5. It will be shown also in the “Edit log” panel.
6. The log can be edited and printed.
7. A java file editor is included. Scan project files, Scan any directory or open any file.
NOTE : USE ONLY ENGLISH CHARACTERS FOR FILE NAMES !
Credit and Thanks !
Tool Dev Website: http://www.limelect.com/android/
Reversed for new stuff
anyone tell us how it works with him?
codexc said:
anyone tell us how it works with him?
Click to expand...
Click to collapse
no download link to test

Help Needed With JDK Install

I'm just starting in my attempt to develop apps for Android, and am starting by learning Java. I have downloaded the Headfirst Java textbook along with JDK and Eclipse. However, I can still not open the .class and .java extension files needed for the textbook. Perhaps I did something wrong? What exactly is supposed to open those files? I am running Windows 8 and have not figured this out. Any help would be appreciated, thanks!
Imnice777 said:
I'm just starting in my attempt to develop apps for Android, and am starting by learning Java. I have downloaded the Headfirst Java textbook along with JDK and Eclipse. However, I can still not open the .class and .java extension files needed for the textbook. Perhaps I did something wrong? What exactly is supposed to open those files? I am running Windows 8 and have not figured this out. Any help would be appreciated, thanks!
Click to expand...
Click to collapse
.class is a compiled executable, just like exe why you need to see the content of it, .class is meant to be executed. just do java <yourclass_name> and press enter. in CMD prompt. it will run.
as you said you had installed eclipse/JDK?, then to open java file it is an editor.
Are you facing anything else ?
Amit
Eclipse can be kinda funky if you haven't got your classpath set up correctly. Try installing Intellij IDEA and opening the .java files in that, compiling then running.
If you have a hard time installing JDK
Try goormIDE
You can easily build a development environment with a cloud IDE service that provides docker-based containers.

[SCRIPT] Quickly Convert *.java To *.smali Code

Most of us often want to add custom functionality to an existing apk and know how to do it in java, but don't know the exact dex/smali syntax. Trying to add this, there, test, error, debug, fix & hopefully getting it to work is common. To solve all of that trouble, I bring you this.
I made these little scripts to add an extension to Windows explorer shell for doing a task most people couldn't just do this easy. So now can just write your functionality in java, right-click the file & click Convert To *.smali and tada! You have the dex/smali compatible code which you can then paste it into your apk smali file.
Installation:
Download the attachment & extract the archive.
Run install.cmd as Administrator to install Windows Explorer shortcut.
You can also darg-n-drop files on convert.cmd to convert them.
Nice bro :thumsup:
Thank you very much. This is exactly what I need
Thanks for the information..
I would like you to help me with this issue since I do not want to work the conversion
it not work
where is the converted smali jfile?
Hello.
I click the right button of mouse and click the Convert to*.smali.
But I didn't the converted file.
could you lend me a hand?
vaibhavpandeyvpz said:
Most of us often want to add custom functionality to an existing apk and know how to do it in java, but don't know the exact dex/smali syntax. Trying to add this, there, test, error, debug, fix & hopefully getting it to work is common. To solve all of that trouble, I bring you this.
I made these little scripts to add an extension to Windows explorer shell for doing a task most people couldn't just do this easy. So now can just write your functionality in java, right-click the file & click Convert To *.smali and tada! You have the dex/smali compatible code which you can then paste it into your apk smali file.
Installation:
Download the attachment & extract the archive.
Run install.cmd as Administrator to install Windows Explorer shortcut.
You can also darg-n-drop files on convert.cmd to convert them.
Click to expand...
Click to collapse
Can you please update this. I tried running it on windows 10 and after that I don’t see the right click convert to smali
It's not working on Windows 10....Any updates on it?

Categories

Resources