[Spirit FM] mikereidis:
Motorola Proprietary support for Droid X, Bionic etc:

I've received at least one CM7 Droid X debug log and it looks like it ALMOST works, but the log shows many permission errors:

Request requires com.motorola.android.permission.FMRADIO

My app declares that permission, but perhaps on a CM ROM, that permission can't be used.

So I put together inst_mot_fm.zip: http://www.mediafire.com/file/6bscz6aivqq4uz7/inst_mot_fm.zip

This contains a modified/hacked version of fmradioserver that uses a different permission my app has. The Zip also includes the 3 library files needed to support this FM API. These are the same files as found in the last CM7 nightly for the DroidX (and several earlier) as well as on MIUI for DroidX.

EDIT: I've now seen a log for a Motorola Photon 4g with rooted stock 2.3.5. It has the same permissions issue. But the libFMRadio.so is much smaller, about 25 KBytes versus 500 KBytes. So I'd recommend NOT trying this install procedure in such a case where files seem quite different.

I also included the FM and FM Service apps. Since Motorola/Google hasn't made any effort to discourage re-distribution (and even resale by whatisname, LOL) of these device specific and effectively free FM apps, on XDA and elsewhere, I'm not too concerned.

On devices like the Defy or Bionic, those APK files should be installable and usable after the binary and libraries are installed.

Installing this stuff isn't for newbs to "adb shell". Things can always go wrong and I can't accept responsibility. But I think this should be not too hard, just so long as you ensure you have at least 2 Megabytes free on /system. Use this to determine:

adb shell df /system

After unizipping the file, from a PC connected via USB adb shell, the commands in inst_mot_fm can be entered. (Or from a Linux PC, used as a shell script with "./inst_mot_fm".

If there are any original files. backups are made. To restore original state, use rest_mot_fm. It just runs this:

#!/bin/sh

# rest_mot_fm Script / Remote adb commands to restore original Motorola FM libraries and service

adb remount

adb shell "cp -p -f /system/bin/backup/* /system/bin/"

adb shell "cp -p -f /system/lib/backup/* /system/lib/"

The backups should keep you out of trouble, but nothing is ever perfect, so be careful or don't do this. Here's the install script:

#!/bin/sh

# inst_mot_fm Script / Remote adb commands to backup original Motorola FM libraries and service, and install compatible versions.

adb remount

adb shell mkdir /system/bin/backup

adb shell mkdir /system/lib/backup

adb shell "echo n | cp -p -i /system/bin/fmradioserver /system/bin/backup/"

adb shell "echo n | cp -p -i /system/bin/fmradioserver /system/bin/fmradioserver.backup"

adb shell "echo n | cp -p -i /system/lib/libfmradio_jni.so /system/lib/backup/"

adb shell "echo n | cp -p -i /system/lib/libfmradio_jni.so /system/lib/libfmradio_jni.so.backup"

adb shell "echo n | cp -p -i /system/lib/libfmradioplayer.so /system/lib/backup/"

adb shell "echo n | cp -p -i /system/lib/libfmradioplayer.so /system/lib/libfmradioplayer.so.backup"

adb shell "echo n | cp -p -i /system/lib/libFMRadio.so /system/lib/backup/"

adb shell "echo n | cp -p -i /system/lib/libFMRadio.so /system/lib/libFMRadio.so.backup"

adb push fmradioserver /system/bin/

adb push fmradioserver_cm /system/bin/

adb push libfmradio_jni.so /system/lib/

adb push libfmradioplayer.so /system/lib/

adb push libFMRadio.so /system/lib/

adb shell chmod 777 /system/bin/fmradioserver

adb shell chmod 777 /system/bin/fmradioserver_cm

adb shell chmod 777 /system/lib/libfmradio_jni.so

adb shell chmod 777 /system/lib/libfmradioplayer.so

adb shell chmod 777 /system/lib/libFMRadio.so

# After the above, it may be best to reboot.