yashsingh1/xdaforums huggingface dataset:
[Magisk] xtam:
[MENTION=5228676]VR25[/MENTION]

---------- Post added at 09:45 AM ---------- Previous post was at 09:31 AM ----------

Ok, version cs-test from

https://xdaforums.com/apps/magisk/module-magic-charging-switch-cs-v2017-9-t3668427/page67

works, but does not save settings.

I set cs 80 70

but it stopped charging at 80, just like there would be default loaded, i tried many times,

cs 80 70

cs -s

cs -s

reboot

cs 80 70

reboot

in cs -i it says correctly but functionally it works that it is ignoring 70 and stops at 80 [MENTION=5228676]VR25[/MENTION]

sorry, i think it works fine, will test more.
[Magisk] abuttino:
[MENTION=5228676]VR25[/MENTION]

Is there some way that you can put a new line in the cs -i to show that the phone is plugged in or not?

I run a few Tasker actions if the phone is plugged in or unplugged.

Or, is that impossible?

Sent from my Pixel 2 XL
[Magisk] Dinesh 1C0N:
I am unable to put command in terminal!
[Magisk] Dinesh 1C0N:
Uninstall/remove module still not charging.

I uninstall or remove module from magisk but still by default my battery not cjarging above 80%, its always disconnecting at 80%. Please do soemthing. I facing lots of problem just by your magic charging switch module. I just want to cleanup fully and re back as normal.
[Magisk] xtam:
what if you do:

su

cs -d

or

su

rm -f /data/media/cs/config

or go into twrp and use magisk manager from recovery terminal and remove module?
[Magisk] donny110:
Okay.. It's kinda strange.. Just now it did work for stopping.. Also the charging led stopped.. But after reaching the lower level at which it should charge it did not.. Even after replugging and doing cs - d cs - e.. Then after a reboot.. I put the upper charge level at 85 and it simply keeps charging and doesn't stop, it's behaving kind of weird..
[Magisk] guest4711:
After removing the module from MagiskManager you have to reboot your phone to stop cs.
[Magisk] xtam:
Which one is better, original (cs-test for 14.6)

or

https://github.com/sjayminsgithub/MC-s-Charging-Controller/blob/master/MC-s-Charging-Controller.zip

what are differences ? [MENTION=5228676]VR25[/MENTION] [MENTION=8570610]MCMotherEffin'[/MENTION]

which one should i flash and why?
[Magisk] donny110:
I'm afraid you've just opened a can of worms that should not have been opened?
[Magisk] Jaymin.0.1910:
1) Mine has support for all Magisk versions without hardcoding

2) It don't have manual charging ctrl, tasker/macrodroid profiles, and "cs -x" like functionalities, see README for which are available

3) Mine don't reset battery stats after pause, only manually via running "mcc --breset"

4) It don't support [ PAUSE % ] [ RESUME % ] via terminal, only via service ( which I call daemon mode )

5) It can resume service without rebooting

6) It has different code for finding the hook into kernel ( which make ctrl_files_db unnecessary )

7) It always picks the settings in real-time

8) It has been re-built from scratch with performance and reliability in mind

9) It uses Magisk built-in busybox by default for to prevent command errors

10) It's about half size the original CS
[Magisk] xtam:
CS has some Samsung modes...which i should or should not enable..i dont know (-x) `-x` --> toggle store_mode/batt_slate_mode (Samsung); charging_enabled/battery_charging_enabled (others)

i have note 8 samsung exynos like in signature.

I dont use this -x but maybe i should, what about your version, will it work on samsung?
[Magisk] Jaymin.0.1910:
I haven't tested it on a samsung device ( if you try, i'd be glad ) , but, it works flawlessly on my leeco le max 2 x829

---------- Post added at 02:45 PM ---------- Previous post was at 02:32 PM ----------

store_mode and battery_charging_enabled generally do take the current from the cable, but, not let it charge the battery, so, battery level won't increase while, charging_enabled stops taking current from charger ( like, the circuit is messed ) and for batt_slate_mode, I don't know what it do
[Magisk] iluvatrix:
Not compatible with Nexus 6 on official LOS 14.1

Please help, thanks
[Magisk] Jaymin.0.1910:
Please try the new build
[Magisk] abuttino:
You really should start your own thread. This is going to lead to confusion.

Sent from my Pixel 2 XL
[Magisk] JeNy #19:
Charging problem

When I charge at 80% (cs 60 45) instead of pausing charge till it drops 45% it just continue charging from that 80%. Running Lenovo P1a42 (6.0.1) stock
[Magisk] VR25:
Run cs -x and test that again.

# 2017.12.22 (201712220)

- Magisk v14.6 support

- Enhanced `cs debug`

- Installer verbose always ON

- Top to bottom optimizations

- Updated control files database

**Release notes**

- `cs -x` switches between available control files for supported devices. For instance, Samsung devices have `store_mode` & `batt_slate_mode`; stock/near-stock Android smartphones have `charging_enabled` & `battery_charging_enabled`. Use the command only in case of charging control inconsistencies.

- Owners of "still unsupported devices", please install this version and upload a new debug zip/log generated by it.
[Magisk] donny110:
Starts charging nicely, but does not seem to stop.. Should I try the cs - x for good measure or is this something else?
[Magisk] iluvatrix:
Reporting that "MCC --breset" does not reset battery stats on my Nexus 6 on official LOS 14.1 with magisk beta 14.6 either while connected to charger or disconnected from charger.
[Magisk] xtam:
[MENTION=5228676]VR25[/MENTION]

I have samsung n950f exynos dual sim note 8.

Should i use -x ?

What exactly is this Samsung devices have `store_mode` & `batt_slate_mode`;

?

what are pros and cons and differences between -x and not -x for samsung, what is store_mode and batt slate mode, how is it different than normal android charging/battery enabled

?
[Magisk] ves626:
I'm having the same problem as [MENTION=7389939]donny110[/MENTION] above... The phone doesn't stop charging at the specific limit...
[Magisk] VR25:
[MENTION=7389939]donny110[/MENTION], [MENTION=3525574]xtam[/MENTION], [MENTION=8444425]ves626[/MENTION] & others, different [groups of] devices use different charging control files (switches) and some have more than one.

Now, whether one is more reliable than the other(s), I don't know for all -- since I can't own every single smartphone out there. So, this is up for you (the community) to test.

That's why I came up with cs -x. As previously stated, the command switches between available control files and is used once and only when charging control is inconsistent (not working properly).

The next cs version will cycle through all the available control files automatically. This will render cs -x obsolete -- thus making users' lives a bit easier.
[Magisk] JeNy #19:
Me too.
[Magisk] Dolly Driver:
Incompatable device

Hi the switch does not work on my Doogee X7 pro
[Magisk] VR25:
# 2017.12.24 (201712240)

- `cs -s` & `cs -s --enable/disable` -- toggle pause/resume & enable/disable service

- Enhanced device compatibility assessment

- General optimizations

- Minor cosmetic changes

- New charging control algorithm (automatically cycles through available control files to make sure charging is enabled/disabled; `cs -x` is officially dead)

**Release notes**

- 2nd call: owners of "still unsupported devices", please upload new debugging data. Reverse engineering this stuff can take a while. The sooner you provide me the data, the closer you'll be to having your devices supported.

- Previous settings will be wiped.

Will take a look.
[Magisk] bombername:
Htc 10

Thanks in advance! =)
[Magisk] VR25:
Odd... that's a supported device. Did you try the latest build (2017.12.24)?

Recall that battery must be charging during initial setup.
[Magisk] xtam:
updated to latest build, but su cs - not found [MENTION=5228676]VR25[/MENTION]

---edit:

installed again, works fine now
[Magisk] bombername:
Damn...you've right.

Will try it.
[Magisk] donny110:
It's kind of strange?.. Yes it's charging while trying it.
[Magisk] :
What is initial set up? What command in a terminal would that be or when would that happen?
[Magisk] guest4711:
simply run the first time

su -c cs

after installation and reboot
[Magisk] :
Hm, alright, thanks!
[Magisk] CyberHawk44:
Samsung Galaxy S7 with AOKP-Rom

Here is cs_debug for S7 with AOKP
[Magisk] bombername:
Does not work even when I charging the device.
[Magisk] abuttino:
[MENTION=5228676]VR25[/MENTION]

12.24 broke Pixel 2 XL again

https://drive.google.com/file/d/1csg44mAafZWCFta9wLLEs0ibLHxCUtGc/view?usp=drivesdk

Sent from my Pixel 2 XL
[Magisk] iluvatrix:
Any reason why nobody is trying the forked version?
[Magisk] freeman_108:
Debug log

Stop charging at 70% but can't edit setting unsupported device
[Magisk] VR25:
To Everyone Facing Issues

Recall that installation and initial setup process is as follows:

1. Newer version? Install; same version? Run touch /data/r, then install -- or else, the module will be uninstalled. That's the "flash same version again to uninstall" feature.

2. Make sure battery is charging.

3. Reboot & wait a bit to allow cs service to do its job (including initial setup) or jump right in with su -c cs.

4. Now you can unplug the charger (no need to reboot again)

If you followed the steps accordingly, say YAY!

Anyway, with the device plugged in and charging, what's the output of su -c cs?

Edit: enable verbose (cs -v) to get even better logs.
[Magisk] psychoela:
[MENTION=5228676]VR25[/MENTION] thanks for new updated,but still not working here
[Magisk] Jaymin.0.1910:
[MENTION=8570610]MCMotherEffin'[/MENTION] here,

Thanks for your report:laugh:, the thing basically is that the difference between his method and mine of hooking into kernel, he uses a predefined database whereas mine do work more on an advance level, so, mine is most likely to work if your kernel allow you to turn charging ON / OFF

The second thang, I didn't fork his project, I recreated an entire new project taking his project as a reference
[Magisk] iluvatrix:
You may wish to try the forked version, it does work for my Nexus 6 flawlessly.

---------- Post added at 08:16 AM ---------- Previous post was at 08:14 AM ----------

Sorry for referring to your version as forked. Would you be opening a thread for discussion about your version?

Just 1 bug so far is that "mcc -- breset" does not reset the battery stats though the result in terminal show reset successful.
[Magisk] Jaymin.0.1910:
I'm busy 3 or more days to some regular life stuff, then I'd re-check every single portion and create a new thread:)

---------- Post added at 08:27 AM ---------- Previous post was at 08:23 AM ----------

Try the today's build from https://github.com/sjayminsgithub/MC-s-Charging-Controller, if that fails, try from terminal "dumpsys batterystats --reset" and tell the output:)
[Magisk] xtam:
[MENTION=5228676]VR25[/MENTION]

this build from 24.12 does keep settings correctly?

I had it installed, cs 80 70

today had to do reboot and back up all system in twrp,

after booting phone back i connected charger and did cs -i and settings were 90 80, not 80 70 as i set previously, why?

do i have to cs 80 70 after every reboot?
[Magisk] VR25:
It seems some devices don't pick up control file changes fast enough...

[MENTION=6263858]psychoela[/MENTION] & others, try the attached test build.

Remember to run the "force reinstall" command (touch /data/r).

No, you don't have to reconfigure after every boot.

Did you wipe /data/media?

cs' data is stored there.

Aren't you violating the GNU General Public License? :D
[Magisk] xtam:
[MENTION=5228676]VR25[/MENTION] i did not wipe anything, i only did backup.

---------- Post added at 11:24 AM ---------- Previous post was at 11:23 AM ----------

this cs test is for me too?
[Magisk] psychoela:
Run commnd then flash reboot,cs stil not working, unsupported device.

Btw where is location config file? older version 22/12 are not working but manual edit switch to /sys/class/power_supply/battery/charging_enabled

working fine,now config file not have at data/media/cs.:D. I already try cs -c, but i receive "incompatible control file" sory for my bad english:D
[Magisk] iluvatrix:
"dumpsys batterystats --reset" does perform successful reset & the output shows "Battery stats reset"
[Magisk] Hastaloego:
then why does it say:

(!) cs path not found

- Unsupported Magisk version

1|OnePlus5:/ #
[Magisk] cLeAv0:
Not working on nexus 9. Attached debug data
[Magisk] :
Delete
[Magisk] :
Follow your instructions and got this
[Magisk] lukas23:
The module worked after the initial installation.

But when i reboot my phone, the module didn't work anymore.

Sorry for my english.

View attachment cs_debug-Android_clark.zip
[Magisk] Hastaloego:
[MENTION=5228676]VR25[/MENTION]

Oneplus 5 - official Oreo OTA - Magisk v15 - CS 24.12.17

Device suddenly no longer supported
[Magisk] VR25:
It's that time of extra excitement again -- a new Magisk version is up!

A couple of changes need to be reviewed before pushing the new cs, though...

Expect an update soon.
[Magisk] JeNy #19:
Mine is still unsupported. Here's the zip.

https://www.datafilehost.com/d/8a388884

Sorry, I can't upload here in xda
[Magisk] cornelpopa:
Oneplus 3, freedom OS Ce 3.2, magisk 16.
[Magisk] CyberHawk44:
Random reboot

Hi,

I have Samsung S7 with AOKP-Rom

With Magisk 14.6 I have sometimes a Reboot and with Magisk 15.0 after the reset a Boot-Loop

I have enable verbose-log but there have not log anything, the log files have 0 byte.....
[Magisk] Ridsever:
I updated to the latest version and it stopped working.

Unfortunately i don't remember what version I had...
[Magisk] Sreekantt:
Showing unsupported on honor 6x in latest update...Here is the log

Still my last perfectly working version 2017-Nov-19-2

Afraid to flash it back because magisk 15 compatibility

Pls look into it bro
[Magisk] mguenth83:
Hi,

could you support the Leeco Le Pro 3?

Heres my debugging ZIP.
[Magisk] JustinTrouble:
It works great on my LeEco Le Pro 3.

zl1:/ # cs -i

(i) Checking compatibility...
- REMINDER: battery must be charging -- or else, the assessment will fail.

(i) Congratulations, your device is supported!

However it didn't work when I upgraded to Magisk 15. I'm about to uninstall and install Magisk 14 and Magik Manager 5.3.0.
[Magisk] SeishiNui18:
Motorola XT1663

[MENTION=5228676]VR25[/MENTION]

Hi, would like to try your module. Here's the log.
[Magisk] Telperion:
Had issues on my Pixel 2 coming from prior versions, was getting 'cs not found' errors no matter what I tried. Finally 'touch /data/r touch /data/b' prior to installation fixed it.
[Magisk] abuttino:
Get the cs version a few pages back that vr25 built for me.

Sent from my Pixel 2 XL
[Magisk] Telperion:
The most recent version in the repo works, just have to run a few terminal commands before installation.
[Magisk] abuttino:
Didn't work for me. Are you on the 2XL or 2?

Sent from my Pixel 2 XL
[Magisk] :
If you could give a little list instructions for this, that'd be awesome! Haven't been able to get this to work and since you have, it'd be great if you could share exactly how to set everything up. I have the Pixel 2 XL btw, but I'm sure both set ups are near identical. Thanks :) [MENTION=3694505]Telperion[/MENTION]
[Magisk] abuttino:
I'm pretty certain that these phones (2 [HTC] and 2XL [LG]) are not the same at all. Different manufacturers, different battery type, all scream that it's not the same at all. As far as I know, the cameras, Pixel Imaging Chip and the processor, as well as, the OS are the only thing these share.

Sent from my Pixel 2 XL
[Magisk] :
I understand that, but the software they run is the same. So if the hardware isn't drastically different, the software should be similar or related I meant... Not exactly identical but you get the point lol
[Magisk] abuttino:
Have you seen the way this software works? Look at a debug log and see how each charger is different for every phone.

It's quite impressive but I'm sure it's also very tedious for [MENTION=5228676]VR25[/MENTION] to keep up on.

Sent from my Pixel 2 XL
[Magisk] :
Ok you're missing the point but whatever lol. Yes I understand that
[Magisk] Telperion:
[MENTION=6280728]xdnax[/MENTION] [MENTION=336570]abuttino[/MENTION]

Remove any versions of the module through Magisk Manager, reboot device

Open a root terminal

Type 'touch /data/r'

Type 'touch /data/b'

Install module through Magisk Manager

Reboot device (I plugged in the charging cable while it was rebooting, may be irrelevant but replicating my exact process for accuracy's sake)

Verify with root file manager that /sbin/.core/img/cs/ exists

Open root terminal and type 'cs -i'

If it works, you'll see the status and can then set your own values if desired
[Magisk] :
Thanks :)))
[Magisk] Macusercom:
Unfortunately, this does not seem to work on my new OnePlus 5T but it worked with my Nexus 6P before. The ZIP file I should post is attached here.
[Magisk] vietcnttit:
issue with Z00T

it show "no compatible charging control file ..." >> unsuported device

atth my cs_debug-asus_Z00T.zip file
[Magisk] :
Just tried exactly on my Pixel 2 XL and it said device must be charging for assessment (which it was) and no control files found. I followed your steps exactly. Weird.
[Magisk] alextytan:
Same here
[Magisk] Telperion:
Odd, can't really help you out then.
[Magisk] VR25:
Here's something for those who have been eagerly waiting for a new release!

If this ends up doing good, I'll push it to the repo soon with some additional changes and a proper documentation (inc. a full changelog).

"touch /data/r /data/b" team -- you no longer need that. Simply install right off the bat.
[Magisk] :
Ah, I have a taimen... Maybe no support yet.
[Magisk] psychoela:
Cs test version working perfect here:victory:
[Magisk] :
Just tried to test the new zip on my Nexus 6 too android 8.1 and its not working. I can't get this thing to work on any of my devices... Here's the log ugh [MENTION=5228676]VR25[/MENTION]

Flashed module in TWRP, then plugged phone in, in terminal ran cs -i and nothing, just errors.
[Magisk] psychoela:
Are u confirm using test version not 24/12 version?
[Magisk] :
I flashed the zip he linked above a few posts.. same one you did
[Magisk] VR25:
I'll ask the same question... did you really install the build from post #755? Your debug file format is from an older version.
[Magisk] abuttino:
[MENTION=5228676]VR25[/MENTION]

All is working great on your newest test version from today on 15.1.

Glad to have the new options back. Great plugin. It's unfortunate that this is so tedious.

One question for you though.

Are the Pixel 2 and the Pixel 2 XL different? It was a question that a couple of us had.

Thanks again!

A.B.

Sent from my Pixel 2 XL
[Magisk] xtam:
[MENTION=5228676]VR25[/MENTION] flashed this

File Type: zip	cs_test-2017.12.29.zip from #755 on magisk 15.0

and after restart phone does not boot, only restarts to recovery, tried multiple times.

had to flash in twrp version from 24.12 and booted normally.

(phone model in my sig)
[Magisk] :
And.... there we go! I guess since I unchecked the downloaded module and didn't reboot to get rid of it, when I flashed the new zip (which I did), it didn't change it? Well I just uninstalled the module in Magisk, rebooted, then rebooted again to recovery and flashed the new zip, and its all working perfectly! Thank you very much! :)
[Magisk] abuttino:
[MENTION=5228676]VR25[/MENTION] won't stop charging on today's build :(

Pixel 2 XL.

Sent from my Pixel 2 XL
[Magisk] VR25:
Yes, they are -- but just a little bit.

While both devices have almost identical internals, their firmware+software portions are "slightly" less alike. ;)

I see...

Try the following:

1. Run touch /data/x as root.

2. Install the attached build and reboot.

[MENTION=336570]abuttino[/MENTION], which switch is cs using? Run cs -i and look at SWITCH=. If it ends in "battery_charging_enabled", open /data/media/cs/config & replace that part with "charging_enabled". Else, do the opposite. Test charging switch with cs -d & -e options.

Looks like cs -x may have to come back from the dead...
[Magisk] add_pl:
Not working for me.
[Magisk] cantenna:
Hi VR,. first time user, S8+ Nougat, cs - i states compatible but didnt stop charging. Using build from post #755.

Update; tried offical availble in repor, it says device is incompatible.

Cheers:)
[Magisk] VR25:
# 2017.12.30 (201712300)

- Better compatibility (devices & Magisk)

- `cs -x` is back -- run it once if charging doesn't stop. Refer to the README for details.

- General optimizations

- New and enhanced debugging engine

- Updated charging switches database

- Wait for charger before initial setup instead of just reminding the user to plug it in.

**Release notes**

- 3rd call: owners of "still unsupported devices", please upload new debugging data. Reverse engineering this stuff can take a while. The sooner you provide me the data, the closer you'll be to having your devices supported.

- Bootloop? Run `touch /data/.xcs` as root before installing. Unless you clear /data or I change the key, this flag is only needed once.

- Previous settings will be wiped.
[Magisk] SeishiNui18:
Doesn't work for me. It sits on "Checking compatibility" for a few seconds then reboots my phone. I don't know if I can send you anything to check it out but I don't know where to get a log of it.
[Magisk] SeishiNui18:
It works. Here's what I got:

Though there's permission issues.
[Magisk] VR25:
Cool. That should be easy to fix, thanks.
[Magisk] SeishiNui18:
Nice, will be waiting for your update on the repo. Glad to help in any way. Thanks.
[Magisk] S2_fa_007:
Newest 12.30 with Magisk 15.1 seems to work on OnePlus 5, but Galaxy S5 reboots everytime I attach power cord, now trying test from #773

Edit:

Test build is working but has permission issues, as stated by SeishiNui18
[Magisk] VR25:
# 2017.12.30-1 (201712301)

- Fixed permission issues & unexpected reboot upon initial setup

- General optimizations

- Updated debugging engine & charging switches database

**Release Notes**

- Bootloop? Run `touch /data/.xcs` as root before installing. Unless you clear /data or I change the key, this flag is only needed once.

- `cs -x` -- run it once if charging doesn't stop. Refer to the README for details.
[Magisk] abuttino:
This seems to have fixed it.

Sent from my Pixel 2 XL
[Magisk] CyberHawk44:
I have with `touch /data/.xcs` a bootloop.

I use latest version.

Samsung S7 with AOKP
[Magisk] VR25:
... But, did you try cs -x?

You don't need touch /data/.xcs then.

Do the following:

1. Remove /data/.xcs

2. Run touch /data/r

3. Reinstall the module
[Magisk] CyberHawk44:
I have try it and a bootloop :(
[Magisk] abuttino:
What is the best way to keep the battery at 90% without the charging system going haywire enabling and disabling it every microsecond?

Sent from my Pixel 2 XL
[Magisk] VR25:
Hm, thought I've added it already... :rolleyes:

Are you on 2017.10.8.1 build?

EDIT: [MENTION=7554588]Ph4[/MENTION], do you see "Nexus 5" in the output of getprop | grep 'Nexus 5'?
[Magisk] guanto96:
It says [ro.product.model]: [Nexus 5]
[Magisk] ghbuur:
yippee you made work on s7e :good:
[Magisk] Eng.Raman:
Still cannot run "cs debug" code.

Big thanks for your hard work bro.
[Magisk] DuskGolem:
[MENTION=5228676]VR25[/MENTION], Bro the new update broke the module on my Xperia Z5 Premium E6833 stock rom 7.1.1. The previous version (2017.9.10) was working flawlessly. This new version gives me "unsupported device error". Please help, I cannot even get the debug log. See the screenshot below. Meanwhile i'm gonna use the previous version
[Magisk] VR25:
# 201710900

- Additional devices support

- Bug fixes & optimizations

- "cs debug" should work now
[Magisk] guanto96:
Nexus 5, latest version

I got these problems, what I have to do? It's because it stills unsupported?

Thank you for your work
[Magisk] innit:
hey, would it be possible to add support for Galaxy S8/S8+ and Note 8?
[Magisk] ghbuur:
try if it works. I'm using batman s8 port on s7e and it works.