API 描述
UpdateSetting
public boolean isDownload = true;
public boolean ignoreFreqLimit = false;
public boolean downloadOnlyInWiFi = false;
public boolean fromPush = false;
public boolean ignoreDelay = true;
public boolean deleteOldBizBeforeDownload = false;
UpdateEntity
public static final int E_UPDATE_TYPE_NORMAL = 1;
public static final int E_UPDATE_TYPE_INCR = 2;
public static final int E_PKG_TYPE_MAIN = 0;
public static final int E_PKG_TYPE_COMMON = 1;
public String bid = "";
public int version = 0;
public int updateType = 0;
public int pkgType = 0;
ProgressEntity
public String bid;
public int progress;
public long totalBytes;
DownloadInfo
public int code;
public String bid;
private String message;
OfflinePkg
private String bid;
private int targetVersion;
TMFWebResourceResponse
private WebResourceResponse resourceResponse;
private String path;
OfflineConfig
public boolean deleteOldBizBeforeDownload;
public boolean fallbackEnable;
public boolean storeInSDCard;
public boolean quickVerify;
public ExecutorService threadPool;
private String publickKey;
private boolean isCheckUpdateOnLoadUrl;
private int downloadModeOnPush;
private int protocalType;
DefaultUpdateInfoListener
public static final int DOWNLOAD_IGNORE_ON_PUSH = 1;
public static final int DOWNLOAD_RIGHTNOW_ON_PUSH = 2;
public static final int DOWNLOAD_ONLY_WIFI_ON_PUSH = 3;
public DefaultUpdateInfoListener(Context context, int downloadMode)
IOfflineUpdateCallback
void update(final int code, final List<UpdateEntity> updateInfos);
void downloadProgress(ProgressEntity progressInfo);
void downloadFinish(DownloadInfo downloadInfo);
AbsLoadUrlCallback
public abstract void onFinish(String url);
OfflineManager
public static final int CHECK_CODE_IGNORE_HAD_UPDATE_IN_A_SHORT_TIME = 5;
public static final int CHECK_CODE_SUCC_NO_UPDATE = 8;
public static final int CHECK_CODE_SUCC_CAN_UPDATE = 10;
public static final int CHECK_CODE_ERR_NOT_WIFI = 2;
public static final int CHECK_CODE_ERR_PARAM = 1;
public static final int CHECK_CODE_ERR_RESP_NULL = 11;
public static final int CHECK_CODE_ERR_RESP_PARSE_ERROR = 12;
public static final int CHECK_CODE_ERR_RESP_RET_ERROR = 13;
public static final int CHECK_CODE_ERR_RESP_NO_URL = 14;
public static final int CHECK_CODE_ERR_URL_WITHOUT_BID = 15;
public static final int CHECK_CODE_ERR_NETWORK_CHANNEL_ERROR = 16;
public static final int CHECK_CODE_ERR_RESP_SUBRET_ERROR = 17;
public static final int CHECK_CODE_LOCAL_EXIST = 18;
public static final int DOWNLOAD_CODE_SUCCESS = 0;
public static final int DOWNLOAD_CODE_ERROR_UNPACK = 1;
public static final int DOWNLOAD_CODE_ERROR_PATCH = 2;
public static final int DOWNLOAD_CODE_ERROR_DECRYPT = 3;
public static final int DOWNLOAD_CODE_ERROR_OUTER_UNPACK = 4;
public static final int DOWNLOAD_CODE_ERROR_S_FAIL = 5;
public static final int DOWNLOAD_CODE_ERROR_FULL_PACKAGE_CHECK_FAIL = 6;
public static final int DOWNLOAD_CODE_ERROR_PATCH_DUPLICATE = 7;
public static final int DOWNLOAD_CODE_ERROR_FILE_PATH = 8;
public static final int DOWNLOAD_CODE_OFFLINE_PACKAGE_PARSE = 9;
public static final int CODE_DOWNLOAD_IOEXCEPTION = -100000;
public static final int CODE_DOWNLOAD_EXCEPTION = -100001;
public static final int CODE_DOWNLOAD_CANCEL = -100002;
public static final int CODE_NO_NETWORK = -100003;
public static final int CODE_PARAM_ERROR = -100004;
public static final int CODE_DOWNLOAD_DIR_CREATE_FAIL = -100005;
public static void init(Context context)
public static void init(Context context, OfflineConfig config)
public void checkAllUpdate(UpdateSetting updateSetting, final IOfflineUpdateCallback callback);
public void checkLatestUpdate(final List<String> bids, UpdateSetting updateSetting,
final IOfflineUpdateCallback callback)
public void checkLatestUpdate(final String bid, UpdateSetting updateSetting,
final IOfflineUpdateCallback callback)
public void checkUpdateByUrl(final String url, UpdateSetting updateSetting, final IOfflineUpdateCallback callback)
public void loadUrlAysn(final String url, final SimpleCallback<String> callback)
public TMFWebResourceResponse shouldInterceptRequest(String url)
public static void deleteAllOfflineData(final Context context, final SimpleCallback<Integer> callback)
public static List<String> deleteBiz(final Context context, final List<String> businessIds)
public static void deleteBiz(final Context context, final String businessId,
final SimpleCallback<Integer> callback)
public static void getBizConfig(final Context context, final String businessId,
final SimpleCallback<JSONObject> callback)
public static void getBizUpdateTime(final Context context, final String businessId,
final SimpleCallback<Long> callback)
public static void getBizConfig(final Context context, final String businessId,
final SimpleCallback<JSONObject> callback)
public static String getBizVersion(final Context context, final String businessId)
public static String getBusinessId(String url)
public static void getLocalOfflineVersions(final Context context, final SimpleCallback<String> callback)
@Deprecated
public static void releaseBizFromAssets(final Context context, final String businessId,
final SimpleCallback<Integer> callback)