package df; import a.f; import android.content.Context; import com.meituan.robust.ChangeQuickRedirect; import com.meituan.robust.PatchProxy; import com.shizhuang.duapp.common.utils.SingleUploadCallback; import com.shizhuang.duapp.libs.upload.IUploadListener; import com.shizhuang.duapp.libs.upload.UploadParams; import com.shizhuang.model.AliToken; import java.io.File; import java.util.ArrayList; import java.util.List; import rd.l; import td.s; import wq.a; import wq.c; /* compiled from: UploadUtils */ public class y0 extends s<AliToken> { public static ChangeQuickRedirect changeQuickRedirect; public final /* synthetic */ List b; /* renamed from: c reason: collision with root package name */ public final /* synthetic */ boolean f31473c; public final /* synthetic */ boolean d; public final /* synthetic */ String e; public final /* synthetic */ SingleUploadCallback f; /* renamed from: g reason: collision with root package name */ public final /* synthetic */ IUploadListener f31474g; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public y0(Context context, List list, boolean z, boolean z4, String str, SingleUploadCallback singleUploadCallback, IUploadListener iUploadListener) { super(context); this.b = list; this.f31473c = z; this.d = z4; this.e = str; this.f = singleUploadCallback; this.f31474g = iUploadListener; } @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a public void onFailed(l lVar) { if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 9100, new Class[]{l.class}, Void.TYPE).isSupported) { this.f31474g.onFailed(new RuntimeException(lVar.c())); } } @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a public void onSuccess(Object obj) { AliToken aliToken = (AliToken) obj; if (!PatchProxy.proxy(new Object[]{aliToken}, this, changeQuickRedirect, false, 9099, new Class[]{AliToken.class}, Void.TYPE).isSupported) { UploadParams uploadParams = new UploadParams(); ArrayList arrayList = new ArrayList(); for (String str : this.b) { arrayList.add(new c(str, this.f31473c)); } uploadParams.setFiles(arrayList); uploadParams.setToken(new UploadParams.a(aliToken.AccessKeyId, aliToken.AccessKeySecret, aliToken.SecurityToken)); if (this.d) { uploadParams.setBufferPath(this.e); } else { uploadParams.setBufferPath(a.e + this.e); } String str2 = aliToken.cdnHost; if (str2 != null) { String str3 = File.separator; uploadParams.setCdnUrl(str2.endsWith(str3) ? aliToken.cdnHost : f.g(new StringBuilder(), aliToken.cdnHost, str3)); } uploadParams.setBucket("dewu-image"); uploadParams.setEndpoint("http://oss-cn-shanghai.aliyuncs.com"); this.f.callback(uploadParams); } } }