Warning: code is completely insecure. SHA1PRNG used a bad random number generator, was then replaced by OpenSSL that is fully random regardless of the seed and is deprecated for newer versions of Android. Code also uses ECB (no IV) instead of CBC or an authenticated cipher.