I've produced and tested (as far as possible) a revised version that allows input of multiple files from one directory or a directory itself. (I've named this HFODU2 so that you can have the old and the new versions side-by-side if you wish).
I've taken the opportunity to use one of the more robust tests for decryption- as outlined by af123 above. All my testing shows that this works, so I will be dissappointed (and look a bit foolish) if this fails for anyone using the program!
For users who select just one file at a time there should be no change - except the program now produces a log file of the form HFODU2-{date}-{time}.log. There may be the odd message that would have appeared as a pop up window that now goes into the log file instead.
For multiple files: All processed files end up in a subdirectory "decrypt" alongside the input files. Sub-directories of a selected directory are not searched.
When "decrypt" is pressed the files are queued for processing. A message will pop up indicating the status of the decryption (as in single file use). It will only remain visible for two seconds and then the processing will move on to the next file.
The log file contains information that should help you locate which files decrypted properly and where the ouput is.
Code:
10:20:15 INFO: Humax 'FOX' Offline Decrytion Utility (HFODU V2.0a) - Java Version: 1.8.0_151
10:20:25 INFO: Using MAC: **-**-**-**-**-**, Serial: **************
10:20:25 INFO: Processing 5 files.
10:20:25 INFO: Decrypting: C:\...\testdir\dec_Pointless.ts
10:20:28 WARNING: File not decrypting - check status/MAC/SN
10:20:30 INFO: Decrypting: C:\...\testdir\enc_Pointless.ts
10:20:37 INFO: The file was decrypted successfully.
10:20:37 INFO: Output is C:\...\testdir\decrypt\enc_Pointless_dec.ts
10:20:41 INFO: Decrypting: C:\...\testdir\notts.ts
10:20:43 WARNING: File is not Humax .ts
10:20:43 INFO: Decrypting: C:\...\testdir\Star Trek_ Enterprise_20180826_1358.ts
10:20:43 WARNING: File not decrypting - check status/MAC/SN
10:20:46 INFO: 1 of 4 files successfully decrypted.
10:20:54 INFO: Program exiting normally
I've removed some information from this log (***,...).
I could have checked to see whether the file was already decrypted. I didn't use the .hmt file for this in case there isn't one! I suppose I could have used the same CRC check on the PAT before and after encryption but again, I didn't. Therefore, as it just doesn't decrypt again," check status/MAC/SN".
In the above log - dec_Pointless was already decrypted, enc_Pointless was encrypted and I know the key, notts is not a transport stream file, and Star Trek was encrypted on a 2000T so the key is wrong.
I hope this does what people want it to do - and doesn't crash!