// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.oliodevices.assist.app; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; import com.olio.util.ALog; import com.oliodevices.assist.app.api.UserManager; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.lang.ref.WeakReference; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.StatusLine; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; public class EulaActivity extends AppCompatActivity { class RequestTask extends AsyncTask { private final WeakReference activityWeakReference; final EulaActivity this$0; protected volatile Object doInBackground(Object aobj[]) { return doInBackground((String[])aobj); } protected transient String doInBackground(String as[]) { String s; Object obj; Object obj1; obj1 = new DefaultHttpClient(); obj = null; s = obj; as = ((HttpClient) (obj1)).execute(new HttpGet(as[0])); s = obj; obj1 = as.getStatusLine(); s = obj; if (((StatusLine) (obj1)).getStatusCode() != 200) { break MISSING_BLOCK_LABEL_99; } s = obj; obj1 = new ByteArrayOutputStream(); s = obj; as.getEntity().writeTo(((java.io.OutputStream) (obj1))); s = obj; as = ((ByteArrayOutputStream) (obj1)).toString(); s = as; ((ByteArrayOutputStream) (obj1)).close(); return as; s = obj; as.getEntity().getContent().close(); s = obj; try { throw new IOException(((StatusLine) (obj1)).getReasonPhrase()); } // Misplaced declaration of an exception variable catch (String as[]) { ALog.e("An error occurred loading EULA", as, new Object[0]); } return s; } protected volatile void onPostExecute(Object obj) { onPostExecute((String)obj); } protected void onPostExecute(String s) { super.onPostExecute(s); if (s != null && !s.isEmpty()) { setErrorStateVisible(false); s = String.format("
%s", new Object[] { s }); EulaActivity eulaactivity = (EulaActivity)activityWeakReference.get(); if (eulaactivity != null) { eulaactivity.mEulaTextview.setText(Html.fromHtml(s)); eulaactivity.mEulaTextview.setMovementMethod(LinkMovementMethod.getInstance()); } mAgreeButton.setEnabled(true); return; } else { setErrorStateVisible(true); return; } } public RequestTask(EulaActivity eulaactivity1) { this$0 = EulaActivity.this; super(); activityWeakReference = new WeakReference(eulaactivity1); } } private static final String EULA_URL = "https://www.oliodevices.com/EULA_FORM"; public static final int REQUEST_CODE = 1; public static final int RESULT_CODE_AGREE = 1; public static final int RESULT_CODE_DISAGREE = 2; private Button mAgreeButton; private TextView mEulaTextview; private LinearLayout mLoadingErrorView; public EulaActivity() { } private void agreeButtonTapped() { setResult(1); UserManager.getInstance().updateUserAgreementAccepted(true); finish(); } private void disagreeButtonTapped() { setResult(2); UserManager.getInstance().updateUserAgreementAccepted(false); finish(); } private void setErrorStateVisible(boolean flag) { if (flag) { mLoadingErrorView.setVisibility(0); mEulaTextview.setVisibility(4); return; } else { mLoadingErrorView.setVisibility(4); mEulaTextview.setVisibility(0); return; } } protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(0x7f03001a); mEulaTextview = (TextView)findViewById(0x7f0d0061); ((Button)findViewById(0x7f0d005e)).setOnClickListener(new android.view.View.OnClickListener() { final EulaActivity this$0; public void onClick(View view) { disagreeButtonTapped(); } { this$0 = EulaActivity.this; super(); } }); mAgreeButton = (Button)findViewById(0x7f0d005f); mAgreeButton.setOnClickListener(new android.view.View.OnClickListener() { final EulaActivity this$0; public void onClick(View view) { agreeButtonTapped(); } { this$0 = EulaActivity.this; super(); } }); mAgreeButton.setEnabled(false); mLoadingErrorView = (LinearLayout)findViewById(0x7f0d0062); ((Button)findViewById(0x7f0d0063)).setOnClickListener(new android.view.View.OnClickListener() { final EulaActivity this$0; public void onClick(View view) { (new RequestTask(EulaActivity.this)).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[] { "https://www.oliodevices.com/EULA_FORM" }); } { this$0 = EulaActivity.this; super(); } }); setErrorStateVisible(false); (new RequestTask(this)).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[] { "https://www.oliodevices.com/EULA_FORM" }); } }