正在查看: Minits v4.9.3.32 应用的 XoneSignActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Minits v4.9.3.32 应用的 XoneSignActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.xone.android.framework.activities;
import B0.h;
import C0.b;
import N0.B0;
import N0.I;
import N0.Z;
import ab.AbstractC0399a;
import android.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.gesture.Gesture;
import android.gesture.GestureOverlayView;
import android.gesture.GestureStroke;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import com.xone.android.framework.AbstractC0564f;
import com.xone.android.framework.AbstractC0565g;
import com.xone.android.framework.activities.XoneSignActivity;
import com.xone.android.framework.xoneApp;
import com.xone.android.utils.Utils;
import fb.AbstractC0698k;
import h8.C0738c;
import ha.AbstractC0751f;
import ha.M;
import ha.u;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import m1.a;
import ua.F;
import w8.C1074d;
public final class XoneSignActivity extends Activity implements GestureOverlayView.OnGestureListener, F {
public final C1074d l = new C1074d(this);
public ImageButton m;
public GestureOverlayView n;
public Gesture o;
public Gesture p;
public Bitmap q;
public Bitmap r;
public boolean s;
public int t;
public int u;
public String v;
public AlertDialog w;
public static B0 a(View view, B0 b0) {
b f = b0.f(B0.o.d());
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
marginLayoutParams.topMargin = f.b;
marginLayoutParams.leftMargin = f.a;
marginLayoutParams.bottomMargin = f.d;
marginLayoutParams.rightMargin = f.c;
view.setLayoutParams(marginLayoutParams);
return B0.b;
}
public static void d(GestureOverlayView gestureOverlayView, Gesture gesture) {
}
private Typeface n() {
return h.g(getApplicationContext(), u.a);
}
private AlertDialog o(Throwable th) {
AlertDialog create = XoneBaseActivity.R2(this, th, null, null).create();
create.setOwnerActivity(this);
return create;
}
public static File q(Context context) {
return new File(context.getApplicationContext().getFilesDir(), "gesture.jpg");
}
@Override
public void b(final Throwable th) {
if ((th instanceof C0738c) && xoneApp.Z0().w0()) {
return;
}
th.printStackTrace();
if (c()) {
Utils.l("XOneAndroidFramework", "An exception has happened while the activity was being destroyed");
return;
}
AlertDialog alertDialog = this.w;
if (alertDialog == null || !alertDialog.isShowing()) {
if (!Utils.s3()) {
runOnUiThread(new Runnable() {
@Override
public final void run() {
XoneSignActivity.this.t(th);
}
});
return;
}
AlertDialog o = o(th);
this.w = o;
o.show();
TextView textView = (TextView) this.w.findViewById(R.id.message);
if (textView != null) {
textView.setTypeface(n());
}
}
}
public boolean c() {
return isDestroyed();
}
public final void l(File file) {
FileOutputStream fileOutputStream = new FileOutputStream(file);
try {
this.r.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
Utils.N(fileOutputStream);
} catch (Exception e) {
Utils.N(fileOutputStream);
if (file.delete()) {
Utils.l("XOneAndroidFramework", "XoneSignActivity.dumpToFile(): Rethrowing exception. File " + file.getAbsolutePath() + " was deleted correctly");
} else {
Utils.l("XOneAndroidFramework", "XoneSignActivity.dumpToFile(): Rethrowing exception. File " + file.getAbsolutePath() + " was NOT deleted correctly");
}
throw AbstractC0751f.e(e);
}
}
public final String m() {
if (TextUtils.isEmpty(this.v)) {
return "";
}
File file = new File(this.v);
return (file.exists() && file.isFile()) ? file.getAbsolutePath() : "";
}
@Override
public void onCreate(Bundle bundle) {
Intent intent = getIntent();
String t = AbstractC0698k.t(intent, "screen-orientation", "");
this.t = AbstractC0698k.i(intent, "file-maxwidth", 0);
this.u = AbstractC0698k.i(intent, "file-maxheight", 0);
String t2 = AbstractC0698k.t(intent, "stroke-color", "");
long m = AbstractC0698k.m(intent, "interval", 120000L);
this.v = AbstractC0698k.t(intent, "imgbk", "");
File file = (File) AbstractC0698k.p(intent, "img-save", null);
File file2 = (File) AbstractC0698k.p(intent, "img-delete", null);
AbstractC0399a.m(this, t);
super.onCreate(bundle);
a.b(this).c(this.l, new IntentFilter("com.xone.android.framework.FINISH_ALL_ACTIVITIES_ACTIVITY_ACTION"));
setContentView(AbstractC0565g.C);
this.n = (GestureOverlayView) findViewById(AbstractC0564f.B1);
this.m = (ImageButton) findViewById(AbstractC0564f.C1);
if (file != null) {
this.m.setBackground(Drawable.createFromPath(file.getAbsolutePath()));
}
this.m.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
XoneSignActivity.this.x(view);
}
});
ImageButton imageButton = (ImageButton) findViewById(AbstractC0564f.A1);
if (file2 != null) {
imageButton.setBackground(Drawable.createFromPath(file2.getAbsolutePath()));
}
imageButton.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
XoneSignActivity.this.v(view);
}
});
this.p = null;
if (!TextUtils.isEmpty(t2)) {
this.n.setGestureColor(Color.parseColor(t2));
M.m(this.n, "init", new Object[0]);
}
this.n.setGestureStrokeType(1);
this.n.setFadeOffset(m);
this.n.addOnGestureListener(this);
this.n.addOnGesturePerformedListener(new GestureOverlayView.OnGesturePerformedListener() {
@Override
public final void onGesturePerformed(GestureOverlayView gestureOverlayView, Gesture gesture) {
XoneSignActivity.d(gestureOverlayView, gesture);
}
});
String m2 = m();
if (!TextUtils.isEmpty(m2)) {
this.n.setBackground(Drawable.createFromPath(m2));
}
if (Build.VERSION.SDK_INT >= 35) {
Z.F0(findViewById(R.id.content), new I() {
public final N0.B0 a(View view, N0.B0 b0) {
return XoneSignActivity.a(view, b0);
}
});
}
}
@Override
public void onDestroy() {
try {
a.b(this).e(this.l);
} catch (IllegalArgumentException unused) {
}
AlertDialog alertDialog = this.w;
if (alertDialog != null) {
try {
if (alertDialog.isShowing()) {
this.w.dismiss();
}
} catch (Exception e) {
e.printStackTrace();
}
}
super.onDestroy();
}
@Override
public void onGesture(GestureOverlayView gestureOverlayView, MotionEvent motionEvent) {
}
@Override
public void onGestureCancelled(GestureOverlayView gestureOverlayView, MotionEvent motionEvent) {
}
@Override
public void onGestureEnded(GestureOverlayView gestureOverlayView, MotionEvent motionEvent) {
this.o = gestureOverlayView.getGesture();
if (this.p == null) {
this.p = new Gesture();
}
for (int i = 0; i < this.o.getStrokesCount(); i++) {
this.p.addStroke(this.o.getStrokes().get(i));
}
this.m.setEnabled(true);
}
@Override
public void onGestureStarted(GestureOverlayView gestureOverlayView, MotionEvent motionEvent) {
this.s = true;
this.m.setEnabled(false);
this.o = null;
}
public final File p() {
return q(getApplicationContext());
}
public final void t(Throwable th) {
if (c()) {
Utils.l("XOneAndroidFramework", "An exception has happened while the activity was being destroyed");
return;
}
AlertDialog o = o(th);
this.w = o;
o.show();
TextView textView = (TextView) this.w.findViewById(R.id.message);
if (textView != null) {
textView.setTypeface(n());
}
}
public final void v(View view) {
ArrayList<GestureStroke> strokes;
try {
GestureOverlayView gestureOverlayView = this.n;
if (gestureOverlayView != null) {
gestureOverlayView.cancelClearAnimation();
this.n.clear(true);
this.s = false;
}
Gesture gesture = this.o;
if (gesture == null || (strokes = gesture.getStrokes()) == null) {
return;
}
strokes.clear();
} catch (Exception e) {
b(e);
}
}
public final void x(View view) {
try {
if (this.s) {
y();
}
finish();
} catch (Exception e) {
b(e);
}
}
public final void y() {
File p = p();
try {
int width = (int) this.o.getBoundingBox().width();
int height = (int) this.o.getBoundingBox().height();
if (this.t == 0) {
this.t = width;
}
if (this.u == 0) {
this.u = height;
}
if (this.t > 0 && this.u > 0) {
if (TextUtils.isEmpty(m())) {
Bitmap bitmap = this.o.toBitmap(this.t, this.u, 8, Color.parseColor("#FF000000"));
this.q = bitmap;
this.r = Bitmap.createBitmap(this.t, this.u, bitmap.getConfig());
Canvas canvas = new Canvas(this.r);
canvas.drawColor(-1);
canvas.drawBitmap(this.q, 0.0f, 0.0f, (Paint) null);
l(p);
} else {
Utils.m4(this.n, Bitmap.CompressFormat.JPEG, this.t, this.u, p.getAbsolutePath());
}
Utils.M3(this.q, this.r);
this.q = null;
this.r = null;
}
Utils.M3(this.q, this.r);
this.q = null;
this.r = null;
} catch (Throwable th) {
Utils.M3(this.q, this.r);
this.q = null;
this.r = null;
throw th;
}
}
}