yashsingh1/xdaforums huggingface dataset:
[Moto G Original Android Development] hemantkarandikar:
Installation failed

On Moto G 2013 with CM 13 nightly I tried flashing Maxlife using twrp 2.8.7.0 recovery. Error message said installation failed.

Any suggestions?

Thanks
[Moto G Original Android Development] elrod16:
Do you have enough room for installation on your System partition?

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] hemantkarandikar:
I checked using Root Explorer System shows 203.13 MB free
[Moto G Original Android Development] elrod16:
Have you tried redownloading it, maybe it was corrupted for whatever reason? Or is there any kind of signature verification you have enabled? Would you be up for trying another recovery if those suggestions don't work for ya?

Edit: I redownloaded it from the link on my wife's phone and my own phone and reinstalled it with the download and it succeeded.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] hemantkarandikar:
Could flash maxlife and edit values to 90, normal. But the process doesn't run unless launched by executing maxlife command. Also on boot the process isn't running when seen with ps | grep maxlife
[Moto G Original Android Development] elrod16:
See what i said about file formats earlier in the thread. Not all text editors save text in a Linux friendly format by default.

Edit: The fact that it is launchable from the Terminal points to either not having init.d or the editor used to change the settings in the launch script is probably saving it in MS-DOS encoding and not UNIX. Earlier in the thread I explained it, provided information on my preferred editor, and provided a screenshot of the menu with the setting you must beware of. The latest build of maxlife provides an error message when launched in a Terminal on a phone it knows it can't run on, so seeing that that wasn't shown in your screen shot, the above mentioned suggestions should be the direction you investigate. Also when launched with no arguments maxlife defaults to the hardcoded setting of "90% charge at nornal speed". Let me know if those ideas get it working for you.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] hemantkarandikar:
Tried again even without editing the file (to rule out text format issues). The process doesn't run unless launched by executing maxlife command. Also on boot the process isn't running when seen with ps | grep maxlife

(moto G cm 13 nightly). Just some doubts:

1. Does one need to clear cache \ dalvik or system?

2. Does one have flash it at same time of flashing CM 13 ? (lie one has flash gapps along with ROM without booting) ?
[Moto G Original Android Development] Ohhdayumm:
Hello I installed the mod and wipe dalvik cache and activated it through terminal emulator and I changed the number 85 to 100 and it didn't work? Did I do something wrong. When I said it didn't work I mean it stopped at 85 still after saving the file and rebooting
[Moto G Original Android Development] elrod16:
That would mean your init.d isn't working for some reason. It is a native program, it runs at the Linux level, not the app runtime level. Are you sure you have init.d support? And the permissions are correct? If it runs from terminal but not on boot that means your ROM/kernel setup isn't running init.d or file permissions are wrong. If you don't have working init.d you could still run maxlife from the terminal as "maxlife your-percent-here your-speed-here" and have it work though it would be less convenient.

You don't run it or activate it through terminal emulator. If your ROM/kernel has init.d support, it just runs on boot using the settings in the 91bms file. Unless you changed the line in 91bms (with system mounted read/write), simply launching it in terminal with a new value will not work because the copy of it that launched on boot is still running with the old setting, you just end up with two copies of the process fighting each other. Also, setting it to 100 somewhat defeats the purpose of the tool.

Two both posters:

The program has been verified to work on all moto g's and other Qualcomm based devices, on Android KitKat, L, & M, so it is not a program issue. It has to be something specific to the setup you have on your device (like no init.d or busybox), or not saving the file correctly.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] Sniper Killer:
Hi

I recently installed this tool and It came off to work. But, one problem is that everytime i edit the 91bmsb script on ES File explorer, it tells me that it cannot be saved. I mamaged to edit it with root explorer and set these values : Maxlife 95 normal, but the charging didn't stop at 95% but 89%. It kinda weird how this could happen because even the default values were set 85 turbo. Also when i view the file in es file explorer at the text format tabs shows UNIX so i don't think there is a problem with file format at all. I own a MotoG 4G XT1039 (peregrine) which runs in a custom ROM with init.d support. Any help is appreciated.
[Moto G Original Android Development] elrod16:
That sounds like your system partition isn't being mounted writeable for ES, then root explorer isn't saving it UNIX. Maxlife defaults to 90 normal when it doesn't have properly specified settings for whatever reason.

mount -o remount,rw /system

In a terminal app would give you write access on system.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] jmonster141:
===This mod is tested and working on the OnePlus Two===

[MENTION=6190802]elrod16[/MENTION]

I run "100 turbo" and saw the old 99% charge upon opening my phone this morning. This is nice because to my understanding, there is nothing implemented at the kernel level enabling the charging to cut off when at full charge. The user manual states not to have the phone charging for over 12 hours consecutively and this mod makes sure that won't ever happen because of the stop charge upon reaching the desired charge percentage. Just a heads up if you'd wanna post this in the OnePlus Two original development sub-forum.
[Moto G Original Android Development] elrod16:
Thank you very much for the testing! That information is priceless since I have no means of testing other devices myself. I would like to release this in forums for other confirmed devices, hopefully I will have the time to do so before the end of the business week.

I do believe a lot of kernels don't completely end charging on many devices. Before devising this mod I would notice the current drop down, but never actually stop completely.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] jmonster141:
I also let the script run on default settings (maxlife 85 turbo) to make sure it was working and it stopped at 85%. It's to note though that I've had to force enable my init.d scripts to run on boot because Oxygen OS apparently has a problem with running them on its own. A lot of users use boeffla config v2 with his kernel for Oxygen OS, and there is a setting in the app to force enable init.d scripts to run on boot. I'd also include in your post that if you reach your desired charging threshold you may lose charge for up to 15 minutes before Maxlife re-checks the battery to enable it to charge. Just a heads up to ensure users aren't complaining because of their misunderstanding of how your Mod actually works.
[Moto G Original Android Development] Jude Aranha:
Hi, My OnePlus X has a Lithium-Polymer battery, is this mod needed/recommended ? Thanks.
[Moto G Original Android Development] elrod16:
Lithium polymer is hardier than lithium ion but still susceptible to heat and voltage stress, so yes, I'd still recommend it. By capping your maximum charge a little lower you'll still gain a worth while extension of its lifespan and stability.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] Jude Aranha:
Thank You, so, just flash it by TWRP & reboot ?

~Tapatalk'd v¡a my OnePlus X
[Moto G Original Android Development] elrod16:
Yep, you can edit the init.d script if necessary to adjust it more to your needs. Some people have had trouble after editing it, with saving it correctly, so you may want to read through the thread for some more info relating to that. I accidentally left the init.d script on turbo this build, so by default you'll have fast charging mode and it'll stop at 85%.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] Jude Aranha:
Sounds good, Downloading now, just out of curiosity, Fast charge upto 85% then upto 100 it will like, idk Trickle charge or something ? Also big question, what if my ROM doesnt support init.d ? You've seen my signature, what do you say ? will it run on Resurrection Remix M ? The thread is right there in my signature. If it doesnt support init.d, any way to still use this ? I'd be glad to test this out, because if this mod really works as advertised (no offense) then this needs more publicity.
[Moto G Original Android Development] jmonster141:
No. It won't charge past 85%. There are three different arguments the script can accept: slow, normal, and turbo. Out of the box, it runs at 85 turbo. I changed mine to 100 turbo for a few days but realize my phone starts warming up upon charging so quickly. So I changed the argument to 100 slow. I was able to watch videos and do miscellaneous browsing on my phone and it got back to temperature. Your mileage may vary though because you may actually lose charge if you change to "slow" if you keep using your phone while it's charging. It doesn't on my phone, but given all the different situations I can't guarantee anything. As for any init.d issues, if the folder exists in /system/etc then you have init.d support. That does NOT guarantee it actually works. I download and use Smanager to manage my scripts if that's the case. I've yet to have any editing issues as elrod talked about and you have the ability to force scripts to run at boot. You have to make sure you check "run as root" as well or it will error out. If the folder doesn't exist, download "universal init.d" from the play store. That will place the init.d folder in the correct spot with the right permissions. Flash the script in whatever recovery you want. It's worked for me on both CWM and TWRP. Upon reboot navigate in smanager to your init.d folder and move "91bms" to your SD card/internal storage somewhere easily accessible (/system MUST be mounted RW). You can uninstall universal init.d now. Go back to smanager and navigate to where you moved "91 bms". Tap it and select "run as root" and "run at boot" then save and reboot. This should give you faster charging to 85% then charging will stop for 15 minutes and then monitor if you've lost charge. Reconfiguring is easy now that the script is in your storage and NOT your system. You can edit it to your liking. Just be sure to save it after you edit it using smanager's built in file editor. I haven't had any incompatibility issues using smanager's file editor. Good luck and happy modding.
[Moto G Original Android Development] abeloman:
Will this work if I used su.d instead init.d? (scripts running with Supersu)
[Moto G Original Android Development] jmonster141:
I don't have experience using su.d. I've only used what I posted as my own personal workaround to incompatible init.d support.
[Moto G Original Android Development] elrod16:
[MENTION=4561083]jmonster141[/MENTION] thanks for helping with the tech support, I can never be sure when I'll get the time to check in here.

To the other posters, it is also important that you keep the arguments in the original order that maxlife accepts them or it will treat them as invalid. And if su.d is functionally equivalent with init.d it should work.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] dirty_smurf45:
Would the AutoSMP option for CPU Hotplug (Hurtsky Kernel for L) on Kernel Adiutor interfere with MaxLife?
[Moto G Original Android Development] elrod16:
I can't say 100% but it *shouldn't* unless it messes with things strictly outside of that scope.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] dirty_smurf45:
This tool certainly does work, but I have switched to RR Lollipop and when my target is reached (95 at slow) it simply skips all the way to 100. I cannot provide screens as I have not installed BetterBatteryStats but could this be something as simple as a cosmetic issue for me? If so, would the pause in charged and 15 minute recheck process still take place? Thanks in advance. :)
[Moto G Original Android Development] elrod16:
Yeah, its just a cosmetic issue, and it should still work because it doesnt use the same methods for checking the battery that the "fuel gauge" does, it communicates directly with the driver that handles the battery manager chip on the physical batttery, so it is a very lower level of data gathering.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] dirty_smurf45:
Given that I have the cosmetic issue, is there any way I can verify it is working properly on my Moto G?
[Moto G Original Android Development] elrod16:
You could use a terminal app and run "ps | grep maxlife" to verify the tool is running, or try a lower setting for the stop charging limit where the battery gauge won't jump like that.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] dirty_smurf45:
I found out what my problem was.

I lowered the target to 75% earlier but I forgot what my results were lol but I found out that the file wasn't being executed on boot. I used Kernel Adiutor to manually execute after I rebooted and my target (95%) was reached + charging was disabled. I can now securely sleep again :)
[Moto G Original Android Development] BryanByteZ:
Flashed in RR MM 5.6.5 i will test tonight thanks
[Moto G Original Android Development] inpamcoxie:
I need to know how exactly do we confirmed that this mod is working ?

does setting the permission to 755 for 91bms will made the mod working ?
[Moto G Original Android Development] elrod16:
Well, first, you could just install it and leave it on its default settings and seeing if it stops charging at 85%, then if it doesn't, we can troubleshoot from there. Working init.d is a prerequisite though. If it doesn't work just flashed without edits to 91bms, check init.d

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] elrod16:
For those who have problems after editing 91bms, or want to be able to change settings on the fly (no reboots or process restarting), I have uploaded a new build that has a new way of accepting settings without editing 91bms:

It checks for the file "/data/maxlife.cfg" and if it exists it parses it. The most guaranteed and fool proof way of making the file in the compatible format for MaxLife is to use a terminal app and run this code:

~su
~echo "Percent=85\nMode=turbo" > /data/maxlife.cfg
~chmod 666 /data/maxlife.cfg

Note: the tilda signify new lines/prompts in the terminal

Replace 85 and turbo with whatever you choose. Percent and Mode must be capitalized, and the value for mode must be lower case. Values in this file will be picked up as soon as it is created or edited. They also OVERRIDE values in 91bms or values used when launching it from the command line. Deleting the file restores default behavior seen in previous builds.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] BryanByteZ:
Thanks is working fine for me with 95 and turbo !
[Moto G Original Android Development] elrod16:
Thanks for the feedback, always helpful. In the time since your post I've posted yet another update (I rarely post them so close together). The new update adds entries to logcat whenever you change your settings using the new "live" settings system.

The easiest way to watch these messages is:

logcat | grep MaxLife

From there any logcat messages sent by MaxLife will appear in that terminal session showing any changes you've made to the settings.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] elrod16:
New update up. Pretty big one, read the first post and changelog for the full write up. Here is a brief summary though:

•Builtin settings editor (ex:maxlife set 70 slow) read first post for all details.

•Changed the delay to enable charging again down to 3 minutes.

•When connected to a power source system suspend is blocked. Works on everything but charging from a computer. This should hopefully help people with the deep sleep issues.

Some of these changes are experimental or may not be welcomed by all, so please update, test, and leave any feedback, including if you do not like some of the recent changes.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] reversegear:
[MENTION=6190802]elrod16[/MENTION] Thanks for this mod. i will test v1.0.6

a question : does this mod works even while charging with power off state ?
[Moto G Original Android Development] elrod16:
Unfortunately not, the phone must be in the normal on state

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] reversegear:
hi [MENTION=6190802]elrod16[/MENTION]

here is my report

1. Excellent concept :) of battery charging control

2. Builtin settings editor works like a charm

3. Detailed analysis check below screenshots

Thanks for the mod.

if someone wondering how to check whether this mod works or not here is the proof. (check Current and Max USB Current in the SS)

Slow

[IMG="Slow"]http://xdaforums.com/attachment.php?attachmentid=3709289&stc=1&d=1459934086[/IMG]

Normal

[IMG="Normal"]http://xdaforums.com/attachment.php?attachmentid=3709290&stc=1&d=1459934086[/IMG]

Turbo

[IMG="Turbo"]http://xdaforums.com/attachment.php?attachmentid=3709291&stc=1&d=1459934086[/IMG]

Edit : i have observed that the device wont boot while the charger is connected. kindly go through the logcat attached.
[Moto G Original Android Development] elrod16:
Thank you very much for the time and effort you put into your testing and report. The trouble with booting may be something with the newer android kernels, I'm still back on the 4.4.4 ROMs/kernels :/ (my whole toolchain and such is on my device, i know I'll mess something up after wiping and upgrading my ROM and trying to migrate it all over. Luckily though most of the interfaces my mod uses stay stable across ROM/kernel versions). Next build though I'll try to implement a fix, it should be very simple. If i ever have the time and motivation I'll try to make a very simple GUI frontend for the native binary to increase user friendliness.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] wald0rf:
Just to report, version 1.06 works perfect on my xt1032. Any chances of add an option to modify the 3 min limit?
[Moto G Original Android Development] ronyscomparim:
this correct this permission, if not what is the correct number of permission? please
[Moto G Original Android Development] elrod16:
[MENTION=3335876]ronyscomparim[/MENTION] You need the execute permissions all ticked.

[MENTION=7111881]wald0rf[/MENTION] Depending on feedback that value is up to change, or I may implement an "opt in" feature where adding a special flag in the settings file makes the valuable adjustable for "advanced" users while keeping it a fixed value for everyone else.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] ronyscomparim:
so this correct? [MENTION=6190802]elrod16[/MENTION] and to start the service, which procedure
[Moto G Original Android Development] elrod16:
You should just be able to flash it and reboot and have it run and then just change the settings afterwards. There is no need to manually start the service.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] elrod16:
You should just be able to flash it and reboot and then change the settings from there. There is no need for manually starting it. But yes, those permissions will work.

EDIT: Sorry about the double post, the xda app was glitching on me.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] ronyscomparim:
I changed to 90% but does not work. I am with this ron.
[Moto G Original Android Development] ronyscomparim:
I do not know what is wrong for me not this the fucionando not loading where I determine HELP
[Moto G Original Android Development] elrod16:
Reflash it, but don't edit the 91bms file manually, just use the built in settings editor. Many text editors break the 91bms file.

---------------------------------------------------

Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
[Moto G Original Android Development] wald0rf:
Today the percentage of battery charge reached 100 % , although the setting is 95 %. I used the cell until the percentage reached 94, after that again connect the charger and only then stopped at 95. Any suggestions?

Edit: Maxlife was on the list of active processes (OS monitor) when checking the load reached 100.