正在查看: Tasker v6.6.3 应用的 SceneActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Tasker v6.6.3 应用的 SceneActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package net.dinglisch.android.taskerm;
import android.app.ActionBar;
import android.app.Activity;
import android.app.FragmentTransaction;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.graphics.Point;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Display;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import com.joaomgcd.taskerm.util.ExtensionsContextKt;
import cyanogenmod.alarmclock.ClockContract;
import net.dinglisch.android.taskerm.MyMapView;
import net.dinglisch.android.taskerm.MyScrollView;
import net.dinglisch.android.taskerm.dh;
import net.dinglisch.android.taskerm.mj;
import net.dinglisch.android.taskerm.qj;
public class SceneActivity extends Activity implements xf.a, ze.e {
private static int F = 16908333;
private boolean r;
private String s;
private Integer t;
private int w;
private int x;
private com.joaomgcd.taskerm.helper.h<SceneActivity> i = new com.joaomgcd.taskerm.helper.h<>(this);
private Handler q = null;
private BroadcastReceiver u = null;
private mj.e v = mj.e.Dialog;
private mj.d y = null;
private mj.d z = null;
private boolean A = false;
private MyScrollView B = null;
private int C = -1;
private int D = -1;
private boolean E = false;
static class a {
static final int[] a;
static {
int[] iArr = new int[mj.e.values().length];
a = iArr;
try {
iArr[mj.e.Dialog.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[mj.e.DialogBlurBehind.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[mj.e.DialogDimBehind.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[mj.e.ActivityFullWindow.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[mj.e.ActivityFullWindowNoTitle.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[mj.e.ActivityFullDisplay.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[mj.e.ActivityFullDisplayNoTitle.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[mj.e.ActivityFullDisplayNoTitleNoNav.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
}
}
class b extends Handler {
b() {
}
@Override
public void handleMessage(Message message) {
if (message.what == 1) {
SceneActivity sceneActivity = SceneActivity.this;
er.k(sceneActivity, sceneActivity.s);
}
}
}
class c implements mj.h {
final mj a;
c(mj mjVar) {
this.a = mjVar;
}
@Override
public void a() {
SceneActivity.this.getActionBar().setTitle(this.a.P1(SceneActivity.this));
}
@Override
public void b() {
SceneActivity sceneActivity = SceneActivity.this;
sceneActivity.w(sceneActivity.getActionBar(), this.a, true);
}
@Override
public void c() {
SceneActivity.this.invalidateOptionsMenu();
}
@Override
public void d() {
SceneActivity.this.getActionBar().setSubtitle(this.a.K1(SceneActivity.this));
}
}
class d implements MyScrollView.a {
d() {
}
@Override
public void a(int i, int i2) {
MyScrollView myScrollView = SceneActivity.this.B;
if (myScrollView == null) {
return;
}
int scrollY = myScrollView.getScrollY();
if (!SceneActivity.this.isFinishing() && (myScrollView.getWidth() == 0 || myScrollView.getHeight() == 0 || SceneActivity.this.C != i || SceneActivity.this.C == -1 || (SceneActivity.this.D < i2 && scrollY == 0 && i2 - SceneActivity.this.D > 100))) {
SceneActivity.this.q(i, i2);
}
SceneActivity.this.C = i;
SceneActivity.this.D = i2;
}
@Override
public void b(int i, int i2, int i3, int i4) {
}
}
class e implements ActionBar.TabListener {
final mj a;
e(mj mjVar) {
this.a = mjVar;
}
@Override
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
if (SceneActivity.this.A) {
this.a.c2(tab.getPosition() + 1, tab.getText().toString());
}
}
@Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
if (SceneActivity.this.A) {
this.a.c2(tab.getPosition() + 1, tab.getText().toString());
}
}
@Override
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
}
}
class f extends Handler {
f() {
}
@Override
public void handleMessage(Message message) {
SceneActivity.this.A = true;
}
}
class g implements dh.b {
g() {
}
@Override
public void a() {
SceneActivity sceneActivity = SceneActivity.this;
dh.a(sceneActivity, sceneActivity.s, true, SceneActivity.this.i.S());
}
}
class h extends BroadcastReceiver {
h() {
}
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String string = intent.getExtras().getString("sn");
if (!SceneActivity.this.s.equals(string)) {
o7.f("SceneActivity", "ignoring " + action + " for " + string + " I'm " + SceneActivity.this.s);
return;
}
if ("net.dinglisch.android.tasker.HS".equals(action)) {
SceneActivity.this.z = mj.d.values()[intent.getIntExtra("exit_anim", mj.d.None.ordinal())];
SceneActivity.this.p("stop_intent");
return;
}
if (!"net.dinglisch.android.tasker.CE".equals(action)) {
if ("net.dinglisch.android.tasker.DE".equals(action)) {
SceneActivity sceneActivity = SceneActivity.this;
fl.u(sceneActivity, sceneActivity.s, intent);
return;
}
o7.f("SceneActivity", "intent action " + action + ", hmm, what to do ?");
return;
}
mj E = fl.E(SceneActivity.this.s);
boolean k2 = E != null ? E.k2(qj.k.MAP) : false;
SceneActivity sceneActivity2 = SceneActivity.this;
qj m = fl.m(sceneActivity2, sceneActivity2.s, intent);
if (m == null || k2 || m.E1() != qj.k.MAP) {
return;
}
u9.d.a(SceneActivity.this);
E.G0(MyMapView.a.Create, null);
E.G0(MyMapView.a.Resume, null);
}
}
class i implements Runnable {
final int i;
final int q;
i(int i, int i2) {
this.i = i;
this.q = i2;
}
@Override
public void run() {
if (SceneActivity.this.B == null) {
o7.f("SceneActivity", "run: null container");
} else {
SceneActivity.this.B.a(this.i, this.q);
}
}
}
class j implements Runnable {
final qj i;
j(qj qjVar) {
this.i = qjVar;
}
@Override
public void run() {
this.i.S2(false, true);
}
}
public static void o(Bundle bundle, mj.e eVar, String str, int i2, int i3, mj.d dVar, boolean z, Integer num) {
bundle.putString("tp", eVar.toString());
bundle.putString("sn", str);
bundle.putInt("ho", i2);
bundle.putInt("vo", i3);
bundle.putBoolean("ok", z);
bundle.putInt("enter_anim", dVar.ordinal());
bundle.putInt("stid", num.intValue());
}
public void p(String str) {
BroadcastReceiver broadcastReceiver = this.u;
if (broadcastReceiver != null) {
unregisterReceiver(broadcastReceiver);
this.u = null;
}
fl.I(this, this.s);
if (!isFinishing()) {
finish();
if (this.z == null) {
this.z = mj.e0;
}
mj.d dVar = this.z;
if (dVar != mj.d.System) {
overridePendingTransition(0, mj.h1(dVar));
}
}
if (this.r && !dh.h()) {
if (dh.d(this)) {
dh.c(this, new g());
}
this.r = false;
}
Handler handler = this.q;
if (handler != null) {
handler.removeMessages(1);
this.q = null;
}
o7.f("SceneActivity", "onfinish done");
er.k(this, this.s);
}
public void q(int i2, int i3) {
mj E = fl.E(this.s);
if (E == null) {
o7.f("SceneActivity", "scene not present in manager, already destroyed ?");
return;
}
View currentFocus = getCurrentFocus();
boolean B2 = mj.B2(E.X0());
if (!E.h2()) {
E.t2(i2, i3);
if (!B2) {
Window window = getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
v(window, E, attributes);
window.setAttributes(attributes);
}
}
if (B2 && i2 != i3 && i2 != 0 && i3 != 0) {
boolean z = i2 > i3;
boolean z2 = getResources().getConfiguration().orientation == 2;
if (z != z2) {
o7.f("SceneActivity", "dimension/orientation mismatch " + i2 + "x" + i3 + " dimsland: " + z + " dispLand: " + z2);
return;
}
}
fl.Q(this, E, i2, i3, mj.B2(E.X0()), "handleSizeChange");
E.G0(MyMapView.a.Resume, null);
fl.z0(this, E);
MyScrollView myScrollView = this.B;
if (myScrollView != null) {
myScrollView.post(new Runnable() {
@Override
public final void run() {
SceneActivity.this.r();
}
});
}
if (E.m0(this) || currentFocus == null) {
return;
}
currentFocus.requestFocus();
}
public void r() {
MyScrollView myScrollView = this.B;
if (myScrollView != null) {
myScrollView.requestLayout();
}
}
private void s(Bundle bundle) {
this.y = mj.d.values()[bundle.getInt("enter_anim")];
this.r = bundle.getBoolean("ok");
this.s = bundle.getString("sn");
this.v = mj.e.valueOf(bundle.getString("tp"));
this.w = bundle.getInt("ho");
this.x = bundle.getInt("vo");
this.t = bundle.containsKey("stid") ? Integer.valueOf(bundle.getInt("stid")) : null;
if (mj.F2(this.v)) {
o7.k("SceneActivity", "oops, got an overlay display...");
}
}
private void t(mj mjVar) {
try {
com.joaomgcd.taskerm.util.b7.s6(this, lk.j5(mjVar.W0()), "SceneActivity:setDesiredOrientation");
} catch (Exception e2) {
o7.g("SceneActivity", "setDesiredOrientation", e2);
}
}
private void u(Window window, mj mjVar) {
window.setBackgroundDrawable(new ColorDrawable(mjVar.R0(this)));
}
private void v(Window window, mj mjVar, WindowManager.LayoutParams layoutParams) {
Display x1 = ExtensionsContextKt.x1(this, window);
Point point = new Point();
x1.getSize(point);
o7.f("SceneActivity", "display dim: " + point.x + "," + point.y);
o7.f("SceneActivity", "scene dim: " + mjVar.V1() + "," + mjVar.l1());
layoutParams.gravity = 51;
layoutParams.x = fl.C(point.x, mjVar.V1(), this.w, false);
layoutParams.y = fl.C(point.y, mjVar.l1(), this.x, false);
if (com.joaomgcd.taskerm.util.r.v()) {
layoutParams.softInputMode = 32;
}
layoutParams.width = mjVar.V1() > point.x ? -1 : mjVar.V1();
layoutParams.height = mjVar.l1() <= point.y ? mjVar.l1() : -1;
o7.f("SceneActivity", "set window attrs: w/h " + layoutParams.width + "x" + layoutParams.height);
}
private void x() {
if (this.u == null) {
this.u = new h();
IntentFilter intentFilter = new IntentFilter("net.dinglisch.android.tasker.HS");
intentFilter.addAction("net.dinglisch.android.tasker.SS");
intentFilter.addAction("net.dinglisch.android.tasker.CE");
intentFilter.addAction("net.dinglisch.android.tasker.DE");
ExtensionsContextKt.V3(this, this.u, intentFilter);
}
}
@Override
public void g(com.joaomgcd.taskerm.util.ac acVar, com.joaomgcd.taskerm.util.se seVar) {
}
public uk.n0 getCoroutineScope() {
return super.getCoroutineScope();
}
@Override
public com.joaomgcd.taskerm.helper.j getHelper() {
return this.i;
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
this.D = -1;
mj E = fl.E(this.s);
if (E == null) {
o7.f("SceneActivity", "onConfigChanged: null scene: " + this.s);
return;
}
mj.g w1 = E.w1();
mj.g t0 = E.t0(configuration.orientation);
if (t0 != w1) {
E.R3(uk.X);
}
qj j1 = E.j1();
int V1 = E.V1();
int l1 = E.l1();
E.I0();
E.B3(t0);
if (E.y2()) {
Window window = getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
if (E.h2()) {
v(window, E, attributes);
} else {
attributes.height = -1;
attributes.width = -1;
}
window.setAttributes(attributes);
u(window, E);
}
int V12 = E.V1();
int l12 = E.l1();
MyScrollView myScrollView = this.B;
if (myScrollView != null && V12 == V1 && l12 == l1) {
myScrollView.post(new i(V12, l12));
}
if (j1 == null || !j1.R1()) {
return;
}
j1.J0().postDelayed(new j(j1), 200L);
}
@Override
public void onCreate(Bundle bundle) {
int i2;
boolean z;
int i3;
this.i.g0();
s(bundle == null ? getIntent().getExtras() : bundle);
o7.f("SceneActivity", "onCreate: " + this.s);
o7.A("SceneActivity", "onCreate start");
er.d(this, this.s, false);
mj E = fl.E(this.s);
fl.w0(this.s, this);
if (E == null) {
o7.k("SceneActivity", "onCreate: unknown scene: " + this.s);
super.onCreate(bundle);
finish();
return;
}
E.L3(this.t);
t(E);
b bVar = new b();
this.q = bVar;
bVar.sendEmptyMessageDelayed(1, 38000L);
if (E.k2(qj.k.MAP)) {
u9.d.a(this);
}
if (this.r && !dh.h() && dh.d(this)) {
dh.a(this, this.s, false, this.i.S());
}
int i4 = 1024;
float f2 = 0.0f;
switch (a.a[this.v.ordinal()]) {
case 1:
i2 = 0;
i4 = 0;
z = false;
break;
case 2:
f2 = 0.95f;
i2 = 0;
i4 = 2;
z = false;
break;
case 3:
f2 = 0.7f;
i2 = 0;
i4 = 2;
z = false;
break;
case 4:
case 5:
i2 = 0;
i4 = 0;
z = true;
break;
case ClockContract.InstancesColumns.MISSED_STATE:
case 7:
i2 = 0;
z = true;
break;
case 8:
ExtensionsContextKt.v3(this);
if (mj.S3()) {
i4 = 134219008;
i2 = 4354;
z = true;
break;
} else {
o7.f("SceneActivity", "hiding navigation requires Android 4.4+");
i2 = 0;
z = true;
}
default:
o7.k("SceneActivity", "unknown type: " + this.v);
i2 = 0;
i4 = 0;
z = false;
break;
}
if (this.r && dh.h()) {
i4 |= 524288;
}
E.o3(this.v);
setTheme(E.O1(this));
super.onCreate(bundle);
Window window = getWindow();
mj.e eVar = this.v;
if (eVar == mj.e.ActivityFullDisplay || eVar == mj.e.ActivityFullWindow) {
E.z3(new c(E));
ActionBar actionBar = getActionBar();
int i5 = 8;
if (E.s2()) {
setTitle(E.P1(this));
i3 = 8;
} else {
i3 = 0;
}
if (E.r2()) {
actionBar.setSubtitle(E.K1(this));
} else {
i5 = i3;
}
if (E.l2()) {
i5 |= 2;
Drawable o1 = E.o1(this);
if (o1 != null) {
actionBar.setIcon(o1);
}
} else if (Kid.b(this)) {
i5 |= 2;
}
w(actionBar, E, false);
actionBar.setDisplayOptions(i5);
actionBar.setHomeButtonEnabled(E.m2());
} else {
setTitle(E.getName());
window.requestFeature(1);
}
if (E.E2()) {
o7.k("SceneActivity", "onCreate: scene is overlay: " + this.s);
finish();
return;
}
if (this.y == null) {
this.y = mj.e0;
}
mj.d dVar = this.y;
if (dVar != mj.d.System) {
overridePendingTransition(mj.g1(dVar), 0);
}
E.G0(MyMapView.a.Create, bundle);
E.W3(this);
E.N3(true);
E.D3(getResources().getConfiguration().orientation);
E.y3(this.w, this.x);
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.flags = i4 | 16777216;
attributes.dimAmount = f2;
if (!z) {
v(window, E, attributes);
}
attributes.format = -2;
window.setAttributes(attributes);
u(window, E);
MyScrollView myScrollView = this.B;
if (myScrollView != null) {
MyActivity.c0(myScrollView, false);
}
MyScrollView myScrollView2 = new MyScrollView(this);
this.B = myScrollView2;
if (i2 != 0) {
myScrollView2.setSystemUiVisibility(i2);
}
this.B.setNestingWorkaround(true);
this.B.setScrollBarStyle(33554432);
this.B.setOnChangeCallback(new d());
this.B.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
try {
this.B.addView(E.z1());
} catch (Exception unused) {
o7.G("SceneActivity", "scene parent still used, recreate");
E.Y2(this);
this.B.addView(E.z1());
}
int i6 = attributes.width;
int i7 = attributes.height;
this.B.setId(2131297325);
setContentView(this.B);
attributes.width = i6;
attributes.height = i7;
window.setAttributes(attributes);
o7.f("SceneActivity", "win params now x,y " + attributes.x + "/" + attributes.y + " dims " + attributes.width + "," + attributes.height);
if (E.I2()) {
E.X2();
}
E.N3(true);
x();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
int i2;
Drawable E;
super.onCreateOptionsMenu(menu);
mj E2 = fl.E(this.s);
if (E2 == null || !E2.f2()) {
return true;
}
int i3 = 0;
for (h7 h7Var : E2.M0()) {
boolean n = h7Var.n();
MenuItem add = menu.add(0, F + i3, 0, n ? h7Var.f(this, E2.l()) : "");
if (h7Var.m()) {
net.dinglisch.android.taskerm.g icon = h7Var.getIcon();
if (icon.h0() || !icon.Z()) {
E = icon.E(this);
} else {
int Y = fp.Y(24);
E = icon.F(this, Y, Y);
}
if (E != null) {
add.setIcon(E);
} else {
add.setIcon(2131230944);
}
i2 = n ? 5 : 2;
} else {
i2 = 0;
}
add.setShowAsActionFlags(i2);
i3++;
}
return true;
}
@Override
public void onDestroy() {
super.onDestroy();
p("destroy");
MyScrollView myScrollView = this.B;
if (myScrollView != null) {
myScrollView.removeAllViews();
this.B = null;
}
this.i.h0();
}
@Override
public boolean onKeyDown(int i2, KeyEvent keyEvent) {
int repeatCount = keyEvent.getRepeatCount();
o7.f("SceneActivity", "keydown " + i2 + " rep: " + repeatCount + " ign: " + this.E);
if (repeatCount > 0 && this.E) {
return true;
}
this.E = false;
mj E = fl.E(this.s);
boolean Z1 = E != null ? E.Z1(this, keyEvent) : false;
if (!Z1 && i2 == 4) {
p("back");
Z1 = true;
}
if (!Z1) {
Z1 = super.onKeyDown(i2, keyEvent);
}
o7.f("SceneActivity", "handled: " + Z1);
if (Z1) {
this.E = true;
}
return Z1;
}
@Override
public boolean onKeyLongPress(int i2, KeyEvent keyEvent) {
o7.f("SceneActivity", "keylong " + this.E);
return this.E;
}
@Override
public boolean onKeyMultiple(int i2, int i3, KeyEvent keyEvent) {
o7.f("SceneActivity", "keymulti " + this.E + " " + i3);
return this.E;
}
@Override
public boolean onKeyUp(int i2, KeyEvent keyEvent) {
o7.f("SceneActivity", "keyup " + this.E);
return this.E;
}
@Override
public void onLowMemory() {
super.onLowMemory();
mj E = fl.E(this.s);
if (E != null) {
E.G0(MyMapView.a.LowMemory, null);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
int itemId = menuItem.getItemId();
mj E = fl.E(this.s);
if (E == null) {
return false;
}
if (itemId == 16908332) {
return E.Y1();
}
if (E.f2()) {
return E.X1(this, itemId - F, pp.y(menuItem.getTitle()));
}
return false;
}
@Override
public void onPause() {
super.onPause();
mj E = fl.E(this.s);
if (E != null) {
E.G0(MyMapView.a.Pause, null);
}
}
@Override
public void onRequestPermissionsResult(int i2, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i2, strArr, iArr);
this.i.x1(i2, strArr, iArr);
}
@Override
public void onResume() {
super.onResume();
mj E = fl.E(this.s);
if (E != null) {
E.G0(MyMapView.a.Resume, null);
}
}
@Override
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
o(bundle, this.v, this.s, this.w, this.x, this.y, this.r, this.t);
mj E = fl.E(this.s);
if (E != null) {
E.b2(bundle);
}
}
@Override
public void onStart() {
super.onStart();
fl.x0(this.s, true);
}
@Override
public void onStop() {
super.onStop();
fl.x0(this.s, false);
}
@Override
protected void onUserLeaveHint() {
super.onUserLeaveHint();
if (Kid.b(this)) {
return;
}
p("leave hint");
}
public void w(ActionBar actionBar, mj mjVar, boolean z) {
int i2;
String charSequence = actionBar.getTabCount() > 0 ? actionBar.getSelectedTab().getText().toString() : null;
if (z) {
actionBar.removeAllTabs();
}
String[] N0 = mjVar.N0(this);
int i3 = 0;
if (N0.length > 0) {
this.A = false;
int i4 = 0;
i2 = -1;
for (String str : N0) {
ActionBar.Tab newTab = actionBar.newTab();
newTab.setText(str);
newTab.setTabListener(new e(mjVar));
actionBar.addTab(newTab);
if (str.equals(charSequence)) {
i2 = i4;
}
i4++;
}
new f().sendEmptyMessageDelayed(0, 200L);
i3 = 2;
} else {
i2 = -1;
}
actionBar.setNavigationMode(i3);
if (i2 != -1) {
actionBar.setSelectedNavigationItem(i2);
mjVar.n3(i2);
} else {
int V0 = mjVar.V0();
if (V0 != -1) {
actionBar.setSelectedNavigationItem(V0);
}
}
}
}