JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
How to reduce the size of javacard applet
-
- Posts: 24
- Joined: Thu Apr 07, 2016 12:14 pm
- Points :457
- Contact:
How to reduce the size of javacard applet
Hello everyone,
I wrote an applet which has 19 KB size on disk. It has three classes. The first one is extended from Applet, the second one has static functions and third one is a class that i create an instance from it in my applet.
I have three questions:
1- Is there any way to find out how much size has taken by my applet instance in my javacard?
2- is there any tool to reduce the size of a javacard applet (.cap file)?
3- Can you explain rules that help me to reduce my applet size?
Regards,
Mohsen.
I wrote an applet which has 19 KB size on disk. It has three classes. The first one is extended from Applet, the second one has static functions and third one is a class that i create an instance from it in my applet.
I have three questions:
1- Is there any way to find out how much size has taken by my applet instance in my javacard?
2- is there any tool to reduce the size of a javacard applet (.cap file)?
3- Can you explain rules that help me to reduce my applet size?
Regards,
Mohsen.
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3055
- Contact:
Re: How to reduce the size of javacard applet
1 Write an applet to get card available memory size; You can get your applet size in card with following steps:
- Get card memory size size1;
- Load your applet to the card;
- Get card memory size size2;
- Your applet uses memory size: size1 - size2.
Note: The uses size are different for different card, because the different implementation of each card.
2 Remove the argument "-debug" of converter. The debug component in the CAP file will not be generated. This method can only reduce CAP file size, not applet size.
3 There are some rules i think of:
- Are there any common functions in your code? You can write them as common method;
- Are there any const data in your code? you can write it when you use it, not pre-defined in your applet;
- Get card memory size size1;
- Load your applet to the card;
- Get card memory size size2;
- Your applet uses memory size: size1 - size2.
Note: The uses size are different for different card, because the different implementation of each card.
2 Remove the argument "-debug" of converter. The debug component in the CAP file will not be generated. This method can only reduce CAP file size, not applet size.
3 There are some rules i think of:
- Are there any common functions in your code? You can write them as common method;
- Are there any const data in your code? you can write it when you use it, not pre-defined in your applet;
sense and simplicity
-
- Posts: 24
- Joined: Thu Apr 07, 2016 12:14 pm
- Points :457
- Contact:
Re: How to reduce the size of javacard applet
Thank you very much, it was great answer.
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3055
- Contact:
Who is online
Users browsing this forum: No registered users and 24 guests