Ejemplo n.º 1
0
  private int readFromLocal(String accPath) {
    // isAlreadyReadLocal = true;
    String path = accPath + LOCAL_CONFIG_FILENAME;
    if (!FileOperation.fileExists(path)) {

      readConfig();
      return -1;
    }
    byte[] buf = FileOperation.readFromFileV2(path, 0, -1);
    if (Util.isNullOrNil(buf)) {

      readConfig();
      return -2;
    }
    String info = new String(buf);
    if (Util.isNullOrNil(info)) {

      readConfig();
      return -3;
    }
    Log.d(TAG, "readFromLocal info " + info);
    cfgStg.set(ConstantsStorage.USERINFO_SERVER_CONFIG_INFO, info);
    isAlreadyReadLocal = true;

    super.doNotify(info);
    return 0;
  }
Ejemplo n.º 2
0
  private void readConfig() {

    String info = (String) cfgStg.get(ConstantsStorage.USERINFO_SERVER_CONFIG_INFO);
    Log.d(TAG, "readConfig xml " + info);
    if (!Util.isNullOrNil(infoCache)) {
      super.doNotify(info);
    }
  }
Ejemplo n.º 3
0
  public int saveConfigInfo(String info) {
    Log.d(TAG, "dkconf info:[%s] ", info);
    if (isAlreadyReadLocal) {
      return 0;
    }
    cfgStg.set(ConstantsStorage.USERINFO_SERVER_CONFIG_INFO, info);
    infoCache = null;

    super.doNotify(info);
    return 0;
  }
Ejemplo n.º 4
0
 public static String getLocalFingerprint() {
   LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
   String flinger = android.os.Build.FINGERPRINT;
   if (flinger != null) {
     flinger = flinger.replace("/", ":");
   }
   map.put("fingerprint", flinger);
   map.put("manufacturer", android.os.Build.MANUFACTURER);
   map.put("device", android.os.Build.DEVICE);
   map.put("model", android.os.Build.MODEL);
   map.put("product", android.os.Build.PRODUCT);
   map.put("board", android.os.Build.BOARD);
   map.put("release", android.os.Build.VERSION.RELEASE);
   map.put("codename", android.os.Build.VERSION.CODENAME);
   map.put("incremental", android.os.Build.VERSION.INCREMENTAL);
   map.put("display", android.os.Build.DISPLAY);
   String key = Util.mapToXml("key", map);
   Log.d(TAG, "getLocalFingerprint  " + key);
   return key;
 }
Ejemplo n.º 5
0
 /**
  * <deviceinfo> <MANUFACTURER name="ZTE"> <MODEL name="U880"> <VERSION_RELEASE name="2.2.2">
  * <VERSION_INCREMENTAL name="eng.root.20111209.164040"> <DISPLAY name="MIUI.2.3.7c"></DISPLAY>
  * </VERSION_INCREMENTAL> </VERSION_RELEASE> </MODEL> </MANUFACTURER> </deviceinfo>
  */
 public static String getFingerprint() {
   StringBuffer key = new StringBuffer();
   key.append("<deviceinfo>");
   key.append("<MANUFACTURER name=\"");
   key.append(android.os.Build.MANUFACTURER);
   key.append("\">");
   key.append("<MODEL name=\"");
   key.append(android.os.Build.MODEL);
   key.append("\">");
   key.append("<VERSION_RELEASE name=\"");
   key.append(android.os.Build.VERSION.RELEASE);
   key.append("\">");
   key.append("<VERSION_INCREMENTAL name=\"");
   key.append(android.os.Build.VERSION.INCREMENTAL);
   key.append("\">");
   key.append("<DISPLAY name=\"");
   key.append(android.os.Build.DISPLAY);
   key.append("\">");
   key.append(
       "</DISPLAY></VERSION_INCREMENTAL></VERSION_RELEASE></MODEL></MANUFACTURER></deviceinfo>");
   Log.d(TAG, "getFingerprint  " + key.toString());
   return key.toString();
 }
Ejemplo n.º 6
0
 public String getInfoByKey(final int key) {
   infoCache = (String) cfgStg.get(key);
   Log.d(TAG, "getInfoByKey xml " + infoCache + " key " + key);
   return infoCache;
 }