Recommended: Use OperaMini or OperaMiniMod in this process and dont use 'Mobile view' in Opera
Upload ur app in .jar extension (which u want to sign) in any hosting site which gives direct download link or u can also upload it to any wapka site (as i do) and note down the downloading link of ur uploaded app.
Now go to http://translate.google.com and enter 'http://simak.ru' in it (its because simak.ru is a russian site and to translate it in english we have to go through google translate) and hit 'Translate'
Now simak.ru will open in english, scroll down and hit 'Java Certifier'
New page will open now, Tick ur desired certifcate to sign ur app and also tick ur desired permissions u want to give to your app.
Scroll down and go to the blank box beside CERTIFY.
Paste Your apps downloading link in it and hit 'Certify'
It will generate two files- jad and jar.
You must have to direct download both files so that we could install it manually in our s40 phone (u can use opera to download these if it supports direct downloading feature) or copy the link of both generated files and paste in UC and save both files using UC Browser.
After downloading go to ur files in ur gallery. Both files should be in the same folder and the name of both files must be same except extension (like if jad file's name is '1272fhjggk945_jad' then jar file's name must be 1272fhjggk945_jar). Now first rename ur jad file from _jad to .jad, it will show as invalid app, dont touch it and rename jar file _jar to .jar, jad file will dissapear and your app will now be ready to use
Now set ur app's all permissions to always allowed and enjoy.
Note: Darkman (if ur app is signed by darkman) or any other certificate must be installed in ur phone to run that signed app.