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