Attempting to brute force Android security pattern through TWRP via adb
After a while I figured out what the problem was, with a freshly flashed phone. Here I'll be answering my own question.





  Does the twrp decrypt command output something else when decryption succeeds?


Yes, it outputs something like:

Attempting to decrypt data partition via command line.
Data successfully decrypted
Updating partition details...
...done


  Does successfully decrypting create a block device at /dev/block/dm-0, which I can probe for?


No.

  Should I wait a few seconds after each attempt before probing for success?


-

  Is there some sort of hidden timeout (required to wait 30 seconds after attempt)?


Yes, very important! About 10 seconds. Consecutive attempts within that time frame fail with no warning whatsoever.

  Is there another method I can use to probe for success?


-




So, consecutive attempts to invoke twrp decrypt must have at least 10 seconds between them or else they will fail. So, the only thing that was wrong with the developed tool, is that I didn't implement this timeout.