[HTC One X] mwilky:
Hello guys,

Just thought i'd share the source code with you and a tutorial on how to modify it to work with a rom with a modified ondemand governor by default. Or if you wanna change the values altogether you will be able to do so.

Also if any other devs wanna modify it to look better or anything feel free, we are a community :)

Right first off your gonna need

Eclipse properly set up to work with android and OpenSense SDK (i will not go through how to do this, google is your friend for that)

The Source Code provided in this post

An APK signer

Patience because if your not experienced this could take a while

Tutorial:

First off extract the .zip somewhere on your pc

Then your gonna want to open Eclipse, go to File/New/Project.

From there expand the android folder and select "Android Project From Existing Code"

Click Here For ScreenShot

On the next screen where it says "Root Directory", point it to where you extracted the source folder to.

If you have done it correctly your screen should look like this:

Click Here For ScreenShot

Click finish and the project will be open.

From there, at the top left you will see a section saying "Package Explorer".

Underneath you will see "com.ondemand.gaming.boost.OnDemandGamingBoostActivity".

Click the arrow to open it up.

Once opened you will see a lot more options, the one we need to worry about is"src", so go ahead and open that one up.

You will see another 2 options, go ahead and open up "com.ondemand.gaming.boost".

From there you will see "OnDemandGamingBoostActivity.java", double click that and it will open in the main window.

Click Here For ScreenShot

Right the bit we are after is about halfway down, so just scroll down till you find this section of code.

Click Here For ScreenShot

From here you will see that this is where all the commands get executed.

"ShellInterface.runCommand" basically tells the app to run a command.

The top half is the values to revert back to when you disable gaming boost, this is shown by the "preference.setSummary("Gaming Boost Disabled");" at the end of the commands. (Most likely this is just the section you will be editing, but the same would apply if you was changing the optimized values)

From here its pretty much self explanatory, you edit the values to whatever you want them to revert back to after you disable gaming boost.

Make sure you edit all the values, some commands appear twice so make your you edit every instance of the value you see, a good way to check is to search for the old value when you think you have finished to see if you have missed it anywhere.

Please Note: They have to match whatever your ROM Dev uses in his ramdisk, contact him if you dont know what they are or check/modify his ramdisk yourself.

The last thing you need to edit is the file the app checks for before allowing the changes.

Above all the commands you will see "String ODGBState = SubActivities.readFile(ODGB_File + "/up_threshold", true);"

This basically means the app will check the value of "up_threshold" and if the value in the app doesn't match the value in the ramdisk the app won't work.

This is where things may get a little confusing.

The value for the checkfile for when the app is disabled is actually found in the second block of commands, where the optimized values are.

Just above the commands you will see "int iDisabled = 85;"

The "85" is the value of the up_threshold you have just modified in the previous steps, so change that to match what you tweaked it to.

Exporting the APK.

Once you have done all the editing you want to export the apk for use.

On the left hand side pane, the 3rd from the bottom in list you will see "AndroidMnifest.xml". Double Click it.

In the main windows about three quarters of the way down you will see the "exporting" tab. Click on "export an unsigned apk"

Choose a name and where you want to save the app and click save.

A pop up will come up when its saved.

From there all you need to do is sign the APK and push it to system/app, or include it in your ROM ZIP.

This may not be a 100% perfect tutorial but its worked for me, i'm still learning.

If anyone see's any errors please point them out.

Thank you.

SOURCE CODE