The type of lock that's acceptable may be predetermined by your system administrator.
Where I can define what's acceptable? I can regenerate the certificate if needed.
So I can use slide lockscreen again.
(I'm using CM9 RC1, Android 4.0.4)
The type of lock that's acceptable may be predetermined by your system administrator.
Where I can define what's acceptable? I can regenerate the certificate if needed.
So I can use slide lockscreen again.
(I'm using CM9 RC1, Android 4.0.4)
The problem with disabling the lockscreen security using the toggle/profile is that the lockscreen widgets don't appear either so you can't slide to unlock. Also, when you reboot your phone the buttons don't work until you retoggle the setting again.
Another way is to install the certificate as usual then backup the /data/misc/keychain and keystore directories using something that preserves the ACLs such as Root Explorer to a location that supports ACLs. I suggest copying them to /tmp. Then clear the credentials from Settings and enable Slide To Unlock. Then copy back the folders from /tmp. The CA will be installed.
I've described how to do exacly this on my page, "Installing CAcert certificates on Android as 'system' credentials without lockscreen - instructions" at http://wiki.pcprobleemloos.nl/android/cacert
I've also posted it on the cyanogenmod forum: http://forum.cyanogenmod.com/topic/82875-installing-cacert-certificates-on-android-as-system-credentials-without-lockscreen/
Basically, the commands are:
openssl x509 -inform PEM -subject_hash_old -in root.crt | head -1
To get the correct filename, then convert the certificate:
cat root.crt > 5ed36f99.0
openssl x509 -inform PEM -text -in root.crt -out /dev/null >> 5ed36f99.0
Copy them to /system/etc/security/cacerts/ and chmod the new .0 files to '644'. Reboot and verify. On your android device select 'Clear cerficates' and you are able to remove the pin (by entering the pin and changing your lockscreen to 'none' or 'wipe'
Here I used the CAcert root certificate, but you probably want the class3.crt certificate as well, or use your own certificates.
140342119224992:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: TRUSTED CERTIFICATE
. Checking with Unable to load certificate in openssl, the .pem
file should be the match. But then, your last command changes nothing. Anything wrong, or is that expected for a self-signed/created CA? And before I start hacking: should that work nevertheless?
openssl x509 -inform PEM -text -fingerprint -in cacert.pem > d6a2705a.0
, then moving the base64 block to the top using a text editor, placing the file into /system/etc/security/cacerts/
, running chown root:root d6a2705a.0
and chmod 0644 d6a2705a.0
from within the directory – et voila, it turns up as trusted system certificate. Yeehaa!
-----END CERTIFICATE-----Certificate:
which caused a parse error too.
Commented
Nov 13, 2017 at 12:22
I've discovered a solution that works without additional software or manual file copying:
The system is now set to "Swipe unlock", but the user certificate is still usable (tested with the web browser and a custom app using DefaultHttpClient).
Tested on an Android 4.1.2 on a Galaxy Tab 2 10.1.
Just wanted to add an answer that's a variant of guttermonk's for one particular use case: installing a certificate on a Bluestacks instance. At this writing the setting app for Bluestacks has been modified so that setting a pin or password is impossible, and so adding a user certificate is impossible also. But we can get a root certificate into the system with guttermonk's approach plus some other steps. I was able to install a certificate without a pin or password and without ever installing it in the user's certificate store.
Prerequisites:
In my case, I had downloaded the cert file within Bluestacks and didn't have openssl available there. We can copy the file to the directory shared with Windows:
cp /sdcard/Download/mycert.cer /sdcard/windows/BstSharedFolder
In Windows we can use the openssl to get the hash of the certificate (I assume that's what this is).
cd C:\ProgramData\BlueStacks\Engine\UserData\SharedFolder # in CMD
cd /c/ProgramData/BlueStacks/Engine/UserData/SharedFolder # in Bash
openssl x509 -inform PEM -subject_hash_old -in mycert.cer | head -1
# e.g. abcd1234
Back in Android, we can make the system partition writable, copy the certificate to the system certificates directory, and fix up its permissions and ownership. Mount the system partition read only afterward, for safety.
mount -o rw,remount /system
cd /system/etc/security/cacerts/
cp /sdcard/Download/mycert.cer ./abcd1234.0
chmod 644 abcd1234.0
chown system:system abcd1234.0
mount -o ro,remount /system
You can make use of CyanogenMod's profiles.
(For other readers: this needs the custom CyanogenMod Rom version 9+)
Just create or modify an existing profile and switch off "screen lock" there.
It's: System Settings->Profiles->Default->Lock screen mode->Disabled
Integrate your certificate into the standard Android keystore file
See CAcert's excellent howto here
I'm not sure however if you can do this with a self-signed cert (you might have to switch to a self-made CA maybe (use tinyca for a nice gui-tool on *nix)).
I found a way to solve the problem, but it requires root and may only work with root, self-signed, or intermediate CAs.
If you have a certificate that is not trusted by Android, when you add it, it goes in the personal cert store. When you add a cert in this personal cert store, the system requires a higher security level to unlock the device. But if you manage to add your cert to the system store then you don't have this requirement. Obviously, root is required to add a certificate to the system store, but it is quiet easy.
Here is how to do it :
1 - Add your cert normally. For example, my cert was called some.crt
. It will be stored in your personal store and android will ask you a pin/password... Proceed.
2 - With a file manager with root capabilities, browse files in /data/misc/keychain/cacerts-added
or /data/misc/keystore
. You should see a file here called 1000_USRCERT_some
it's the certificate you have added in step 1.
3 - Move this file to system/etc/security/cacerts
(you will need to mount
the system partition r/w)
4 - Reboot the phone
5 - You are now able to clear the pin/password you have set to unlock the device.
Worked for me with a self-signed cert on Android 4.4.2. Hope it helps!