正在查看: Pesohere v1.0.5 应用的 g0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Pesohere v1.0.5 应用的 g0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package f.e.c.z;
import android.annotation.SuppressLint;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;
import com.google.android.gms.common.annotation.KeepForSdk;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskCompletionSource;
import com.google.android.gms.tasks.Tasks;
import f.e.c.z.f1;
import java.util.concurrent.ExecutorService;
@SuppressLint({"UnwrappedWakefulBroadcastReceiver"})
public abstract class g0 extends Service {
public static final String TAG = "EnhancedIntentService";
public Binder binder;
public int lastStartId;
public final ExecutorService executor = i0.d();
public final Object lock = new Object();
public int runningTasks = 0;
public class a implements f1.a {
public a() {
}
@Override
@KeepForSdk
public Task<Void> a(Intent intent) {
return g0.this.processIntent(intent);
}
}
private void finishTask(Intent intent) {
if (intent != null) {
e1.b(intent);
}
synchronized (this.lock) {
int i2 = this.runningTasks - 1;
this.runningTasks = i2;
if (i2 == 0) {
stopSelfResultHook(this.lastStartId);
}
}
}
public Task<Void> processIntent(final Intent intent) {
if (handleIntentOnMainThread(intent)) {
return Tasks.forResult(null);
}
final TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
this.executor.execute(new Runnable() {
@Override
public final void run() {
g0.this.b(intent, taskCompletionSource);
}
});
return taskCompletionSource.getTask();
}
public void a(Intent intent, Task task) {
finishTask(intent);
}
public void b(Intent intent, TaskCompletionSource taskCompletionSource) {
try {
handleIntent(intent);
} finally {
taskCompletionSource.setResult(null);
}
}
public abstract Intent getStartCommandIntent(Intent intent);
public abstract void handleIntent(Intent intent);
public boolean handleIntentOnMainThread(Intent intent) {
return false;
}
@Override
public final synchronized IBinder onBind(Intent intent) {
if (Log.isLoggable(TAG, 3)) {
Log.d(TAG, "Service received bind request");
}
if (this.binder == null) {
this.binder = new f1(new a());
}
return this.binder;
}
@Override
public void onDestroy() {
this.executor.shutdown();
super.onDestroy();
}
@Override
public final int onStartCommand(final Intent intent, int i2, int i3) {
synchronized (this.lock) {
this.lastStartId = i3;
this.runningTasks++;
}
Intent startCommandIntent = getStartCommandIntent(intent);
if (startCommandIntent == null) {
finishTask(intent);
return 2;
}
Task<Void> processIntent = processIntent(startCommandIntent);
if (processIntent.isComplete()) {
finishTask(intent);
return 2;
}
processIntent.addOnCompleteListener(y.b, new OnCompleteListener() {
@Override
public final void onComplete(Task task) {
g0.this.a(intent, task);
}
});
return 3;
}
public boolean stopSelfResultHook(int i2) {
return stopSelfResult(i2);
}
}