secureSMS源码发布,想改就改!例如加入基站信息!
自己慢慢研究,慢慢修改,看懂的能做更多,大家都要去研究学习一下一些简单的编程,不要总是拿来主义!要不那些高手们高处不胜寒--都不来了!你说那些做高手的是不是真累!这么多网友的需求,自己有限的时间精力!
import com.siemens.mp.NotAllowedException;
import com.siemens.mp.gsm.SMS;
import com.siemens.mp.io.File;
import java.io.IOException;
import java.io.PrintStream;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public final class GSM extends MIDlet
{
private Display display;
private TextField smsPhoneTextField;
private TextField smsTextField;
private Form smsForm;
int mydescriptor;
int filesize;
String str;
private String goSMS;
public GSM()
{
goSMS = "亲爱的:快来找我!!\nIMEI: "
+ System.getProperty("com.siemens.IMEI");
//更改短信内容
//当然你要把基站信息发出去的话,也从上面想办法吧!---------------------------------------------------------------------------
}
protected void destroyApp(boolean unconditional)
throws MIDletStateChangeException
{
exitMIDlet();
}
private void exitMIDlet()
{
notifyDestroyed();
}
protected void pauseApp()
{
}
protected void startApp()
throws MIDletStateChangeException
{
System.out.println("RUN");
display = Display.getDisplay(this);
smsForm = new Form("");
initfile();
display.setCurrent(smsForm);
sms();
}
private void sms()
{
System.out.println("to" + str + " Text:" + goSMS);
try
{
SMS.send(str, goSMS);
exitMIDlet();
}
catch(IllegalArgumentException ex)
{
showMessage("Error", "Phone number is incorrect.");
}
catch(IOException ex)
{
showMessage("Error", "Network is not available.");
}
catch(NotAllowedException ex)
{
showMessage("Error", "Transfer is not allowed.");
}
}
private void showMessage(String title, String message)
{
Alert alert = new Alert(title);
alert.setString(message);
alert.setTimeout(-2);
display.setCurrent(alert);
}
public void initfile()
{
File myfile = new File();
try
{
if(File.exists("nb.txt") >= 0)
{
mydescriptor = myfile.open("nb.txt");
filesize = myfile.length(mydescriptor);
System.out.println(mydescriptor);
System.out.println(filesize);
}
}
catch(IllegalArgumentException _ex) { }
catch(IOException _ex) { }
try
{
byte abyte0[] = new byte;
myfile.seek(mydescriptor, 0);
if(mydescriptor > 0)
{
myfile.read(mydescriptor, abyte0, 0, filesize);
str = new String(abyte0);
System.out.println(str);
}
}
catch(IllegalArgumentException _ex) { }
catch(IOException _ex) { }
}
}
修改的两个重点:1。在信息中加入基站信息。2。取消发送确认提示! 看不懂
但觉得是好东西
顶一下先~~~~ 顶了,虽然看不懂 顶,不过真的不懂,学习一下 学一门语言吧-那是计算机的艺术,编程的艺术!
我也是正在修炼!哈哈 顶先。看不懂,也不会。不过很喜欢。。。 顶,如果早一个月拿到的话,或许就找个人改了。
收藏起来,以后再说。 楼主,能不能把所有的源码发给我,我来看看,广东有个盲人医院急需要这个东东!!!! 我就想要是把防盗功能用到的这个软件积成到flash,独立开mmc就完美了 原帖由 fsclub 于 2005-6-9 14:01 发表
楼主,能不能把所有的源码发给我,我来看看,广东有个盲人医院急需要这个东东!!!!
关于这个secureSMS的源码就是这么多了,其他类似GPS的倒是可以反汇编出来,不过作者不是我啊!哈
老乡,你是专门搞这个的?说说盲人医院是怎么的应用这个软件。 收之,那天学JAVA时就好好研究研究。 谢谢,已收藏,以前做的时候虽然有改过信息,但是不如直接看源码来得清楚。
先询问一下 我将此移动到SPGC区做资料吧,楼主同意么? 原帖由 RainMoon 于 2005-6-9 23:27 发表
谢谢,已收藏,以前做的时候虽然有改过信息,但是不如直接看源码来得清楚。
先询问一下 我将此移动到SPGC区做资料吧,楼主同意么?
可以,不过我希望把原作者的资料补上去!你们应该知道!我不是作者,我只是反汇编出来而已!
另外,需要的话我可以把dreamfrank的6688gps0.7版也公布出来!不过联系不上原作者!哈哈--盗窃?
另外他之前也说过只会公布低版本的源码!这个不一定公布哦!违规?
不过拿来研究我看还是可以的! 这个JAVA是我从某处下载的,现在时间一久也记不得原出处了。
好的,我就转移到SPGC区去,仍会保留链接在本区的,也就是说这里同样也可以看到。 原帖由 RainMoon 于 2005-6-10 00:10 发表
这个JAVA是我从某处下载的,现在时间一久也记不得原出处了。
好的,我就转移到SPGC区去,仍会保留链接在本区的,也就是说这里同样也可以看到。
如有需要。我明天把所有的关于gps的源码都上了!供大家研究,希望论坛上多一些兄弟加入,我也是刚开始摸的!菜--希望以后在这里可以有一个j2me的基地!
看了一些源码,真不是我想象中的那么简单,可能自己的水平还没到位,晕!
希望j2me高手多上来指点! 收 藏 先。。。。。 原帖由 nssong 于 2005-6-9 21:02 发表
关于这个secureSMS的源码就是这么多了,其他类似GPS的倒是可以反汇编出来,不过作者不是我啊!哈
老乡,你是专门搞这个的?说说盲人医院是怎么的应用这个软件。
俺只是业余爱好者,那几天在MSN上和一个朋友聊天,她就在一家盲人医院,她说她们那里的盲人常常走失,常常打电话到她们那里询问如何回家,但盲人很难说清楚所在的位置,她的意思是只要定时(比如5分钟)就把基站代码发给她们,那样她们就能随时掌握盲人的行踪.(她说那些盲人的通信费是免费的,电话和短信都免费.) 原帖由 fsclub 于 2005-6-10 08:34 发表
俺只是业余爱好者,那几天在MSN上和一个朋友聊天,她就在一家盲人医院,她说她们那里的盲人常常走失,常常打电话到她们那里询问如何回家,但盲人很难说清楚所在的位置,她的意思是只要定时(比如5分钟)就把基站代码发 ...
其实这个我也想了很久,原以为很简单,但是以我现在的水平,真是。。
不过你这个想法是不错,但是效果就不好说了,难道盲人都配一部小八?何况还有精度的问题! /***********************************************************************
*
* konGPS.java
*
* Implementation of konGPS for Siemens SL45i
*
* Copyright (C) 2002-2003 by KoncaOnLine (http://www.konca.com).
*
* Author: Konca Fung (konca@tom.com)
*
* This program may be distributed according to the terms of the GNU
* General Public License, version 2 or (at your option) any later version.
*
*
*
* LIC: GPL
* ( http://www.gnu.org/copyleft/gpl.html )
*
***********************************************************************/
package konGPS;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class konGPS extends MIDlet implements CommandListener
{
public Command cmdExit;
private Display display; // The display for this MIDlet
private mainCanvas canvas;
public String strAreaID = "0000";
public String strCellID = "0000";
public String strSignal = "0";
public konGPS(){
display = Display.getDisplay(this);
canvas = new mainCanvas(this);
cmdExit = new Command("退出", Command.STOP, 8);
canvas.addCommand(cmdExit);
canvas.setCommandListener(this);
}
public void startApp() {
if( System.getProperty("microedition.platform").compareTo("SL45i") == 0)
{
boolean bRet = true;
if( bRet ){
display.setCurrent(canvas);
}
else {
Form pForm = new Form("konGPS - 提示:");
pForm.append(" 你未使用Java补丁,详情请见:");
pForm.append("\n www.konca.com");
pForm.addCommand(cmdExit);
pForm.setCommandListener(this);
display.setCurrent(pForm);
}
}
else{
Form pForm = new Form("konGPS - 提示:");
pForm.append("该手机型号不是\n 西门子6688i");
pForm.append("\n www.konca.com");
pForm.addCommand(cmdExit);
pForm.setCommandListener(this);
display.setCurrent(pForm);
}
}// end startApp()
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
display.setCurrent(null);
notifyDestroyed();
}
public void commandAction(Command cmd, Displayable disp){
if( cmd == cmdExit ){
this.destroyApp(true);
}
}
public void GetInfo()
{
int t = 0;
strAreaID = IntToHex2(Extension.peekb(0x039d84)) + IntToHex2(Extension.peekb(0x039d85));
strCellID = IntToHex2(Extension.peekb(0x039d87)) + IntToHex2(Extension.peekb(0x039d86));
t=Extension.peekb(0x39d8f);
if(t>127)
{
t |= 0xFFFFFF00;
strSignal = "";
}
else
strSignal = "+";
strSignal += t;
}
public String IntToHex2(int nVal)
{
if( nVal < 0 )
return "00";
else if( nVal <0x10 )
return ("0" + Integer.toHexString(nVal));
else if( nVal < 0x100)
return (Integer.toHexString(nVal));
else
return "FF";
}
} /*
Copyright (c) 2003 mamaich (mamaich@uymail.com)
.AUTHOR mamaich
.PACKAGE Extension
*/
package konGPS; // Konca Modified to "konGPS", org is "Extension"
import java.lang.Integer;
import com.siemens.mp.io.File;
import java.lang.String;
public class Extension
{
public Extension()
{
}
// Internal. Converts integer to a 6-digit hex string
private static String AddrToHex(int addr)
{
String ret=Integer.toHexString(addr);
while(ret.length()<6)
ret="0"+ret;
return ret;
}
// Internal. Converts integer to 4-digit hex string
private static String Int16ToHex(int val)
{
String ret=Integer.toHexString(val & 65535);
while(ret.length()<4)
ret="0"+ret;
return ret;
}
// Internal. Converts integer to 2-digit hex string
private static String Int8ToHex(int val)
{
String ret=Integer.toHexString(val & 255);
while(ret.length()<2)
ret="0"+ret;
return ret;
}
// Returns a byte from memory at a given address
public static int peekb(int address)
{
return Integer.valueOf(System.getProperty("X.d"+AddrToHex(address)).substring(6,8),16).intValue();
}
// Returns a word from memory at a given address
public static int peekw(int address)
{
return Integer.valueOf(System.getProperty("X.d"+AddrToHex(address)).substring(4,8),16).intValue();
}
// Returns a dword from memory at a given address
public static int peekd(int address)
{
return Integer.valueOf(System.getProperty("X.d"+AddrToHex(address)),16).intValue();
}
// Returns a string from memory at a given address
public static String string(int address)
{
return System.getProperty("X.s"+AddrToHex(address));
}
// Writes a byte to the specified address in memory. Returns previous value
public static int pokeb(int address, int data)
{
return Integer.valueOf(System.getProperty("X.w"+AddrToHex(address)+" "+Int8ToHex(data)),16).intValue();
}
// Writes a word to the specified address in memory. Returns previous value
public static int pokew(int address, int data)
{
return pokeb(address,data&255)+pokeb(address+1,data/256)*256;
}
// Writes a dword to the specified address in memory. Returns previous value
public static int poked(int address, int data)
{
return pokew(address,data&65535)+pokew(address+2,data/65536)*65536;
}
// Calls the given function passing up to 4 parameters. Returns R4+R5*65536
public static int Func(int address, int P1, int P2, int P3, int P4)
{
String s = System.getProperty("X.c"+AddrToHex(address)+
" "+Int16ToHex(P1)+" "+Int16ToHex(P2)+" "+Int16ToHex(P3)+" "+Int16ToHex(P4));
return Integer.valueOf(s,16).intValue();
}
// Calls the given function passing up to 4 parameters. Returns R4
public static int Func16(int address, int P1, int P2, int P3, int P4)
{
String s = System.getProperty("X.c"+AddrToHex(address)+
" "+Int16ToHex(P1)+" "+Int16ToHex(P2)+" "+Int16ToHex(P3)+" "+Int16ToHex(P4));
return Integer.valueOf(s.substring(4,8),16).intValue();
}
// Calls the given function passing up to 4 parameters. Returns R4+R5*16384
public static int FuncPtr(int address, int P1, int P2, int P3, int P4)
{
String s = System.getProperty("X.c"+AddrToHex(address)+
" "+Int16ToHex(P1)+" "+Int16ToHex(P2)+" "+Int16ToHex(P3)+" "+Int16ToHex(P4));
return Integer.valueOf(s.substring(0,4),16).intValue()*16384+Integer.valueOf(s.substring(4,8),16).intValue();
}
public static int Func16(int address)
{
return Func16(address,0,0,0,0);
}
public static int Func(int address)
{
return Func(address,0,0,0,0);
}
public static int FuncPtr(int address)
{
return FuncPtr(address,0,0,0,0);
}
private static int FileIOInited=0;
public static String Run(String FileName, String Parameters)
{
String s;
FileName = FileName.toLowerCase();
if(FileName.indexOf(' ')!=-1)
s="\""+FileName+"\"";
else
s=FileName;
if(Parameters.length()>0)
s+=" "+Parameters;
if(FileIOInited==0)
{
FileIOInited=1;
File F=new File(); // initialize java filesystem
F.exists("anything");
}
return System.getProperty("X.r"+s);
}
public static String Run(String FileName)
{
return Run(FileName,"");
}
}
页:
[1]
2