思特奇智慧酒店云平台 v0.0.5版本的 MD5 值为:dedb172bb322639d79d7e0e26262fb5c
以下内容为反编译后的 SignOutActivity.java 源代码,内容仅作参考
package com.sitech.oncon.app.attence;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.sitech.core.util.Log;
import com.sitech.oncon.R;
import com.sitech.oncon.activity.BaseActivity;
import com.sitech.oncon.application.MyApplication;
import com.sitech.oncon.widget.HasImageTextView;
import com.sitech.oncon.widget.HeadRoundImageView;
import java.lang.ref.WeakReference;
import java.util.Calendar;
import java.util.Random;
import java.util.TimeZone;
public class SignOutActivity extends BaseActivity implements qk1 {
public static final int A = 3;
public static final int B = 4;
public static final int C = 6;
public static final int D = 7;
public static final int e0 = 8;
public static final int y = 1;
public static final int z = 2;
public wd1 a;
public HeadRoundImageView c;
public TextView d;
public TextView e;
public HasImageTextView f;
public HasImageTextView g;
public TextView h;
public TextView i;
public TextView j;
public AlertDialog k;
public Thread l;
public ln1 m;
public String n;
public String o;
public String p;
public String q;
public String r;
public String s;
public String t;
public String u;
public String v = "0";
public boolean w = true;
public c x = new c(this);
public class a implements Runnable {
public a() {
}
@Override
public void run() {
while (SignOutActivity.this.w) {
try {
Thread.sleep(30000L);
SignOutActivity.this.x.sendEmptyMessage(4);
} catch (InterruptedException e) {
Log.a(bk0.V5, e.getMessage(), e);
}
}
}
}
public class b implements Runnable {
public b() {
}
@Override
public void run() {
Calendar calendar;
String str;
boolean z;
while ("0".equals(SignOutActivity.this.v) && km0.j(SignOutActivity.this.t)) {
try {
Thread.sleep(2000L);
} catch (Exception unused) {
}
}
if (km0.j(SignOutActivity.this.t) && SignOutActivity.this.m.c()) {
SignOutActivity.this.x.sendEmptyMessage(6);
Message message = new Message();
message.what = 3;
message.obj = new on1();
((on1) message.obj).f = "1";
SignOutActivity.this.x.sendMessage(message);
} else if (!"10000".equals(SignOutActivity.this.n) || !km0.j(SignOutActivity.this.o)) {
SignOutActivity.this.x.sendEmptyMessage(7);
nn1 nn1Var = new nn1();
SignOutActivity signOutActivity = SignOutActivity.this;
nn1Var.a = signOutActivity.n;
nn1Var.b = signOutActivity.o;
Calendar.getInstance().setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
String str2 = calendar.getTimeInMillis() + "";
nn1Var.c = str2;
nn1Var.d = "2";
SignOutActivity signOutActivity2 = SignOutActivity.this;
nn1Var.e = signOutActivity2.t;
nn1Var.f = signOutActivity2.u;
nn1Var.j = signOutActivity2.p;
if (signOutActivity2.m.f()) {
nn1Var.g = kk0.b();
} else {
nn1Var.g = "255.255.255.255";
}
nn1Var.h = kk0.j(SignOutActivity.this);
if (!"10000".equals(SignOutActivity.this.n)) {
str = bk0.p5;
z = false;
SignOutActivity signOutActivity3 = SignOutActivity.this;
nn1Var.i = signOutActivity3.e(signOutActivity3.r, str2 + SignOutActivity.this.n + SignOutActivity.this.p);
} else {
str = bk0.q5;
SignOutActivity signOutActivity4 = SignOutActivity.this;
nn1Var.i = signOutActivity4.e(signOutActivity4.r, str2 + SignOutActivity.this.n + SignOutActivity.this.o);
z = true;
}
hn1 a = new gn1(SignOutActivity.this).a(str, nn1Var, z, SignOutActivity.this.r);
if (a.j()) {
SignOutActivity.this.x.sendEmptyMessage(6);
Message message2 = new Message();
message2.what = 1;
message2.obj = a.e();
SignOutActivity.this.x.sendMessage(message2);
} else {
SignOutActivity.this.x.sendEmptyMessage(6);
Message message3 = new Message();
message3.what = 2;
message3.obj = a.e();
SignOutActivity.this.x.sendMessage(message3);
}
SignOutActivity.this.x.sendEmptyMessage(6);
} else {
SignOutActivity.this.x.sendEmptyMessage(8);
}
}
}
public static class c extends Handler {
public WeakReference<SignOutActivity> a;
public c(SignOutActivity signOutActivity) {
this.a = new WeakReference<>(signOutActivity);
}
@Override
public void handleMessage(Message message) {
on1 on1Var;
SignOutActivity signOutActivity = this.a.get();
try {
switch (message.what) {
case 1:
signOutActivity.j.setEnabled(true);
on1 on1Var2 = (on1) message.obj;
if (on1Var2 != null) {
Intent intent = new Intent(signOutActivity, SignResultActivity.class);
intent.putExtra("isSignIn", false);
intent.putExtra(tg1.g, MyApplication.h().a.y());
if (!km0.j(on1Var2.c)) {
intent.putExtra("planTime", on1Var2.g);
intent.putExtra("signTime", on1Var2.c.length() >= 16 ? on1Var2.c.substring(11, 16) : on1Var2.c);
}
if ("1".equals(on1Var2.f)) {
intent.putExtra("isSuccess", false);
intent.putExtra("failedReason", signOutActivity.getString(R.string.location_error) + signOutActivity.getString(R.string.signout) + "!");
} else {
intent.putExtra("isSuccess", true);
intent.putExtra("signLoc", on1Var2.e);
}
signOutActivity.startActivity(intent);
signOutActivity.finish();
return;
}
return;
case 2:
signOutActivity.j.setEnabled(true);
on1 on1Var3 = (on1) message.obj;
Intent intent2 = new Intent(signOutActivity, SignResultActivity.class);
intent2.putExtra("isSignIn", false);
intent2.putExtra("isSuccess", false);
intent2.putExtra(tg1.g, MyApplication.h().a.y());
if (on1Var3 != null && "1".equals(on1Var3.f)) {
intent2.putExtra("failedReason", signOutActivity.getString(R.string.location_error) + signOutActivity.getString(R.string.signout) + "!");
} else if (on1Var3 != null && "1".equals(on1Var3.d)) {
String str = "";
Object obj = message.obj;
if (obj != null) {
if (!TextUtils.isEmpty(((on1) obj).d)) {
str = ("," + signOutActivity.getString(R.string.errorcode)) + on1Var.d;
}
}
intent2.putExtra("failedReason", signOutActivity.getString(R.string.signout) + signOutActivity.getString(R.string.fail) + str);
} else {
intent2.putExtra("failedReason", signOutActivity.getString(R.string.signout_network_error));
}
signOutActivity.startActivity(intent2);
signOutActivity.finish();
return;
case 3:
signOutActivity.j.setEnabled(true);
Intent intent3 = new Intent(signOutActivity, SignResultActivity.class);
intent3.putExtra("isSignIn", false);
intent3.putExtra("isSuccess", false);
intent3.putExtra(tg1.g, MyApplication.h().a.y());
intent3.putExtra("failedReason", signOutActivity.getString(R.string.signout_loc_error));
signOutActivity.startActivity(intent3);
signOutActivity.finish();
return;
case 4:
signOutActivity.stopLocationListener();
break;
case 5:
default:
case 6:
if (signOutActivity.progressDialog != null && signOutActivity.progressDialog.isShowing()) {
signOutActivity.progressDialog.dismiss();
break;
}
break;
case 7:
signOutActivity.progressDialog.a(signOutActivity.getString(R.string.signOuting));
return;
case 8:
signOutActivity.toastToMessage(R.string.no_enterid_memo);
return;
}
} catch (Exception unused) {
}
}
}
public String e(String str, String str2) {
return jj0.c(str2, str);
}
private void startLocationListener() {
this.v = "0";
this.l = new Thread(new a());
this.l.start();
}
public void stopLocationListener() {
this.v = "1";
this.w = false;
}
public String getRandomNumber() {
return (new Random().nextInt(89) + 10) + "";
}
public void initContentView() {
setContentView(R.layout.signout);
}
public void initController() {
this.a = new qd1(this);
this.m = new ln1(getApplicationContext());
}
public void initViews() {
this.c = (HeadRoundImageView) findViewById(R.id.signout_IV_head);
this.d = (TextView) findViewById(R.id.signout_TV_name);
this.e = (TextView) findViewById(R.id.signout_TV_tel);
this.f = (HasImageTextView) findViewById(R.id.signout_TV_Date);
this.g = (HasImageTextView) findViewById(R.id.signout_TV_Time);
this.h = (TextView) findViewById(R.id.signout_TV_loctitle);
this.i = (TextView) findViewById(R.id.signout_TV_loccontent);
this.j = (TextView) findViewById(R.id.signout_TV_signout);
this.progressDialog.a(getString(R.string.locing));
this.progressDialog.setCancelable(false);
this.k = new cw0(this).create();
}
@Override
public void locFinish(uk1 uk1Var) {
try {
if (uk1Var == null) {
this.x.sendEmptyMessage(4);
} else if (!pk1.b(uk1Var) && !pk1.d(uk1Var)) {
this.x.sendEmptyMessage(4);
} else {
try {
String str = bk0.V5;
Log.a(str, getClass().getName() + ":onReceiveLocation():" + this);
StringBuffer stringBuffer = new StringBuffer(256);
stringBuffer.append("time : ");
stringBuffer.append(uk1Var.p());
stringBuffer.append(",error code : ");
stringBuffer.append(uk1Var.h());
stringBuffer.append(",latitude : ");
stringBuffer.append(uk1Var.g());
stringBuffer.append(",lontitude : ");
stringBuffer.append(uk1Var.j());
stringBuffer.append(",radius : ");
stringBuffer.append(uk1Var.m());
if (pk1.b(uk1Var)) {
stringBuffer.append(",speed : ");
stringBuffer.append(uk1Var.o());
stringBuffer.append(",satellite : ");
stringBuffer.append(uk1Var.n());
} else if (pk1.d(uk1Var)) {
stringBuffer.append(",addr : ");
stringBuffer.append(uk1Var.a());
stringBuffer.append(",addr des : ");
stringBuffer.append(uk1Var.i());
}
stringBuffer.append(",sdk version : ");
stringBuffer.append(pk1.e().a());
String str2 = bk0.V5;
Log.a(str2, "位置信息:" + stringBuffer.toString());
} catch (Exception e) {
Log.a(bk0.V5, e.getMessage(), e);
}
this.t = uk1Var.j() + "";
this.u = uk1Var.g() + "";
this.h.setText(TextUtils.isEmpty(uk1Var.i()) ? getString(R.string.no_address) : uk1Var.i());
this.i.setText(TextUtils.isEmpty(uk1Var.a()) ? getString(R.string.no_address) : uk1Var.a());
this.j.setEnabled(true);
stopLocationListener();
}
} catch (Exception e2) {
Log.a(bk0.V5, e2.getMessage(), e2);
}
}
@Override
public void onClick(View view) {
super.onClick(view);
int id2 = view.getId();
if (id2 == R.id.common_title_TV_left) {
finish();
} else if (id2 == R.id.signout_TV_signout) {
this.j.setEnabled(false);
wp1 wp1Var = this.progressDialog;
if (wp1Var == null || wp1Var.isShowing()) {
return;
}
this.progressDialog.show();
new Thread(new b()).start();
}
}
@Override
public void onCreate(Bundle bundle) {
pg0.a(getApplicationContext(), nj0.P1, (String) null);
super.onCreate(bundle);
initController();
initContentView();
initViews();
setValues();
setListeners();
requestLocPermission();
}
@Override
public void onDestroy() {
pk1.e().a((qk1) this);
super.onDestroy();
}
@Override
public void onPause() {
stopLocationListener();
super.onPause();
}
@Override
public void onResume() {
startLocationListener();
super.onResume();
}
public void setListeners() {
pk1.e().a((String) null, this);
}
public void setValues() {
Bundle extras = getIntent().getExtras();
this.n = extras.getString("enter_code");
this.o = extras.getString(bk0.t9);
this.q = extras.getString("name");
this.r = extras.getString("key");
if (km0.j(this.r)) {
this.r = new mg1(bf1.L().r()).d(this.s);
}
this.p = extras.getString("mobile");
this.e.setText(this.p);
String a2 = ik0.a("-", ":");
this.d.setText(km0.r(this.q));
this.c.setMobile(this.p);
this.f.c(R.drawable.sign_date).b(ik0.h()).a(a2.substring(0, 10));
this.g.c(R.drawable.sign_time).d(R.string.current_time).a(a2.substring(11));
new d().execute(new String[0]);
}
public class d extends AsyncTask<String, Integer, Boolean> {
public d() {
}
@Override
public Boolean doInBackground(String... strArr) {
try {
if (!ln1.k() && !SignOutActivity.this.k.isShowing()) {
return true;
}
} catch (Exception e) {
Log.a(bk0.V5, e.getMessage(), e);
}
return false;
}
@Override
public void onProgressUpdate(Integer... numArr) {
}
@Override
public void onPostExecute(Boolean bool) {
if (bool.booleanValue()) {
try {
SignOutActivity.this.k.show();
} catch (Exception e) {
Log.a(bk0.V5, e.getMessage(), e);
}
}
}
}
}