CM: chromium doesn’t build with JDK 1.7


If you build Android or CyanogenMod and you run into issues with HashSet_jni.h you need the following changes to the chromium_org project: diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py index de865d5..d4a2324 100755 --- a/base/android/jni_generator/jni_generator.py +++ b/base/android/jni_generator/jni_generator.py @@ -555,18 +555,21 @@ class JNIFromJavaSource(object): contents) return JNIFromJavaSource(contents, fully_qualified_class) +def MultipleReplace(string, rep_dict): + pattern = re.compile("|".join([re.escape(k) for k in rep_dict.keys()]), re.M) + return pattern.sub(lambda x: rep_dict[x.group(0)], string) class InlHeaderFileGenerator(object): """Generates an inline header file for JNI integration.""" def __init__(self, namespace, fully_qualified_class, natives, called_by_natives): - self.namespace = namespace - self.fully_qualified_class = fully_qualified_class + self.namespace = MultipleReplace(namespace, {'':''}) + self.fully_qualified_class = MultipleReplace(fully_qualified_class, {'':''}) self.class_name = self.fully_qualified_class.split('/')[-1] self.natives = natives self.called_by_natives = called_by_natives - self.header_guard = fully_qualified_class.replace('/', '_') + '_JNI' + self.header_guard = MultipleReplace(fully_qualified_class, {'/':'_', '':''}) + '_JNI' def…

How to create a SuplRootCert for supl.google.com


Back to these bad GPS fixes for Android spread all over the net. This time I will describe how to find out which is the correct SSL root certificate you need and how to create it. So first we need know the root certificate the Google SUPL server has been signed. There are several ways but we use the easiest. Connect with the openssl binary to the SUPL server. This can be done by the following command: $ openssl s_client -connect supl.google.com:7275 The output you will see will include the following relevant part at the beginning: CONNECTED(00000003) depth=2 C = US, O = "thawte, Inc.", OU = Certification Services Division, OU = "(c) 2006 thawte, Inc. - For authorized use…

Android, CyanogenMod and the GPS fix


There are a lot of people around providing gps fixes for Android. Most of them don't really help at all. I want to explain here what variables the code recognizes and what they do. The other thing is SuplCert which is the certificate to verify the ssl connection for the supl server. Most of the time poeple provide the wrong certificate. gps.conf There are two locations in the code which read the gps.conf file. GpsLocationProvider.java [1] GpsXtraDownloader.java [2] and loc_eng_cfg.cpp [3]. The GpsLocationProvider reads the following variables from the config: SUPL_HOST SUPL_PORT C2K_HOST C2K_PORT GpsXtraDownloader.java XTRA_SERVER_1 XTRA_SERVER_2 XTRA_SERVER_3 This is pretty obvious. It then calls a function from libloc_api called loc_eng_set_server() to set the agps server. libloc_api itself reads also…

CyanogenMod 9 for HTC Wildfire S (ALPHA3)


Maybe you already know that I worked since January 2012 on porting CM9 to the HTC Wildfire S (Marvel). It took quite a while to figure out how Android is working and how to get the the OS correctly talking with the hardware. Today I've released ALPHA3 of my work which is a pretty stable version. The Wildfire S is not a supported Android 4.0 device, so you have to workaround a lot of things and use old binary blobs. This also means there will probably never be an official CM9 release for the Wildfire S. However most of the stuff is working pretty well and you can live with the known bugs. Known bugs: Camera isn't fully working, you…

CM9 (Android 4.0 ICS) and deep sleep


I've had the problem that the device didn't want to switch into deep sleep mode if radio was on. What is deep sleep? To make it simple we break it down. Your device has 3 modes. The fisrst is "Screen On and Awake", "Awake" and "Deep Sleep". If you use your device it you're in the first mode and you need a obviously a lot of battery. The second "Awake" means it is doing some background work. Checking for calls, checking Emails, syncing contacts. The last one means it goes for some time into a mode were it uses almost no battery, and this is Deep Sleep. If you don't do anything and your phone is in your pocket you…

libhtc_ril.so and segfaults


If you try to get a new Android version, in this case CyanogenMod9, working on your old phone you have to deal with binary blobs. One of these blobs is the library talking to the radio, libhtc_ril.so. I wanted to document what I learned about libhtc_ril.so. I've wanted to get the library version matching my baseband version working with cm9. This resulted it several segfaults. So I've started to strace the rild process to find what's going wrong, which permissions are missing etc. The library doesn't check return values so it segfaults. One of these segfaults was a missing kernel interface called usb_function_switch. The file should be in /sys/devices/platform/msm_hsusb/usb_function_switch. I've implemented that function in the kernel and it still segfaulted…

CM9 on Marvel (HTC Wildfire S)


After Qualcom released new graphic blobs for ARMv6 I was able to get CyanogenMod 9 working on my HTC Wildfire S pretty well. There are still some problem which need to be fixed. GPS isn't working, if you have GSM/3G turned on the battery drains pretty fast. I'm currently trying to get the camera working. There is also a wakelock bug with bluetooth in the kernel right now. If you're a developer working on a msm7x27 device and are interested to work together join #cyanogenmod-msm7x27 @ freenode. You can find my work at http://git.cryptomilk.org/

CyanogenMod 9 for HTC Wildfire S


I've got a new gadget, a nice and small Android based smartphone, the HTC Wildfire S (WFS). The week before I got it alquez finished porting CyanogenMod 7 to the wfs. I've installed it and started to use it. After some time I was curios how to build the system. I've asked alquez how to set it up and I built it from source. Then I got interested in Android 4.0 and looked at CM9. After I managed to build it, it booted with the CM7 kernel and you could get a shell but that was it. So I've started to look into the Kernel and read CM9 code. Now after two weeks of work the device shows a UI.…