package com.android.mobileguard.db.dao;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class AddressDBDao {
	/**
	 * ѯֻ
	 * @param mobilenumber
	 * @return ʹǶײѯ2 outkeyӦϢ
	 */
	public static String findLocation(String mobilenumber){
		String path = "/data/data/com.android.mobileguard/files/address.db";
		SQLiteDatabase db = SQLiteDatabase.openDatabase(path, null, SQLiteDatabase.OPEN_READONLY);
		Cursor cursor = db.rawQuery("select location from data2 where id = " +
				"(select outkey from data1 where id = ?)", new String[]{mobilenumber.substring(0, 7)});
		String location = "";
		if(cursor.moveToNext()){
			location = cursor.getString(0);
		}
		cursor.close();
		db.close();
		return location;
	}
}
@@ -156,9 +156,8 @@
  * %D1%AF
-%D6%BB
 %0A%09 *
@@ -251,22 +251,16 @@
 (String 
-mobile
 number)%7B
@@ -260,16 +260,66 @@
 umber)%7B%0A
+%09%09String location = %22%DE%B4%CB%BA%22;%0A%09%09Cursor cursor = null;%0A
 %09%09String
@@ -472,31 +472,70 @@
 EADONLY);%0A%09%09
-Cursor 
+if(number.matches(%22%5E1%5B34578%5D%5C%5Cd%7B9%7D$%22))%7B//%D6%BB%0A%09%09%09
 cursor = db.
@@ -590,16 +590,17 @@
 %22 +%0A%09%09%09%09
+%09
 %22(select
@@ -647,22 +647,16 @@
 tring%5B%5D%7B
-mobile
 number.s
@@ -675,23 +675,163 @@
 7)%7D);%0A%09%09
-String 
+%09%0A%09%09%09if(cursor.moveToNext())%7B%0A%09%09%09%09location = cursor.getString(0);%0A%09%09%09%7D%0A%09%09%09cursor.close();%0A%09%09%7Delse%7B//%D6%BB%0A%09%09%09switch (number.length()) %7B%0A%09%09%09case 3:%0A%09%09%09%09
 location
@@ -838,94 +838,792 @@
  = %22
+%D4%AE
 %22;%0A%09%09
-if(cursor.moveToNext())%7B%0A%09%09%09location = cursor.getString(0);%0A%09%09%7D%0A%09%09cursor.close();
+%09%09break;%0A%09%09%09case 4:%0A%09%09%09%09location = %22%C4%A3%22;%0A%09%09%09%09break;%0A%09%09%09case 5:%0A%09%09%09%09location = %22%D2%B5%CD%B7%22;%0A%09%09%09%09break;%0A%09%09%09case 7:%0A%09%09%09%09location = %22%D8%B5%E7%BB%B0%22;%0A%09%09%09%09break;%0A%09%09%09case 8:%0A%09%09%09%09location = %22%D8%B5%E7%BB%B0%22;%0A%09%09%09%09break;%0A%09%09%09default:%0A%09%09%09%09if(number.length() %3E= 10 && number.startsWith(%220%22))%7B%0A%09%09%09%09%09cursor = db.rawQuery(%22select location from data2 where area = ?%22, new String%5B%5D%7Bnumber.substring(1, 3)%7D);%0A%09%09%09%09%09if(cursor.moveToNext())%7B%0A%09%09%09%09%09%09String temp = cursor.getString(0);%0A%09%09%09%09%09%09location = temp.substring(0,temp.length()-2);%0A%09%09%09%09%09%7D%0A%09%09%09%09%09cursor = db.rawQuery(%22select location from data2 where area = ?%22, new String%5B%5D%7Bnumber.substring(1, 4)%7D);%0A%09%09%09%09%09if(cursor.moveToNext())%7B%0A%09%09%09%09%09%09String temp = cursor.getString(0);%0A%09%09%09%09%09%09location = temp.substring(0,temp.length()-2);%0A%09%09%09%09%09%7D%0A%09%09%09%09%09cursor.close();%0A%09%09%09%09%7D%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09
 %0A%09%09d

Increase the number of type judgment belongs to query function,identity the fixed/mobile number