nfc-uid-emulator icon indicating copy to clipboard operation
nfc-uid-emulator copied to clipboard

Application crashed

Open HexRabbit opened this issue 7 years ago • 6 comments

I'm using Android Pie, after switching to newly created UID, app crashed. Does it require root permission?

HexRabbit avatar Oct 16 '18 22:10 HexRabbit

Yes, it requires root permission to modify NFC configuration.

0140454 avatar Oct 17 '18 03:10 0140454

@HexRabbit Could you provide logcat output for debugging?

0140454 avatar Oct 18 '18 04:10 0140454

Sure. It looks like a permission problem.

10-18 13:24:07.085 W/i       (29582): Cannot obtain root
10-18 13:24:07.085 W/i       (29582): java.io.IOException: Cannot run program "su": error=13, Permission denied
10-18 13:24:07.085 W/i       (29582): 	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)
10-18 13:24:07.085 W/i       (29582): 	at java.lang.Runtime.exec(Runtime.java:695)
10-18 13:24:07.085 W/i       (29582): 	at java.lang.Runtime.exec(Runtime.java:525)
10-18 13:24:07.085 W/i       (29582): 	at java.lang.Runtime.exec(Runtime.java:422)
10-18 13:24:07.085 W/i       (29582): 	at com.pluscubed.logcat.d.i.a(SuperUserHelper.java:199)
10-18 13:24:07.085 W/i       (29582): 	at com.pluscubed.logcat.d.j$a$6.a(UpdateHelper.java:1096)
10-18 13:24:07.085 W/i       (29582): 	at com.pluscubed.logcat.ui.LogcatActivity$23.doInBackground(LogcatActivity.java:3031)
10-18 13:24:07.085 W/i       (29582): 	at android.os.AsyncTask$2.call(AsyncTask.java:333)
10-18 13:24:07.085 W/i       (29582): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-18 13:24:07.085 W/i       (29582): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
10-18 13:24:07.085 W/i       (29582): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
10-18 13:24:07.085 W/i       (29582): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-18 13:24:07.085 W/i       (29582): 	at java.lang.Thread.run(Thread.java:764)
10-18 13:24:07.085 W/i       (29582): Caused by: java.io.IOException: error=13, Permission denied
10-18 13:24:07.085 W/i       (29582): 	at java.lang.UNIXProcess.forkAndExec(Native Method)
10-18 13:24:07.085 W/i       (29582): 	at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)
10-18 13:24:07.085 W/i       (29582): 	at java.lang.ProcessImpl.start(ProcessImpl.java:132)
10-18 13:24:07.085 W/i       (29582): 	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

HexRabbit avatar Oct 18 '18 05:10 HexRabbit

@HexRabbit

I think your logcat output may be not about this app. It seems to be generated by the app whose package name is com.pluscubed.logcat.*. Could you check it again?

So, I just wrap code related to root with try/catch to avoid crash now.

0140454 avatar Nov 07 '18 15:11 0140454

It compiles and everything but crash when i open the app. It doesn't show up any permission or root access, just crashes. This is the log that android studio leaves:

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.phwu.nfcuidemulator, PID: 13624 java.lang.ExceptionInInitializerError at com.phwu.nfcuidemulator.NfcHelper.(NfcHelper.kt:16) at com.phwu.nfcuidemulator.MainActivity.onCreate(MainActivity.kt:37) at android.app.Activity.performCreate(Activity.java:6977) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6816) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451) Caused by: java.util.NoSuchElementException: Sequence is empty. at kotlin.sequences.SequencesKt___SequencesKt.single(_Sequences.kt:277) at com.phwu.nfcuidemulator.NfcConfig.getConfigPath(NfcConfig.kt:106) at com.phwu.nfcuidemulator.NfcConfig.(NfcConfig.kt:8) at com.phwu.nfcuidemulator.NfcHelper.(NfcHelper.kt:16)  at com.phwu.nfcuidemulator.MainActivity.onCreate(MainActivity.kt:37)  at android.app.Activity.performCreate(Activity.java:6977)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)  at android.app.ActivityThread.-wrap14(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6816)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)  Application terminated.

I put in bold the part of the log thats shows were the kotlin problem is.

NokisDemox avatar Jan 03 '19 15:01 NokisDemox

@NokisDemox I have no demand for emulating NFC ID currently; therefore, this project have been discontinued.

But I could assist in fixing this problem if you could provide phone model or the output of the following command.

strings $(ls /system/lib*/*nfc*jni*)

0140454 avatar Jan 04 '19 04:01 0140454