正在查看: Housing v14.7.8 应用的 i0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Housing v14.7.8 应用的 i0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package io.branch.referral;
import android.content.Context;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.instrumentation.JSONObjectInstrumentation;
import io.branch.referral.f;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Collection;
import org.json.JSONException;
import org.json.JSONObject;
@Instrumented
class i0 extends h0 {
private static final String DEF_BASE_URL = "https://bnc.lt/a/";
private f.a callback_;
private boolean defaultToLongUrl_;
private boolean isAsync_;
private k linkPost_;
public i0(Context context, String str, int i, int i2, Collection<String> collection, String str2, String str3, String str4, String str5, JSONObject jSONObject, f.a aVar, boolean z, boolean z2) {
super(context, b0.GetURL);
this.callback_ = aVar;
this.isAsync_ = z;
this.defaultToLongUrl_ = z2;
this.linkPost_ = new k();
try {
if (!this.prefHelper_.q("bnc_link_click_id").equals(f0.NO_STRING_VALUE)) {
this.linkPost_.put(y.LinkClickID.getKey(), this.prefHelper_.q("bnc_link_click_id"));
}
this.linkPost_.r(i);
this.linkPost_.m(i2);
this.linkPost_.q(collection);
this.linkPost_.j(str);
this.linkPost_.l(str2);
this.linkPost_.n(str3);
this.linkPost_.p(str4);
this.linkPost_.k(str5);
this.linkPost_.o(jSONObject);
k kVar = this.linkPost_;
kVar.getClass();
kVar.put("source", y.URLSource.getKey());
p(this.linkPost_);
this.linkPost_.remove("anon_id");
this.linkPost_.remove("is_hardware_id_real");
this.linkPost_.remove("hardware_id");
} catch (JSONException e) {
com.quickblox.videochat.webrtc.b.C(e, new StringBuilder("Caught JSONException "));
this.constructError_ = true;
}
}
public final void A(String str) {
f.a aVar = this.callback_;
if (aVar != null) {
aVar.a(str, null);
}
}
@Override
public final void g(int i, String str) {
if (this.callback_ != null) {
this.callback_.a(this.defaultToLongUrl_ ? v() : null, new i(a.l("Trouble creating a URL. ", str), i));
}
}
@Override
public final void l(r0 r0Var, f fVar) {
try {
String string = r0Var.b().getString("url");
f.a aVar = this.callback_;
if (aVar != null) {
aVar.a(string, null);
}
} catch (Exception e) {
l.b("Caught Exception ServerRequestCreateUrl onRequestSucceeded: " + e.getMessage() + " stacktrace: " + l.h(e));
}
}
public final String t(String str) {
try {
if (f.u().D() && !str.contains(DEF_BASE_URL)) {
str = str.replace(new URL(str).getQuery(), "");
}
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append(str.contains("?") ? "" : "?");
String sb2 = sb.toString();
StringBuilder sb3 = new StringBuilder();
sb3.append(sb2);
sb3.append(sb2.endsWith("?") ? "" : "&");
String sb4 = sb3.toString();
Collection<String> h = this.linkPost_.h();
if (h != null) {
for (String str2 : h) {
if (str2 != null && str2.length() > 0) {
sb4 = sb4 + z.Tags + "=" + URLEncoder.encode(str2, "UTF8") + "&";
}
}
}
String a = this.linkPost_.a();
if (a != null && a.length() > 0) {
sb4 = sb4 + z.Alias + "=" + URLEncoder.encode(a, "UTF8") + "&";
}
String c = this.linkPost_.c();
if (c != null && c.length() > 0) {
sb4 = sb4 + z.Channel + "=" + URLEncoder.encode(c, "UTF8") + "&";
}
String e = this.linkPost_.e();
if (e != null && e.length() > 0) {
sb4 = sb4 + z.Feature + "=" + URLEncoder.encode(e, "UTF8") + "&";
}
String g = this.linkPost_.g();
if (g != null && g.length() > 0) {
sb4 = sb4 + z.Stage + "=" + URLEncoder.encode(g, "UTF8") + "&";
}
String b = this.linkPost_.b();
if (b != null && b.length() > 0) {
sb4 = sb4 + z.Campaign + "=" + URLEncoder.encode(b, "UTF8") + "&";
}
String str3 = ((sb4 + z.Type + "=" + this.linkPost_.i() + "&") + z.Duration + "=" + this.linkPost_.d()) + "&source=" + y.URLSource.getKey();
JSONObject f = this.linkPost_.f();
if (f == null || f.length() <= 0) {
return str3;
}
return str3 + "&data=" + URLEncoder.encode(b.a(JSONObjectInstrumentation.toString(f).getBytes()), "UTF8");
} catch (Exception e2) {
l.b("Caught Exception ServerRequestCreateUrl generateLongUrlWithParams: " + e2.getMessage() + " stacktrace: " + l.h(e2));
this.callback_.a(null, new i("Trouble creating a URL.", i.ERR_BRANCH_INVALID_REQUEST));
return str;
}
}
public final k u() {
return this.linkPost_;
}
public final String v() {
if (!this.prefHelper_.q("bnc_user_url").equals(f0.NO_STRING_VALUE)) {
return t(this.prefHelper_.q("bnc_user_url"));
}
return t(DEF_BASE_URL + this.prefHelper_.q("bnc_branch_key"));
}
public final void w() {
f.a aVar = this.callback_;
if (aVar != null) {
aVar.a(null, new i("Trouble creating a URL.", i.ERR_BRANCH_DUPLICATE_URL));
}
}
public final boolean x(Context context) {
int checkCallingOrSelfPermission = context.checkCallingOrSelfPermission("android.permission.INTERNET");
if (checkCallingOrSelfPermission != 0) {
l.i("Trouble executing your request. Please add 'android.permission.INTERNET' in your applications manifest file");
}
if (checkCallingOrSelfPermission == 0) {
return false;
}
f.a aVar = this.callback_;
if (aVar == null) {
return true;
}
aVar.a(null, new i("Trouble creating a URL.", i.ERR_NO_INTERNET_PERMISSION));
return true;
}
public final boolean y() {
return this.isAsync_;
}
public final boolean z() {
return this.defaultToLongUrl_;
}
public i0(b0 b0Var, JSONObject jSONObject, Context context) {
super(b0Var, jSONObject, context);
this.isAsync_ = true;
this.defaultToLongUrl_ = true;
}
}