package com.alibaba.wireless.security.securitybody;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.HandlerThread;
import android.os.Looper;
import android.util.Log;
public class SGLocation {
final class com.alibaba.wireless.security.securitybody.SGLocation$2 implements LocationListener {
com.alibaba.wireless.security.securitybody.SGLocation$2() {
super();
}
public void onLocationChanged(Location arg5) {
if(SGLocation.a()) {
Log.i("SGLocation", "loaction changed");
}
if(arg5 != null) {
if(SGLocation.a()) {
Log.i("SGLocation", "catch loc " + arg5.getLongitude());
}
Object v0 = SGLocation.b();
__monitor_enter(v0);
try {
SGLocation.a(arg5);
SGLocation.b().notify();
__monitor_exit(v0);
return;
label_25:
__monitor_exit(v0);
}
catch(Throwable v5) {
goto label_25;
}
throw v5;
}
}
public void onProviderDisabled(String arg5) {
Object v0 = SGLocation.b();
__monitor_enter(v0);
try {
if(SGLocation.a()) {
Log.i("SGLocation", "loaction disabled " + arg5);
}
SGLocation.b().notify();
__monitor_exit(v0);
return;
label_17:
__monitor_exit(v0);
}
catch(Throwable v5) {
goto label_17;
}
throw v5;
}
public void onProviderEnabled(String arg4) {
if(SGLocation.a()) {
Log.i("SGLocation", "loaction enabled " + arg4);
}
}
public void onStatusChanged(String arg1, int arg2, Bundle arg3) {
}
}
private static Looper a = null;
private static final String b = "SGLocation";
private static Context c = null;
private static Location d = null;
private static Object e = null;
private static LocationManager f = null;
private static boolean g = false;
private static LocationListener h;
static {
SGLocation.e = new Object();
SGLocation.h = new com.alibaba.wireless.security.securitybody.SGLocation$2();
}
public SGLocation() {
super();
}
public static Location SGRequestLocationUpdates(Context arg8, String arg9, long arg10, float arg12) {
Location v0 = null;
if(SGLocation.a != null) {
if(SGLocation.f == null) {
return v0;
}
try {
SGLocation.f.requestLocationUpdates(arg9, arg10, arg12, SGLocation.h, SGLocation.a);
return SGLocation.a(0);
}
catch(Throwable ) {
return v0;
}
}
return v0;
}
private static Location a(int arg5) {
Object v0 = SGLocation.e;
__monitor_enter(v0);
try {
if(SGLocation.g) {
Log.i("SGLocation", "xxxx wait begin");
}
if(SGLocation.f != null) {
goto label_13;
}
}
catch(Throwable v5) {
goto label_28;
}
catch(InterruptedException ) {
goto label_29;
}
Location v5_1 = null;
try {
__monitor_exit(v0);
return v5_1;
try {
label_13:
SGLocation.e.wait(2000);
if(arg5 == 1) {
}
else {
SGLocation.f.removeUpdates(SGLocation.h);
}
if(!SGLocation.g) {
goto label_34;
}
Log.i("SGLocation", "xxxx wait end");
goto label_34;
}
catch(InterruptedException ) {
label_29:
if(arg5 == 1) {
goto label_34;
}
try {
SGLocation.f.removeUpdates(SGLocation.h);
label_34:
__monitor_exit(v0);
return SGLocation.d;
}
catch(Throwable v5) {
label_28:
try {
__monitor_exit(v0);
}
catch(Throwable v5) {
goto label_28;
}
throw v5;
}
}
}
catch(Throwable v5) {
goto label_28;
}
}
static Location a(Location arg0) {
SGLocation.d = arg0;
return arg0;
}
static Looper a(Looper arg0) {
SGLocation.a = arg0;
return arg0;
}
public static void a(Context arg1) {
SGLocation.c();
SGLocation.c = arg1;
try {
SGLocation.f = arg1.getSystemService("location");
return;
}
catch(Throwable ) {
return;
}
}
static boolean a() {
return SGLocation.g;
}
static Object b() {
return SGLocation.e;
}
private static void c() {
new Thread(new Runnable() {
public void run() {
HandlerThread v0 = new HandlerThread("SGL");
v0.start();
SGLocation.a(v0.getLooper());
}
}).start();
}
public static void cancel() {
Object v0 = SGLocation.e;
__monitor_enter(v0);
try {
if(SGLocation.g) {
Log.i("SGLocation", "loaction canceled");
}
SGLocation.e.notify();
__monitor_exit(v0);
return;
label_12:
__monitor_exit(v0);
}
catch(Throwable v1) {
goto label_12;
}
throw v1;
}
public static Location getLocation(Context arg2, String arg3) {
Location v3;
Location v2 = null;
try {
if(SGLocation.f == null) {
return v2;
}
v3 = SGLocation.f.getLastKnownLocation(arg3);
}
catch(Throwable ) {
return v2;
}
try {
if(!SGLocation.g) {
return v3;
}
Log.i("SGLocation", "lastknown loaction " + v3 + ";");
return v3;
}
catch(Throwable ) {
return v3;
}
}
}
__monitor_enter 在这里什么意思?
建议查看源码,而不是通过反编译