Other Threads

1. Causing onMeasure() to be called for an EditView

Using the hack doesn't work.
if i call to the setMeasuredDimension() with the dimensions i want
from the onLayout() of the layout it wont change the measured values.

So i need some help here :-)





-- 

2. Decryption "pad block corrupted" error ???

Hello,

Anyone know what night be causing a "pad block corrupted" exception to
be raised with decryption on Android? Here is the scenario:

1. On Windows Java app (NetBeans) read a small file, encrypt its
contents and write it as a new encrypted file.
2. adb push the encrypted file to an Android
3. On Android, open the encrypted file and try to decrypt using same
cipher parameters as set on the Windows side and it gets the "pad
block corrupted" error.

(Running the decryption code on within the Windows Java app decrypts
OK, no "pad block corrupted" error)


Thank you for any ideas!


Here are the relevant code fragments with the trying/catching removed
for clarity.


On Windows Java app (NetBeans)

        KeyGenerator kgen = KeyGenerator.getInstance("AES");
        SecureRandom secureRandom = new
SecureRandom("MyKey".getBytes());
        kgen.init(128, secureRandom);
        SecretKey skey = kgen.generateKey();
        rawKey = skey.getEncoded();
        SecretKeySpec skeySpec = new SecretKeySpec(rawKey, "AES");
        cipher = Cipher.getInstance("AES");
        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);

        FileOutputStream fileOutputStream = new FileOutputStream(new
File("filename"));
        CipherOutputStream cipherOutputStream = new
CipherOutputStream(fileOutputStream, cipher);

        int numRead = 0;
        byte[] buf = new byte[1024];
        while ((numRead = iS.read(buf)) >= 0) // iS is an input stream
        {
            cipherOutputStream.write(buf, 0, numRead);
        }
        cipherOutputStream.close();


Use ADB to push the encrypted file to the Android


On Android

        String cryptKey = "MyKey";
        KeyGenerator kgen = KeyGenerator.getInstance("AES");
        SecureRandom secureRandom = new
SecureRandom(cryptKey.getBytes());
        kgen.init(128, secureRandom);
        SecretKey skey = kgen.generateKey();
        rawKey = skey.getEncoded();
        SecretKeySpec skeySpec = new SecretKeySpec(rawKey, "AES");
        cipher = Cipher.getInstance("AES");
        cipher.init(Cipher.DECRYPT_MODE, skeySpec);


        FileInputStream fileInputStream = new FileInputStream("filename");
        CipherInputStream cipherInputStream = new
CipherInputStream(fileInputStream, cipher);
        int numRead;
        byte[] buf = new byte[1024];
        try {
                while ((numRead = cipherInputStream.read(buf)) >= 0)
                {
                    if (retStr==null)
                                retStr = new String(buf, 0, numRead);
                        else
                                retStr = retStr.concat(new String(buf, 0, 
numRead));
                }
                cipherInputStream.close();
                } catch (IOException e1) {

                        // *************
                        // This exception is raised with message "pad block 
corrupted"
                        // *************

                }

-- 

3. Is it possible to launch an activity on a certain key sequence?

4. Is it possible to launch an activity on a certain key sequence?

5. howto extend LinearLayout?

6. Lunch and Compiling

7. Installing the ADT Plugin