Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Support SBC
Browse files Browse the repository at this point in the history
  • Loading branch information
lich0 committed Oct 1, 2024
1 parent 57b0d46 commit 3cd298e
Show file tree
Hide file tree
Showing 23 changed files with 992 additions and 294 deletions.
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ todos:
* Start daemon on system reboot
* Floating window on iOS12

1.7版本更新日志:
* 增加对SBC的支持
* App服务分离, 防止越狱环境下某些插件导致服务崩溃

1.7 ChangeLog:
* Support SBC
* Seperate Daemon from App, to make it compatible with some tweaks

1.6.1版本更新日志:
* 增加对有线充电宝的支持
* 增加阿拉伯语
Expand All @@ -14,6 +22,7 @@ todos:
1.6.1 ChangeLog:
* Support wired power banks
* Arabic language added
* Add UI support for iOS17.0

1.6版本更新日志:
* 增加温度模拟(即Powercuff)及峰值性能状态管理功能
Expand Down
2 changes: 1 addition & 1 deletion ChargeLimiter/Package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: chaoge.ChargeLimiter
Name: ChargeLimiter
Version: 1.6.1
Version: 1.7
Description: ChargeLimiter
Section: Applications
Depends: firmware (>= 5.0)
Expand Down
4 changes: 2 additions & 2 deletions ChargeLimiter/Package/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

chown -R root:wheel /Applications/ChargeLimiter.app
chmod +s /Applications/ChargeLimiter.app/ChargeLimiter
chmod +s /Applications/ChargeLimiter.app/ChargeLimiterDaemon
chown root:wheel /Library/LaunchDaemons/chaoge.ChargeLimiter.plist
killall -9 ChargeLimiter
killall -9 ChargeLimiter ChargeLimiterDaemon
launchctl load /Library/LaunchDaemons/chaoge.ChargeLimiter.plist
uicache mobile; uicache --path /Applications/ChargeLimiter.app

Expand Down
4 changes: 2 additions & 2 deletions ChargeLimiter/Package/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

/Applications/ChargeLimiter.app/ChargeLimiter reset
/Applications/ChargeLimiter.app/ChargeLimiterDaemon reset
launchctl unload /Library/LaunchDaemons/chaoge.ChargeLimiter.plist
killall -9 ChargeLimiter
killall -9 ChargeLimiter ChargeLimiterDaemon
uicache mobile

exit 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
<key>Label</key>
<string>chaoge.ChargeLimiter</string>
<key>Program</key>
<string>/Applications/ChargeLimiter.app/ChargeLimiter</string>
<string>/Applications/ChargeLimiter.app/ChargeLimiterDaemon</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/ChargeLimiter.app/ChargeLimiter</string>
<string>daemon</string>
<string>/Applications/ChargeLimiter.app/ChargeLimiterDaemon</string>
</array>
<key>ExecuteAllowed</key>
<true/>
Expand Down
2 changes: 1 addition & 1 deletion ChargeLimiter/Package_rootless/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: chaoge.ChargeLimiter
Name: ChargeLimiter
Version: 1.6.1
Version: 1.7
Description: ChargeLimiter
Section: Applications
Depends: firmware (>= 5.0)
Expand Down
4 changes: 2 additions & 2 deletions ChargeLimiter/Package_rootless/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

chown -R root:wheel /var/jb/Applications/ChargeLimiter.app
chmod +s /var/jb/Applications/ChargeLimiter.app/ChargeLimiter
killall -9 ChargeLimiter
chmod +s /var/jb/Applications/ChargeLimiter.app/ChargeLimiterDaemon
killall -9 ChargeLimiter ChargeLimiterDaemon

chown root:wheel /var/jb/Library/LaunchDaemons/chaoge.ChargeLimiter.plist
launchctl load /var/jb/Library/LaunchDaemons/chaoge.ChargeLimiter.plist
Expand Down
4 changes: 2 additions & 2 deletions ChargeLimiter/Package_rootless/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

/var/jb/Applications/ChargeLimiter.app/ChargeLimiter reset
/var/jb/Applications/ChargeLimiter.app/ChargeLimiterDaemon reset
launchctl unload /var/jb/Library/LaunchDaemons/chaoge.ChargeLimiter.plist
killall -9 ChargeLimiter
killall -9 ChargeLimiter ChargeLimiterDaemon
uicache mobile

exit 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
<key>Label</key>
<string>chaoge.ChargeLimiter</string>
<key>Program</key>
<string>/var/jb/Applications/ChargeLimiter.app/ChargeLimiter</string>
<string>/var/jb/Applications/ChargeLimiter.app/ChargeLimiterDaemon</string>
<key>ProgramArguments</key>
<array>
<string>/var/jb/Applications/ChargeLimiter.app/ChargeLimiter</string>
<string>daemon</string>
<string>/var/jb/Applications/ChargeLimiter.app/ChargeLimiterDaemon</string>
</array>
<key>ExecuteAllowed</key>
<true/>
Expand Down
7 changes: 4 additions & 3 deletions ChargeLimiter/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
#include <dlfcn.h>
#include <ifaddrs.h>
#include <objc/runtime.h>
#include <os/log.h>
#include <spawn.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <unistd.h>

#import <os/log.h>
#import <Foundation/Foundation.h>
#import <IOKit/IOKitLib.h>
#import <IOKit/hid/IOHIDService.h>
#import <UIKit/UIKit.h>

#define NSLog2(FORMAT, ...) os_log(OS_LOG_DEFAULT,"%{public}@", [NSString stringWithFormat:FORMAT, ##__VA_ARGS__])
Expand All @@ -24,12 +26,11 @@
#define FLOAT_ORIGINY 100
#define FLOAT_WIDTH 80
#define FLOAT_HEIGHT 60
#define log_prefix @"ChargeLimiterLogger"

#define LOG_PATH "/var/root/aldente.log"
#define CONF_PATH "/var/root/aldente.conf"
#define DB_PATH "/var/root/aldente.db"

extern NSString* log_prefix;

#endif // common_h

Loading

0 comments on commit 3cd298e

Please sign in to comment.