a.java 源代码


package r2;

import android.content.Context;
import androidx.annotation.NonNull;
import com.xuexiang.xupdate.entity.DownloadEntity;
import java.io.File;
import java.io.IOException;
import p2.c;

public class a implements q2.b {
    @Override
    public boolean a(@NonNull Context context, @NonNull File file, @NonNull DownloadEntity downloadEntity) {
        if (c(downloadEntity, file)) {
            return d(context, file);
        }
        c.o(5000, "apk文件校验不通过!");
        return false;
    }

    @Override
    public void b() {
    }

    protected boolean c(DownloadEntity downloadEntity, @NonNull File file) {
        if (downloadEntity != null && downloadEntity.isApkFileValid(file)) {
            return true;
        }
        return false;
    }

    protected boolean d(Context context, File file) {
        try {
            return w2.a.e(context, file);
        } catch (IOException unused) {
            c.o(5000, "获取apk的路径出错!");
            return false;
        }
    }
}