联通定制机里有个selfreg.apk,自注册,你弄出来,反编译一下看看。

解决方案 »

  1.   

    反编译了,但可能不能满足你的要求:
    package com.android.selfreg;import android.app.PendingIntent;
    import android.content.BroadcastReceiver;
    import android.content.Context;
    import android.content.Intent;
    import android.os.Build;
    import android.os.Bundle;
    import android.os.SystemProperties;
    import android.telephony.SmsManager;
    import android.telephony.TelephonyManager;
    import android.util.Log;
    import java.io.DataInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;public class selfreg extends BroadcastReceiver
    {
      private static final String LOG_TAG = "[Self_Reg]";
      private static final String fileself = "selfreg.txt";
      public Context myContext;  private Boolean existSelfregInfo()
      {
        File localFile = this.myContext.getFilesDir();
        if (new File(localFile, "selfreg.txt").exists());
        for (Boolean localBoolean = Boolean.valueOf(1); ; localBoolean = Boolean.valueOf(0))
          return localBoolean;
      }  private String getDevInfo()
      {
        String str1 = ((TelephonyManager)this.myContext.getSystemService("phone")).getDeviceId();
        String str2 = SystemProperties.get("ril.IMSI", "Default");
        StringBuilder localStringBuilder1 = new StringBuilder();
        String str3 = Build.MODEL.substring(0, 1).toUpperCase();
        StringBuilder localStringBuilder2 = localStringBuilder1.append(str3);
        String str4 = Build.MODEL.substring(1);
        String str5 = str4;
        String str6 = SystemProperties.get("ro.build.PDA", "Unknown");
        return "IMEI:" + str1 + "/" + str2 + "/" + "Samsung" + "/" + str5 + "/" + str6;
      }  private String loadSelfregInfo()
      {
        try
        {
          FileInputStream localFileInputStream = this.myContext.openFileInput("selfreg.txt");
          DataInputStream localDataInputStream = new DataInputStream(localFileInputStream);
          String str = localDataInputStream.readLine();
          localDataInputStream.close();
          return str;
        }
        catch (FileNotFoundException localFileNotFoundException)
        {
          localFileNotFoundException.printStackTrace();
        }
        catch (IOException localIOException)
        {
          localIOException.printStackTrace();
        }
      }  private Boolean saveSelfregInfo(String paramString)
      {
        try
        {
          FileOutputStream localFileOutputStream = this.myContext.openFileOutput("selfreg.txt", 0);
          byte[] arrayOfByte = paramString.getBytes();
          localFileOutputStream.write(arrayOfByte);
          localFileOutputStream.close();
          return Boolean.valueOf(1);
        }
        catch (FileNotFoundException localFileNotFoundException)
        {
          localFileNotFoundException.printStackTrace();
        }
        catch (IOException localIOException)
        {
          localIOException.printStackTrace();
        }
      }  private Boolean sendSelfregInfo()
      {
        SmsManager localSmsManager = SmsManager.getDefault();
        byte[] arrayOfByte1 = new byte[10];
        byte[] arrayOfByte2 = getDevInfo().getBytes();
        PendingIntent localPendingIntent1 = null;
        PendingIntent localPendingIntent2 = null;
        localSmsManager.sendDataMessage("10655464", null, 26680, arrayOfByte2, localPendingIntent1, localPendingIntent2);
        return Boolean.valueOf(1);
      }  public void onCreate(Bundle paramBundle)
      {
        Log.i("[Self_Reg]", "onCreate");
      }  public void onReceive(Context paramContext, Intent paramIntent)
      {
        Log.i("[Self_Reg]", "Self_Reg received broadcast message");
        this.myContext = paramContext;
        String str1 = paramIntent.getAction();
        if ("android.intent.action.BOOT_COMPLETED".equals(str1))
        {
          Log.i("[Self_Reg]", "Start");
          if (!(existSelfregInfo().booleanValue()))
            break label203;
          String str2 = getDevInfo();
          String str3 = SystemProperties.get("ril.IMSI", "Default");
          Log.i("[Self_Reg]", str2);
          String str4 = loadSelfregInfo();
          Log.i("[Self_Reg]", str4);
          if ((!(str4.contains("T"))) || (!(str4.contains(str3))))
            break label111;
          Log.i("[Self_Reg]", "Selfreg was succeed. so exit app.");
        }
        while (true)
        {
          return;
          if (!(((TelephonyManager)this.myContext.getSystemService("phone")).getNetworkOperator().equals("46001")))
            label111: Log.i("[Self_Reg]", "sim is not CU sim and file exist");
          sendSelfregInfo();
          StringBuilder localStringBuilder1 = new StringBuilder().append("T");
          String str5 = SystemProperties.get("ril.IMSI", "Default");
          String str6 = str5;
          saveSelfregInfo(str6);
          Log.i("[Self_Reg]", "Sent Selfreg message to CU server and file exist");
          continue;
          if (!(((TelephonyManager)this.myContext.getSystemService("phone")).getNetworkOperator().equals("46001")))
            label203: Log.i("[Self_Reg]", "sim is not CU sim");
          sendSelfregInfo();
          StringBuilder localStringBuilder2 = new StringBuilder().append("T");
          String str7 = SystemProperties.get("ril.IMSI", "Default");
          String str8 = str7;
          saveSelfregInfo(str8);
          Log.i("[Self_Reg]", "Sent Selfreg message to CU server");
        }
      }
    }
      

  2.   

    apk反编译相关
    http://topic.csdn.net/u/20101128/22/c2385523-4a86-4681-8375-626c81b9a537.htmlhttp://tech.it168.com/a2010/1011/1111/000001111963.shtmlhttp://www.cnblogs.com/huyipeng/archive/2010/07/25/1784679.htmlhttp://download.csdn.net/down/2843032/wbwangahttp://morry.javaeye.com/blog/769521
      

  3.   


    非常感谢,短信自注册功能我也需要看看!我要做的东西需要终端自注册,终端信息采集以及终端参数配置,这些信息就是PIM、GPRS、WAP、MMS的参数!