[TIMOB-15490] nfc.transceive() crashes app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.1.3 |
Fix Version/s | n/a |
Components | Android |
Labels | SupportTeam |
Reporter | Vic Leitch |
Assignee | Unknown |
Created | 2013-09-26T15:13:30.000+0000 |
Updated | 2018-02-28T20:03:49.000+0000 |
Description
I have successfully been able to connect to a DesFire (IsoDep) card and am able to call all the Tag methods associated with it. However every time I call the transceive() method my app crashes with no error. I have wrapped the transceive() call in a try catch but no exception is caught. Here is my code:
var nfc = require("ti.nfc");
var nfcAdapter = null;
var dispatchFilter = null;
function setupNfc() {
nfcAdapter = nfc.createNfcAdapter({
onTechDiscovered: handleDiscovery
});
if (!nfcAdapter.isEnabled()) {
alert("NFC is not enabled on this device");
return;
}
var act = self.activity;
act.addEventListener("newintent", function(e) {
nfcAdapter.onNewIntent(e.intent);
});
act.addEventListener("resume", function() {
nfcAdapter.enableForegroundDispatch(dispatchFilter);
});
act.addEventListener("pause", function() {
nfcAdapter.disableForegroundDispatch();
});
dispatchFilter = nfc.createNfcForegroundDispatchFilter({
intentFilters: [ {
action: nfc.ACTION_TECH_DISCOVERED
} ],
techLists: [ ["android.nfc.tech.IsoDep"], [ "android.nfc.tech.NfcA" ] ]
});
};
function handleDiscovery(e) {
var tech = nfc.createTagTechnologyIsoDep({
tag:e.tag
});
tech.connect();
if (tech.isConnected()) {
var command = Ti.createBuffer({length:260});
var response = Ti.createBuffer({length:260});
if (tech.isValid())
{
Ti.API.debug("isValid");
}
response = tech.getHistoricalBytes();
Ti.API.debug("historical bytes : " + response.toString());
var max = tech.getMaxTransceiveLength();
Ti.API.debug("MAX:" + max.toString());
Ti.API.debug(JSON.stringify(tech.getTag()));
tech.setTimeout(1000);
Ti.API.debug(JSON.stringify(tech.getTimeout()));
command = [0x00,0xa4,0x04,0x00,0x03,0xff,0xff,0xff];
//command = [0x90,0x60,0x00,0x00,0x00];
//command = [0x5a,0xff,0xff,0xff];
try {
response = tech.transceive(command);
Ti.API.debug(response);
}
catch(e) {
Ti.API.debug(e.message);
}
tech.close();
}
};
self.addEventListener('open', function(e) {
//setup NFC Adapter
setupNfc();
});
It doesn't matter what command I send, the app always crashes when the tech.transceive(command) is called!
Attachments
File | Date | Size |
---|---|---|
app.js | 2013-09-30T11:24:30.000+0000 | 3859 |
tiapp.xml | 2013-09-30T11:24:30.000+0000 | 2450 |
Hello Vic Leitch, Can you please posting few test cases for this issue? Thanks
Code (Titanium) as above running in main window on device (Samsung Galaxy Note 2). Device connected via USB. Tap IsoDep (DesFire) card on device. Watch for debug messages in console. All nfc commands executed successfully except nfc.transceive() - this command causes application to auto relaunch. No exception is caught in the try catch. I tried various different commands but app still crashes at the same point. The card also supports NfcA so I changed the createTagTechnology to NfcA from IsoDep. The result was the same - the app crashed when calling nfc.transceive(). Let me know if you want me to test anything else, thanks.
[~vicleitch] please provide a fully functional piece of code, the code that you provided can not be used inside of a simple application. Thanks
Files added, thanks.
[~vicleitch] Please provide steps to reproduce the issue, and in the code that you attached, you are trying to set properties for the actionBar, but it's readonly, here is the [documentation](http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Android.Activity-property-actionBar)
I'm setting properties of the actionBar as per documentation and example here http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Android.ActionBar The steps to reproduce the issue are described in a previous comment but here they are again: 1. run application on an NFC enabled device - I'm using Samsung galaxy Note 2 2. tap DesFire (ISoDep) card on device 3. app text area will show progress 4. app will crash and relaunch when call to nfc.transceive() is made. Thanks Vic
This issue is critical to my app so please can you let me know if any progress has been made. Many thanks.
Sorry to be persistent on this but I have a deadline for the app to be released at the end of October and need to get NFC DesFire(IsoDep) working. I am happy to help with testing if you let me know what to try. I have tried another test case but still the app crashes when calling nfc.transceive(). Please let me know if this is being investigated or not. If not I can then either move away from Titanium and write in native Android or try and develop my own nfc module (however this may have the same problem.) Obviously this will mean me not meeting my target release date. Please let me know either way. Thanks and kind regards Vic TEST CASE =========
I have managed to get "Debug on Device" mode working in Titanium and have captured the log data. I really hope this helps. Let me know if you need anything else. Thanks {noformat} [INFO][DEBUG ( 1923)] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** [INFO][DEBUG ( 1923)] Build fingerprint: 'samsung/t03gxx/t03g:4.1.2/JZO54K/N7100XXDME6:user/release-keys' [INFO][DEBUG ( 1923)] pid: 2498, tid: 2573, name: KrollRuntimeThr >>> uk.co.scotcomms.nfcisodeptest <<< [INFO][DEBUG ( 1923)] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000a [INFO][DEBUG ( 1923)] r0 00000000 r1 00000004 r2 41f7b228 r3 572c72f0 [INFO][DEBUG ( 1923)] r4 5d6f9248 r5 41052e70 r6 571f24e0 r7 0000106e [INFO][DEBUG ( 1923)] r8 40855040 r9 41f7b228 sl 41052e58 fp 5d75c4f8 [INFO][DEBUG ( 1923)] ip 00000004 sp 5daef7f8 lr 408598c0 pc 4085e1f8 cpsr 00000010 [INFO][DEBUG ( 1923)] d0 3fe6a09e667f3bcd d1 3ff6a09e667f3bcd [INFO][DEBUG ( 1923)] d2 0000000100000001 d3 000f4240003d0900 [INFO][DEBUG ( 1923)] d4 0000000000000001 d5 3ff0000000000000 [INFO][DEBUG ( 1923)] d6 0000860300000000 d7 000000ff00000000 [INFO][DEBUG ( 1923)] d8 0000000000000000 d9 0000000000000000 [INFO][DEBUG ( 1923)] d10 0000000000000000 d11 0000000000000000 [INFO][DEBUG ( 1923)] d12 0000000000000000 d13 0000000000000000 [INFO][DEBUG ( 1923)] d14 0000000000000000 d15 0000000000000000 [INFO][DEBUG ( 1923)] d16 4074400000000000 d17 7e37e43c8800759c [INFO][DEBUG ( 1923)] d18 0000000000004001 d19 0000000000000000 [INFO][DEBUG ( 1923)] d20 4008000000000000 d21 3fbc71c71c71c71c [INFO][DEBUG ( 1923)] d22 3fcc7288e957b53b d23 3fd24998d6307188 [INFO][DEBUG ( 1923)] d24 3fd99a27ad32ddf5 d25 3fe555b0aaeac752 [INFO][DEBUG ( 1923)] d26 0000000000000000 d27 0000000000000000 [INFO][DEBUG ( 1923)] d28 0000000000000005 d29 0000000000000000 [INFO][DEBUG ( 1923)] d30 0000000000000000 d31 0000000000000000 [INFO][DEBUG ( 1923)] scr 60000013 [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] backtrace: [INFO][DEBUG ( 1923)] #00 pc 000271f8 /system/lib/libdvm.so [INFO][DEBUG ( 1923)] #01 pc 0002bbe8 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180) [INFO][DEBUG ( 1923)] #02 pc 0005f743 /system/lib/libdvm.so (dvmCallMethodA(Thread*, Method const*, Object*, bool, JValue*, jvalue const*)+298) [INFO][DEBUG ( 1923)] #03 pc 0004c84d /system/lib/libdvm.so [INFO][DEBUG ( 1923)] #04 pc 00012457 /data/data/uk.co.scotcomms.nfcisodeptest/lib/libti.nfc.so (ti::nfc::nfc::TagTechnologyIsoDepProxy::transceive(v8::Arguments const&)+166) [INFO][DEBUG ( 1923)] #05 pc 00169634 /data/data/uk.co.scotcomms.nfcisodeptest/lib/libkroll-v8.so [INFO][DEBUG ( 1923)] #06 pc 0002f1cb
..Bp..B [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near r3: [INFO][DEBUG ( 1923)] 572c72d0 00000000 01000000 4089cfbd 00000000 ...........@.... [INFO][DEBUG ( 1923)] 572c72e0 00000000 00000000 00000000 0000002c ............,... [INFO][DEBUG ( 1923)] 572c72f0 572c7080 572c70b8 572c70f0 572c7128 .p,W.p,W.p,W(q,W [INFO][DEBUG ( 1923)] 572c7300 572c7160 572c7198 572c71d0 572c7208
q,W.q,W.q,W.r,W [INFO][DEBUG ( 1923)] 572c7310 572c7240 572c7278 572c72b0 00000004 @r,Wxr,W.r,W.... [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near r4: [INFO][DEBUG ( 1923)] 5d6f9228 5b362054 1cfc206e fa280030 00020005 T 6[n ..0.(..... [INFO][DEBUG ( 1923)] 5d6f9238 00000002 00596cc8 00000010 5b363154 .....lY.....T16[ [INFO][DEBUG ( 1923)] 5d6f9248 9e3a106e 020c0004 1cfd206e 000c0021 n.:.....n ..!... [INFO][DEBUG ( 1923)] 5d6f9258 12e90122 9e302070 01110001 00010003 "...p 0......... [INFO][DEBUG ( 1923)] 5d6f9268 00000002 00596cd8 0000001d 8faa1070 .....lY.....p... [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near r5: [INFO][DEBUG ( 1923)] 41052e50 41052e7c 5855ca10 41f7b228 41052e98 |..A..UX(..A...A [INFO][DEBUG ( 1923)] 41052e60 00000000 57666ca0 5d6f9248 00000000 .....lfWH.o].... [INFO][DEBUG ( 1923)] 41052e70 572db588 42028998 4233b5e8 420ac3e0 ..-W...B..3B...B [INFO][DEBUG ( 1923)] 41052e80 41f7b228 41052eac 00000000 00000000 (..A...A........ [INFO][DEBUG ( 1923)] 41052e90 00000000 41052ebc 41052ed8 5d68263a .......A...A:&h] [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near r6: [INFO][DEBUG ( 1923)] 571f24c0 0001000a 00000008 00000028 00000013 ........(....... [INFO][DEBUG ( 1923)] 571f24d0 00030182 07020600 00000706 00000453 ............S... [INFO][DEBUG ( 1923)] 571f24e0 5d6f9244 41052e70 57666ca0 589a8000 D.o]p..A.lfW...X [INFO][DEBUG ( 1923)] 571f24f0 4001a7f8 00000000 5daef7f8 00000000 ...@.......].... [INFO][DEBUG ( 1923)] 571f2500 5daef82c 0000000a 00000000 40855040 ,..]........@P.@ [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near r7: [INFO][DEBUG ( 1923)] 0000104c ffffffff ffffffff ffffffff ffffffff ................ [INFO][DEBUG ( 1923)] 0000105c ffffffff ffffffff ffffffff ffffffff ................ [INFO][DEBUG ( 1923)] 0000106c ffffffff ffffffff ffffffff ffffffff ................ [INFO][DEBUG ( 1923)] 0000107c ffffffff ffffffff ffffffff ffffffff ................ [INFO][DEBUG ( 1923)] 0000108c ffffffff ffffffff ffffffff ffffffff ................ [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near r8: [INFO][DEBUG ( 1923)] 40855020 e320f000 e320f000 e320f000 e320f000 .. ... ... ... . [INFO][DEBUG ( 1923)] 40855030 e320f000 e320f000 e320f000 e320f000 .. ... ... ... . [INFO][DEBUG ( 1923)] 40855040 e1f470b2 e207c0ff e088f30c e92d4ff0 .p...........O-. [INFO][DEBUG ( 1923)] 40855050 e24dd004 e320f000 e320f000 e320f000 ..M... ... ... . [INFO][DEBUG ( 1923)] 40855060 e320f000 e320f000 e320f000 e320f000 .. ... ... ... . [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near r9: [INFO][DEBUG ( 1923)] 41f7b208 410b3cd0 00000000 41f7b148 41f7b138 .<.A....H..A8..A [INFO][DEBUG ( 1923)] 41f7b218 00000000 2f2dacac 2f697064 0000003b ......-/dpi/;... [INFO][DEBUG ( 1923)] 41f7b228 410a5e90 00000000 00000008 00000000 .^.A............ [INFO][DEBUG ( 1923)] 41f7b238 4203a000 4203a010 4203a020 4203a030 ...B...B ..B0..B [INFO][DEBUG ( 1923)] 41f7b248 4203a040 4203a050 4203a060 4203a070 @..BP..B`..Bp..B [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near sl: [INFO][DEBUG ( 1923)] 41052e38 41052e68 5d6916f6 572d8e78 00000000 h..A..i]x.-W.... [INFO][DEBUG ( 1923)] 41052e48 00000000 00000000 41052e7c 5855ca10 ........|..A..UX [INFO][DEBUG ( 1923)] 41052e58 41f7b228 41052e98 00000000 57666ca0 (..A...A.....lfW [INFO][DEBUG ( 1923)] 41052e68 5d6f9248 00000000 572db588 42028998 H.o]......-W...B [INFO][DEBUG ( 1923)] 41052e78 4233b5e8 420ac3e0 41f7b228 41052eac ..3B...B(..A...A [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near fp: [INFO][DEBUG ( 1923)] 5d75c4d8 4a4a4c05 0400494a 4c4a4a4c 4a4c0500 .LJJJI..LJJL..LJ [INFO][DEBUG ( 1923)] 5d75c4e8 004c4c4a 4c4a4c03 4a4c0400 02004c4c JLL..LJL..LJLL.. [INFO][DEBUG ( 1923)] 5d75c4f8 03004c4c 00424c4c 434c4c03 4c4c0300 LL..LLB..LLC..LL [INFO][DEBUG ( 1923)] 5d75c508 4c030044 0400464c 46464c4c 4c4c0600 D..LLF..LLFF..LL [INFO][DEBUG ( 1923)] 5d75c518 46464646 4c4c0400 03004c46 00494c4c FFFF..LLFL..LLI. [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] memory near sp: [INFO][DEBUG ( 1923)] 5daef7d8 5daef7fc 572db588 4203a070 4087ff29 ...]..-Wp..B)..@ [INFO][DEBUG ( 1923)] 5daef7e8 2740000d 40883b4d df0027ad 00000000 ..@'M;.@.'...... [INFO][DEBUG ( 1923)] 5daef7f8 41f7b228 571f24e0 408dcc94 57666ca0 (..A.$.W...@.lfW [INFO][DEBUG ( 1923)] 5daef808 00000000 5daef82c 5daef8f8 00000000 ....,..]...].... [INFO][DEBUG ( 1923)] 5daef818 5d75c4f8 40862bec 5e04bf18 5daef834 ..u].+.@...^4..] [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] code around pc: [INFO][DEBUG ( 1923)] 4085e1d8 e201c0f0 e795212c e1a00000 e52a2004 ....,!....... *. [INFO][DEBUG ( 1923)] 4085e1e8 e201c00f e795210c e1a00000 e52a2004 .....!....... *. [INFO][DEBUG ( 1923)] 4085e1f8 e1d090ba e1d030bc e5902020 e5907000 .....0.. ...p.. [INFO][DEBUG ( 1923)] 4085e208 e2451014 e0411109 e241a014 e596903c ..E...A...A.<... [INFO][DEBUG ( 1923)] 4085e218 e04a3103 e1530009 e1d6e2b8 e5903004 .1J...S......0.. [INFO][DEBUG ( 1923)] [INFO][DEBUG ( 1923)] code around lr: [INFO][DEBUG ( 1923)] 408598a0 e795910a e1d020b8 e3590000 0a00132b ..... ....Y.+... [INFO][DEBUG ( 1923)] 408598b0 e5993000 e5933074 e7930102 eb00122f .0..t0....../... [INFO][DEBUG ( 1923)] 408598c0 e59a1048 e1d020b8 e5913070 e5054008 H.... ..p0...@.. [INFO][DEBUG ( 1923)] 408598d0 e1520003 2a000008 e5911074 e7910102 ..R....*t....... [INFO][DEBUG ( 1923)] 408598e0 eb001226 e1a0000a e3a02003 fa012245 &........ ..E".. [INFO][DEBUG ( 1923)] !@dumpstate -k -t -z -d -o /data/log/dumpstate_app_native -m 2498 [INFO][BootReceiver( 2267)] Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE) [INFO][dumpstate( 3322)] begin [WARN][SignalStrength( 2267)] getGsmLevel=4 [WARN][SignalStrength( 2569)] getGsmLevel=4 [WARN][SignalStrength( 2569)] getLevel=4 (SignalStrength: 14 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4) [WARN][SignalStrength( 2569)] getGsmLevel=4 [WARN][AlarmManager( 2267)] FACTORY_ON= 0 [WARN][SignalStrength( 2569)] getLevel=4 (SignalStrength: 14 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4) [WARN][SignalStrength( 2267)] getLevel=4 (SignalStrength: 14 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4) [WARN][SignalStrength( 2267)] getGsmDbm=-85 [WARN][SignalStrength( 2267)] getDbm=-85 [WARN][AlarmManager( 2267)] FACTORY_ON= 0 [WARN][SignalStrength( 2267)] getGsmAsuLevel=14 [WARN][SignalStrength( 2267)] getAsuLevel=14 [INFO][LocationManagerService( 2267)] request network (pid 2186) 0 0 [WARN][SignalStrength( 2569)] getGsmLevel=4 [WARN][SignalStrength( 2569)] getLevel=4 (SignalStrength: 15 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4) [WARN][SignalStrength( 2569)] getGsmLevel=4 [WARN][SignalStrength( 2569)] getLevel=4 (SignalStrength: 15 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4) [WARN][SignalStrength( 2267)] getGsmLevel=4 [WARN][SignalStrength( 2267)] getLevel=4 (SignalStrength: 15 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4) [WARN][AlarmManager( 2267)] FACTORY_ON= 0 [WARN][SignalStrength( 2267)] getGsmDbm=-83 [WARN][SignalStrength( 2267)] getDbm=-83 [WARN][SignalStrength( 2267)] getGsmAsuLevel=15 [WARN][SignalStrength( 2267)] getAsuLevel=15 [WARN][AlarmManager( 2267)] FACTORY_ON= 0 [INFO][dumpstate( 3322)] done [ERROR][Watchdog( 2267)] !@Sync 121388 [INFO][ActivityManager( 2267)] Process uk.co.scotcomms.nfcisodeptest (pid 2498) (adj 0) has died. [INFO][SurfaceFlinger( 1930)] id=8880 Removed Ofcisodepte idx=3 MapSz=16 [INFO][SurfaceFlinger( 1930)] id=8880 Removed Ofcisodepte idx=-2 MapSz=16 [ERROR][Launcher( 2822)] Error finding setting, default accessibility to not found: accessibility_enabled [INFO][FlashBarService( 2781)] mPkgManagerReceiver : onReceive [INFO][SurfaceFlinger( 1930)] id=8881(608) createSurf 0x44880e1c (720x1280),1 flag=0, Mauncher {noformat}Firstly, sorry for using this ticket to ask these questions but I can't find any other way to get feedback. Our company has invested months of development in this project and the NFC (DesFire) functionality is critical to it. This bug has now stalled the project. Please can you let us know if 1. is this bug being investigated? If not we will have to scrap our project. 2. if so, is there a time frame for resolution? Just some feedback either way would be good. We are also willing to pay for the bug to be fixed but can't see how to get paid support in Titanium. I look forward to hearing from you.