Mifare Classic & Ultralight Extension

@Marco_Perrone I have downloaded your aia version from the post written on May 21. After building it and loading the APK it doesnt want to install with a message "App not installed as package appears to be invalid". I have tried a few versions and I have tried resetting the phone. Other builds work. Could it be that some permissions in the new SDK or something else changed in the meantime?

Hi @duv, I have the same project installed in my smartphone and works without problem.
I just compiled and tried again on my smartphone without problem (it always the same project)
Sorry I am not authorized to upload APK.
Maybe a problem with the Android version? My Android is 10.
Best Regards
Marco

Hi @Marco_Perrone Thanks for the quick replay and for testing. It seems that it is an android version problem. I am running 13 and according to the internet this is a likely problem. It seems like some permissions are missing in the APK file but I dont know anything about android programming to figure out what needs to be changed

Hi @Marco_Perrone, your extension is excellent, we use it for a lot of phone authentication but it doesn't seem to work with phones on Android 12 and up. I have tried everything recommended by AI2 Stuff (for example: android:exported="true" to the Manifest) and I can't install APK to the phone and can't upload AAB to the Google Play store. Do you plan on fixing this issue to work with Android 12 and up?

Thank You @Leppke,
the main problem is I don't have an Android 12 device at this moment so I cannot reply the issue.
I cannot tell You when, but when I will have an Android 12 or 13 device I will check.
Sorry I understand that this is not the answer that You want, but I will try to solve in the next future.
Best Regards
Marco

Hi @Leppke,
Do You have the same problem with my Project Test? This is to understand if the problem is related to my extension or something else in your app that I don't know.
Thank You
Marco

Hi @Marco_Perrone,
Thank you for your reply. We only use the getuid block of your extension and if I try without it, it works. When I try to upload the AAB Bundle with your extension to the Google Play Console, I get an error message which directs me to this website to fix the issue: Behavior changes: Apps targeting Android 12  |  Android Developers. You could try testing your extension on the Google Play Console or try an Android 12+ emulator.
Thank you

Hi,
I also tried to update my app bud when I install the build on my Andoid 13 phone I get the error:

The Application wasn't installed, because the whole package looks unproperly

If I get a older build it installs fine, bud if I build it today I get the error. I deleted the Mifare Extension and then it installs again. I also tried the MifareInfo.aia bud it haves the same problem.

The culprit is probably to do with the SDK version used by appinventor as mentioned here: Application is OK, but I can't install it (APK) on my (Android13) smartphone - #25 by ewpatton

Could you have a look to fix you’re amazing extension so it is usable again on android 13?

Have a great day!
Greetings,
Sander

If you want a “quick” fix, I got it working. You have to add android:exported="true" to the AndroidManifest.xml like said here: Android 12 changes - #2 by Anke

I did this the following way:

  1. Build and download your APK to your PC.

  2. Download and open the program APK editor studio: APK Editor for PC and Mac – APK Editor Studio

  3. In APK editor open your APK file.

  4. In the left screen select the tab “File System”.

  5. Click on “AndroidManifest.xml”

  6. In my case, add android:exported="true" to the line
    <activity android:launchMode="singleTask" android:name=".Screen1">
    so you get:
    <activity android:launchMode="singleTask" android:exported="true" android:name=".Screen1">

  7. In the top-bar click “save-APK”.

  8. Now try it out if it works.

Thit works for me, hope it helps.

Thank You @Sander_V,
I sent a message to @Leppke yesterday where I suggest to modify the manifest like this:
<activity android:launchMode="singleTask" android:name=".Screen1" android:exported="false">
I was waiting an answer before to write here but now you confirm that solve the problem.

Thank You for your tip

Ciao
Marco

Hi @duv @Leppke and @Sander_V ,
I just added the android:exported="true" in the extension , so You don't need to change the manifest.
Please download and try if your app works correctly.
mifare.info.aix (21.9 KB)

Ciao
Marco

1 Like

It works, thank you very much!

1 Like

Hi @Marco_Perrone, Sorry for the late reply, I have been on holiday. Your extension is great! It works fine! Thank you very much!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Hello everyone,

I use the @Marco_Perrone extension for Mifare classic tags Mifare Classic & Ultralight Extension - Extensions - MIT App Inventor Community.

For my app I need to read multiple blocks in a row, without rescanning the tag. I tried several solutions like switching off and on read mode or hotswapping block-to-read id
image

If you have an idea of a solution it could save me a lot of time. I also searched for the extension source code to add those functionalities but in vain.

Hi @lieutenant_X,
I attach a sample that should help You to solve your problem.
I used a Clock to Read a MifareClassicBlock and everytime the clock is fired I add 1 to the variable Block to read the next Mifare block
Ciao
Marco
MifareReadWrite.aia (24.1 KB)

Thanks a lot, it works pretty well. Do you have a solution too to read a tag what triggered the app opening ? (if the app is set as the default one for Mifare tags, it opens automatically when one of them is detected by the phone).

Ciao @lieutenant_X, the extension when a tag is approched use the TAG_DISCOVERED action that is the lowest level to detect a tag, I was able to develop only this method.
To do what You need I have to develop TECH_DISCOVERED, I tried but with no success.

Ciao
Marco

The extension works well, but it lacks a block to detect whether an NFC card is currently in place. Any solution for that condition.