@@ -0,0 +1,1150 @@
+package com.xqbase.util.sns;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.nio.charset.StandardCharsets;%0D%0A%0D%0Aimport org.json.JSONException;%0D%0Aimport org.json.JSONObject;%0D%0A%0D%0Aimport com.xqbase.util.ByteArrayQueue;%0D%0Aimport com.xqbase.util.Log;%0D%0Aimport com.xqbase.util.http.HttpPool;%0D%0A%0D%0Apublic class ChinazIp %7B%0D%0A%09private static final String SERVICE_URL =%0D%0A%09%09%09%22http://ip.chinaz.com/ajaxsync.aspx?at=ip&ip=%22;%0D%0A%0D%0A%09private static HttpPool httpPool = new HttpPool(SERVICE_URL, 15000);%0D%0A%0D%0A%09public static HttpPool getHttpPool() %7B%0D%0A%09%09return httpPool;%0D%0A%09%7D%0D%0A%0D%0A%09public static String getIpInfo(String ip) %7B%0D%0A%09%09try %7B%0D%0A%09%09%09ByteArrayQueue body = new ByteArrayQueue();%0D%0A%09%09%09int status = httpPool.get(ip, null, body, null);%0D%0A%09%09%09if (status %3E= 400) %7B%0D%0A%09%09%09%09Log.w(body.toString());%0D%0A%09%09%09%09return null;%0D%0A%09%09%09%7D%0D%0A%09%09%09String callback = body.toString(StandardCharsets.UTF_8);%0D%0A%09%09%09if (!callback.startsWith(%22(%5B%22) && !callback.endsWith(%22%5D)%22)) %7B%0D%0A%09%09%09%09Log.w(callback);%0D%0A%09%09%09%09return null;%0D%0A%09%09%09%7D%0D%0A%09%09%09return new JSONObject(callback.substring(2, callback.length() - 2)).%0D%0A%09%09%09%09%09optString(%22location%22);%0D%0A%09%09%7D catch (IOException %7C JSONException e) %7B%0D%0A%09%09%09Log.w(e.getMessage());%0D%0A%09%09%09return null;%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%7D

add chinaz ip location service