Quick and simple step by step ensymble guide for Windows

This tutorial is intended for a group of people that they're not programmers or they're new to PyS60 and like to experiment making .sis applications for mobile phones. There's a lot of documentation on the internet about ensymble but not a single simple step by step guide.

So the steps we have to follow to built a .sis file are:

1) Download and install OpenSSL for Windows.

2) Download ensymble python script unzip it and copy it to OpenSSL folder (something like: C:\Program Files\GnuWin32\bin\ensymble_python2.5-0.26.py).

3) Also copy your python script to OpenSSL folder and run ensymble command on the command prompt:
python ensymble_python2.5-0.26.py py2sis --uid=0xE0000000 --appname=your_app_name --version=1.0.0 your_app_name.py your_app_name.sisnow you have probably successfully build your .sis file. Also, be sure that you have path your python directory.

4) Go to Open Signed Online and fill the required fields.

5) You'll get an email with a signed sis file.

6) Install it on your phone and enjoy it!

Good luck!

Resources:
Ensymble: http://ensymble.googlecode.com
Ensymble readme: http://code.google.com/p/ensymble/wiki/Welcome?tm=6
OpenSSL: http://gnuwin32.sourceforge.net/packages/openssl.htm
Open signed online: https://www.symbiansigned.com/app/page/public/openSignedOnline.do

Spy phone python script for S60


The other day I was surfing some surveillance websites and I found some patented mobile phones called spy phones and also some spy software. All of course, at high prices for my standards! The concept is, you call the target phone which will result in the answering of it and let you listen into the surroundings. They also have some extra features like stealth/ghost mode, no lights or zero ringings etc etc.

However the price as I mention isn't reasonable and it's possible for someone with basic programming skills and some research on the internet to do that kind of work with no money at all! How?

Well, I wrote a simple python script for S60 compatible devices that allows you to call the target cellphone, which will acknowledge a number of your choice and afterwards when you hung up it automatically start recording any ambient sound or conversation surrounding the phone.
It has no ghost or no ringing capability but if you are using a Nokia phone you can achieve this by assigning a blank sound to that entry.

I have tested it successfully on my Nokia N95 8GB with Python for S60 1.4.2 final.
You can download the script here (Last update: Sun 23 2010).

Have fun :)

Wake on LAN MIDlet

Wake On LAN Mob is a J2ME application for mobile devices.

When I first posted Wake on LAN Java MIDlet on my website I received various e-mails asking me for some extra features, modifications and source code requests. I didn't expect so much interest at all so I decided to provide the source code.

Tested on Nokia 6630, Nokia N95 8GB, Nokia E65, HTC Touch, HTC TyTN II.
Screenshots: 1, 2, 3

Here is my simple implementation, enjoy!// © J@mBeL.net
import java.util.Vector;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;

public class WakeOnLan extends MIDlet implements CommandListener {

    private Display display;
    private Form mainScr;

    private Command OKCommand;
    private Command ClearCommand;
    private Command exitCommand;

    private static TextField tfIP;
    private static TextField tfMAC;

    private Alert alert;

    private static final int PORT = 9;

    public WakeOnLan() {
        display = Display.getDisplay(this);
        mainScr = new Form("WakeOnLan Mob");
        tfIP = new TextField("IP Address:\n", "", 16, 0);
        tfMAC = new TextField("MAC Address:\n", "", 17, 0);
        mainScr.append(tfIP);
        mainScr.append(tfMAC);
        mainScr.append("© 2007 jambel.net");
        OKCommand = new Command("Send", Command.OK, 1);
        ClearCommand = new Command("Clear", Command.ITEM, 1);
        exitCommand = new Command("Exit", Command.EXIT, 1);
        mainScr.addCommand(OKCommand);
        mainScr.addCommand(ClearCommand);
        mainScr.addCommand(exitCommand);
        mainScr.setCommandListener(this);
    }

    private class SendPacket implements Runnable {
        public void run(){
            SendStr(tfIP.getString(), tfMAC.getString());
        }

        private void SendStr(String ipStr, String macStr) {
            if(ipStr.length() == 0 || macStr.length() == 0) {
                alert = new Alert("Please fill IP and MAC address fields.");
                display.setCurrent(alert, mainScr);
                return;
            }
            else {
                try {
                    byte[] macBytes = getMacBytes();
                    byte[] bytes = new byte[6 + 16 * macBytes.length];
                    for (int i = 0; i < 6; i++) {
                        bytes[i] = (byte) 0xff;
                    }
                    for (int i = 6; i < bytes.length; i += macBytes.length) {
                        System.arraycopy(macBytes, 0, bytes, i, macBytes.length);
                    }

                    String address = "datagram://" + ipStr + ":" + PORT;
                    DatagramConnection packet = (DatagramConnection)Connector.open(address);
                    Datagram dgram = packet.newDatagram(bytes, bytes.length, address);
                    packet.send(dgram);
                    packet.close();

                    alert = new Alert("Wake-on-LAN packet sent.");
                    display.setCurrent(alert, mainScr);
                }
                catch (Exception e) {
                    alert = new Alert("Failed to send Wake-on-LAN packet: " + e);
                    display.setCurrent(alert, mainScr);
                    return;
                    //System.exit(1);
                }
            }
        }
    }

    private byte[] getMacBytes() throws IllegalArgumentException {
        byte[] bytes = new byte[6];
        String sep;
            if(tfMAC.getString().indexOf(":") > 0)
                sep=":";
            else
                sep="-";
                String[] hex = split(tfMAC.getString(),sep);
            if (hex.length != 6) {
                throw new IllegalArgumentException("Invalid MAC address.");
            }
            try {
                for (int i = 0; i < 6; i++) {
                    bytes[i] = (byte) Integer.parseInt(hex[i], 16);
                }
            }
            catch (NumberFormatException e) {
                throw new IllegalArgumentException("Invalid hex digit in MAC address.");
            }
        return bytes;
    }

    private static String[] split(String original, String separator) {
        Vector nodes = new Vector();

        // Parse nodes into vector
        int index = original.indexOf(separator);
        while(index>=0) {
            nodes.addElement( original.substring(0, index) );
            original = original.substring(index+separator.length());
            index = original.indexOf(separator);
        }
        // Get the last node
        nodes.addElement( original );

        // Create splitted string array
        String[] result = new String[ nodes.size() ];
        if( nodes.size()>0 ) {
            for(int loop=0; loop < nodes.size(); loop++)
                result[loop] = (String)nodes.elementAt(loop);
            }
        return result;
    }

    public void commandAction(Command c, Displayable d) {
        if (c == OKCommand) {
            if (d == mainScr) {
                SendPacket doIt = new SendPacket();
                Thread myThread = new Thread( doIt );
                myThread.start();
            } else {
                display.setCurrent(mainScr);
            }
        } else if (c == ClearCommand) {
            tfIP.setString("");
            tfMAC.setString("");
        } else if (c == exitCommand) {
            destroyApp(false);
            notifyDestroyed();
        }
    }

    public void startApp() {
    Display.getDisplay(this).setCurrent(mainScr);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}
You can download it here.

You can freely distribute it as you wish and if you like just add a reference on me.
Also you can e-mail me your modifications just to notify me.

Welcome to jambel.net blog

This is my first blogging attempt!

My name is John Ambeliotis and I'm a Software Engineer from Greece. You can check my full profile here if you like.

In this place I'll try to share some code parts I use and how do I do things in a range of computer languages/technologies. Also maybe some thoughts or life events that might happen and worth some mention, at least to me :)

I hope you to find some useful stuff.

Thanks for your visit, let's get started...