[Verizon HTC One (M8)] digitalhigh:
Aaaaaaaaaaaaaaaaannnnnnnd....we've found our first bug.

This is a result of converting the modpack from Lyapota's version to my installer. Actually...let me explain how the whole process works, and why my method is still a little buggy.

So, Lyapota's installer for the modpack assumes you've already flashed and booted the ROM. It expects there to be databases for settings storage, specifically. His installer runs a file, tweaks.sh, which converts the aroma settings into database flags for most of the tweaks. Many of them he's added himself on top of standard GPE db setting entries.

The issue I have is - most of the time folks are doing a clean install, which means there isn't a database there to modify. A hacky way to do it would be to just flash clean, boot, grab the db, and insert when I install the rest of the ROM. But this is not good form, per se, so I came up with a way of passing the values to a special prop file that I put in /etc.

Then, on boot, the 01houskeeping script in init.d grabs this file, sources it (runs it like a regular script, which automatically sets a bunch of variables to the values of what's in the prop file, then uses a modified version of the tweaks.sh script I made to insert all the values you select on install into the databases, which then tells the Modpack to set the battery to whatever, or enable the persistent menu button, or a bunch of other stuff.

With me so far?

With that said, in previous version of mine and his mods, the battery percentage was a standard sql entry you could make, either on or off, by sending a 1 or 0 with the sqlite3 binary. With the new "outside" percentage, he's now writing a 0 for none, 1 for inside, and 2 for outside.

Still with me?

So, in his installer, he gets a 1 from the first aroma prompt for battery. This triggers a second prompt, which then asks *again* if you want none, stock, or outside. He then uses another bit of script to read this, evaluate it, and then write *that* value to the tweaks.sh script, which then inserts it.

I didn't like this, because why would you ask somebody something twice only to have to make the answer hard to understand?

In my installer, previously, I was being dumb and reading the results of the mods selection (mods.prop), then evaluating each value and writing a specific value to my magic prop file. this is a waste of code. The right way to do it is to just read what's in the mods.prop file, get the value, then write the same value to the magic prop file. So, if you pick to use the persistent menu, it writes item0.3=1 to mods.prop. If you don't use it, it's item0.3=0. Backkey to kill on? item0.2=1. Off? item0.2=0.

So, I can take and read what item0.2 is, write it straight to the prop file instead of a bunch of IF THEN stuff. Script reads the prop, writes it on boot.

STILL with me? Jesus...what am I doing? LOL.

So. The reason, in short, why battery percentage is probably not working correctly is in how I translated his installer to mine, specifically in the bit about passing the 0,1, or 2 to the script that makes it happen. I'm now making a different prop file just for the battery setting, and I had to juggle around the sequencing to make it so. I had it right in an earlier build, but I had other issues that made me scrap it and I missed that bit of code in the update.

Wheee. That was fun. I'm going to go drink some beer now.:eek: