Example #1
0
  public boolean parsePackage() {
    AssetManager assmgr = null;
    boolean assetError = true;
    try {
      assmgr = ReflectAccelerator.newAssetManager();
      if (assmgr == null) return false;

      int cookie = ReflectAccelerator.addAssetPath(assmgr, mArchiveSourcePath);
      if (cookie != 0) {
        parser = assmgr.openXmlResourceParser(cookie, "AndroidManifest.xml");
        assetError = false;
      } else {
        Log.w(TAG, "Failed adding asset path:" + mArchiveSourcePath);
      }
    } catch (Exception e) {
      Log.w(TAG, "Unable to read AndroidManifest.xml of " + mArchiveSourcePath, e);
    }
    if (assetError) {
      if (assmgr != null) assmgr.close();
      return false;
    }

    res = new Resources(assmgr, Small.getContext().getResources().getDisplayMetrics(), null);
    return parsePackage(res, parser);
  }