Add --delete flag to uninstall profiled applet from card (closes #157) - #158
Add --delete flag to uninstall profiled applet from card (closes #157)#158Ankit65k wants to merge 1 commit into
Conversation
|
Hello! I have got a very strong suspicion that your PR was AI generated. Could you comment on that, please? |
|
Hi @lzaoral — fair question, and I'll be honest about it: I leaned on an AI assistant quite a bit for this, especially for drafting the code and finding my way around the codebase (Java Card and this project's architecture are still fairly new to me). That said, here's what I actually did myself :- |
Closes #157.
What changed
--deleteboolean flag toArgs.javaInstaller.uninstallFromCard(), which prompts for confirmation, theninvokes GlobalPlatformPro to delete the applet by AID — mirrors the
argument handling in
installOnCard(reuses--key,--debug) as suggestedJCProfiler.run(), executing after the visualisationstage completes (per your suggestion to run after profiling, not instead
of the pipeline)
Verified
--deleteflag in its source (GPTool.java,OPT_DELETE) to confirm syntax rather than assuming it. Found that--forceonly affects deletion of a package AID's dependents, so it's intentionally
omitted here since we're deleting a single applet instance AID.
--deleteby design (behaves likerm),so a zero exit code doesn't guarantee the AID was actually present/removed —
left a comment about this in the code.
Tested
./gradlew compileJavaand./gradlew build -x testsucceed on JDK 21--deleteappears correctly in--helpoutputNot tested
GPTool delete call against real hardware. Would appreciate if you could test
that part, or point me to a way to test it myself.
Open question
--deleteonly fires if--stop-afterallows the pipeline toreach visualisation. If
--stop-afteris set earlier (e.g.profiling),--deleteis silently skipped. Let me know if that's the intended behavioror if it should work independently of
--stop-after.