正在查看: Brevistay v5.8.2 应用的 NfcActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Brevistay v5.8.2 应用的 NfcActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package in.juspay.hypernfc;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.activity.EdgeToEdge;
import androidx.activity.SystemBarStyle;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.Insets;
import androidx.core.view.OnApplyWindowInsetsListener;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.FragmentActivity;
import com.cardreader.card_reader_lib.CardTask;
import java.util.Timer;
import java.util.TimerTask;
import kotlin.Deprecated;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONObject;
@Metadata(d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\f\u001a\u00020\rH\u0017J\u0012\u0010\u000e\u001a\u00020\r2\b\u0010\u000f\u001a\u0004\u0018\u00010\u0010H\u0014J\b\u0010\u0011\u001a\u00020\rH\u0014J\u0010\u0010\u0012\u001a\u00020\r2\u0006\u0010\u0013\u001a\u00020\u0014H\u0014J\b\u0010\u0015\u001a\u00020\rH\u0014J\b\u0010\u0016\u001a\u00020\rH\u0014J\u0010\u0010\u0017\u001a\u00020\r2\u0006\u0010\u0005\u001a\u00020\u0006H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\nX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\nX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0018"}, d2 = {"Lin/juspay/hypernfc/NfcActivity;", "Landroidx/fragment/app/FragmentActivity;", "()V", "cardTask", "Lcom/cardreader/card_reader_lib/CardTask;", "data", "Lorg/json/JSONObject;", "task", "Ljava/util/TimerTask;", "timerForWaitingInActivity", "Ljava/util/Timer;", "timerToReadChangedMessage", "onBackPressed", "", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onNewIntent", "intent", "Landroid/content/Intent;", "onPause", "onResume", "timedOut", "hyper-nfc_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class NfcActivity extends FragmentActivity {
private TimerTask task;
private final JSONObject data = new JSONObject();
private final CardTask cardTask = new CardTask();
private final Timer timerForWaitingInActivity = new Timer();
private final Timer timerToReadChangedMessage = new Timer();
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable$default((ComponentActivity) this, (SystemBarStyle) null, (SystemBarStyle) null, 3, (Object) null);
Bundle extras = getIntent().getExtras();
int i = extras != null ? extras.getInt("waitingTime") : 7000;
setContentView(R.layout.activity_nfc);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(android.R.id.content), new OnApplyWindowInsetsListener() {
public final WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat windowInsetsCompat) {
WindowInsetsCompat onCreate$lambda$0;
onCreate$lambda$0 = NfcActivity.onCreate$lambda$0(view, windowInsetsCompat);
return onCreate$lambda$0;
}
});
View findViewById = findViewById(R.id.backpressImage);
if (findViewById != null) {
findViewById.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NfcActivity.onCreate$lambda$1(NfcActivity.this, view);
}
});
}
final ImageView imageView = (ImageView) findViewById(R.id.backgroundImage);
imageView.post(new Runnable() {
@Override
public final void run() {
NfcActivity.onCreate$lambda$2(NfcActivity.this, imageView);
}
});
NfcActivity$onCreate$4 nfcActivity$onCreate$4 = new NfcActivity$onCreate$4(this);
this.task = nfcActivity$onCreate$4;
this.timerForWaitingInActivity.schedule(nfcActivity$onCreate$4, i);
}
public static final WindowInsetsCompat onCreate$lambda$0(View v, WindowInsetsCompat insets) {
Intrinsics.checkNotNullParameter(v, "v");
Intrinsics.checkNotNullParameter(insets, "insets");
Insets insets2 = insets.getInsets(WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout());
Intrinsics.checkNotNullExpressionValue(insets2, "insets.getInsets(WindowI…pat.Type.displayCutout())");
v.setPadding(insets2.left, insets2.top, insets2.right, insets2.bottom);
return insets;
}
public static final void onCreate$lambda$1(NfcActivity this$0, View view) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.onBackPressed();
}
public static final void onCreate$lambda$2(NfcActivity this$0, ImageView imageView) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
((Wave) this$0.findViewById(R.id.rippleView)).startRippleAnimation(imageView.getTop() + (imageView.getHeight() / 2));
}
public final void timedOut(final JSONObject data) {
((TextView) findViewById(R.id.nfcStatus)).setText(R.string.no_card_detected);
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
Intent intent = new Intent();
intent.putExtra("result_data", data.toString());
this.setResult(0, intent);
this.finish();
}
};
this.task = timerTask;
this.timerToReadChangedMessage.schedule(timerTask, 1500L);
}
protected void onResume() {
super.onResume();
if (this.cardTask.isNFCEnabled((Context) this)) {
this.cardTask.onResumeClone((Activity) this);
}
}
protected void onDestroy() {
super.onDestroy();
try {
TimerTask timerTask = this.task;
if (timerTask != null) {
timerTask.cancel();
}
this.timerForWaitingInActivity.cancel();
this.timerToReadChangedMessage.cancel();
} catch (Exception unused) {
}
}
@Deprecated(message = "Deprecated in Java")
public void onBackPressed() {
setResult(0, new Intent());
finish();
}
protected void onPause() {
super.onPause();
if (this.cardTask.isNFCEnabled((Context) this)) {
this.cardTask.onPauseClone((Activity) this);
}
}
protected void onNewIntent(Intent intent) {
Intrinsics.checkNotNullParameter(intent, "intent");
super.onNewIntent(intent);
try {
String cardDetails = this.cardTask.getCardDetails(intent);
this.data.put("error", (Object) null);
this.data.put("data", cardDetails);
if (cardDetails != null) {
((TextView) findViewById(R.id.nfcStatus)).setText(R.string.scan_successful);
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
JSONObject jSONObject;
Intent intent2 = new Intent();
jSONObject = NfcActivity.this.data;
intent2.putExtra("result_data", jSONObject.toString());
NfcActivity.this.setResult(-1, intent2);
NfcActivity.this.finish();
}
};
this.task = timerTask;
this.timerToReadChangedMessage.schedule(timerTask, 1500L);
return;
}
runOnUiThread(new Runnable() {
@Override
public final void run() {
NfcActivity.onNewIntent$lambda$3(NfcActivity.this);
}
});
((TextView) findViewById(R.id.nfcStatus)).setText(R.string.scan_failed);
TimerTask timerTask2 = new TimerTask() {
@Override
public void run() {
Intent intent2 = new Intent();
intent2.putExtra("result_data", "{\"error\":\"Couldn't read your card ! Try again or type your card number\"}");
NfcActivity.this.setResult(0, intent2);
NfcActivity.this.finish();
}
};
this.task = timerTask2;
this.timerToReadChangedMessage.schedule(timerTask2, 1500L);
} catch (Exception unused) {
Intent intent2 = new Intent();
intent2.putExtra("result_data", "{\"error\":\"Couldn't recognize card ! Try again or type your card number\"}");
setResult(0, intent2);
finish();
}
}
public static final void onNewIntent$lambda$3(NfcActivity this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.findViewById(R.id.backgroundImage).setBackground(ContextCompat.getDrawable(this$0.getApplicationContext(), R.drawable.image_border));
}
}