-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
614 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BuildMachineOSBuild</key> | ||
<string>20D74</string> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>EternalPower</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>Thorsten-Laux.ChargeLimiter</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>EternalPower</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSupportedPlatforms</key> | ||
<array> | ||
<string>MacOSX</string> | ||
</array> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>DTCompiler</key> | ||
<string>com.apple.compilers.llvm.clang.1_0</string> | ||
<key>DTPlatformBuild</key> | ||
<string>12D4e</string> | ||
<key>DTPlatformName</key> | ||
<string>macosx</string> | ||
<key>DTPlatformVersion</key> | ||
<string>11.1</string> | ||
<key>DTSDKBuild</key> | ||
<string>20C63</string> | ||
<key>DTSDKName</key> | ||
<string>macosx11.1</string> | ||
<key>DTXcode</key> | ||
<string>1240</string> | ||
<key>DTXcodeBuild</key> | ||
<string>12D4e</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>10.15</string> | ||
<key>LSUIElement</key> | ||
<true/> | ||
<key>NSMainStoryboardFile</key> | ||
<string>Main</string> | ||
<key>NSPrincipalClass</key> | ||
<string>NSApplication</string> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+891 Bytes
EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/Info.plist
Binary file not shown.
Binary file added
BIN
+70 KB
...pp/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/MacOS/LaunchAtLoginHelper
Binary file not shown.
1 change: 1 addition & 0 deletions
1
EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/PkgInfo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
APPL???? |
115 changes: 115 additions & 0 deletions
115
...Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/_CodeSignature/CodeResources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>files</key> | ||
<dict/> | ||
<key>files2</key> | ||
<dict/> | ||
<key>rules</key> | ||
<dict> | ||
<key>^Resources/</key> | ||
<true/> | ||
<key>^Resources/.*\.lproj/</key> | ||
<dict> | ||
<key>optional</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>1000</real> | ||
</dict> | ||
<key>^Resources/.*\.lproj/locversion.plist$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>1100</real> | ||
</dict> | ||
<key>^Resources/Base\.lproj/</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>1010</real> | ||
</dict> | ||
<key>^version.plist$</key> | ||
<true/> | ||
</dict> | ||
<key>rules2</key> | ||
<dict> | ||
<key>.*\.dSYM($|/)</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>11</real> | ||
</dict> | ||
<key>^(.*/)?\.DS_Store$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>2000</real> | ||
</dict> | ||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key> | ||
<dict> | ||
<key>nested</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>10</real> | ||
</dict> | ||
<key>^.*</key> | ||
<true/> | ||
<key>^Info\.plist$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
<key>^PkgInfo$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
<key>^Resources/</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
<key>^Resources/.*\.lproj/</key> | ||
<dict> | ||
<key>optional</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>1000</real> | ||
</dict> | ||
<key>^Resources/.*\.lproj/locversion.plist$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>1100</real> | ||
</dict> | ||
<key>^Resources/Base\.lproj/</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>1010</real> | ||
</dict> | ||
<key>^[^/]+$</key> | ||
<dict> | ||
<key>nested</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>10</real> | ||
</dict> | ||
<key>^embedded\.provisionprofile$</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
<key>^version\.plist$</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
APPL???? |
Binary file not shown.
Binary file added
BIN
+163 Bytes
EternalPower.app/Contents/Resources/Base.lproj/Main.storyboardc/Info.plist
Binary file not shown.
Binary file added
BIN
+35.9 KB
EternalPower.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib
Binary file not shown.
40 changes: 40 additions & 0 deletions
40
EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BuildMachineOSBuild</key> | ||
<string>20D74</string> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>LaunchAtLogin-LaunchAtLogin-resources</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>LaunchAtLogin_LaunchAtLogin</string> | ||
<key>CFBundlePackageType</key> | ||
<string>BNDL</string> | ||
<key>CFBundleSupportedPlatforms</key> | ||
<array> | ||
<string>MacOSX</string> | ||
</array> | ||
<key>DTCompiler</key> | ||
<string>com.apple.compilers.llvm.clang.1_0</string> | ||
<key>DTPlatformBuild</key> | ||
<string>12D4e</string> | ||
<key>DTPlatformName</key> | ||
<string>macosx</string> | ||
<key>DTPlatformVersion</key> | ||
<string>11.1</string> | ||
<key>DTSDKBuild</key> | ||
<string>20C63</string> | ||
<key>DTSDKName</key> | ||
<string>macosx11.1</string> | ||
<key>DTXcode</key> | ||
<string>1240</string> | ||
<key>DTXcodeBuild</key> | ||
<string>12D4e</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>10.12</string> | ||
</dict> | ||
</plist> |
8 changes: 8 additions & 0 deletions
8
...esources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLogin.entitlements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.app-sandbox</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+3.16 MB
...aunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper-with-runtime.zip
Binary file not shown.
Binary file added
BIN
+16 KB
...s/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper.zip
Binary file not shown.
49 changes: 49 additions & 0 deletions
49
...ts/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
HELPER_CHECKSUM="6eaaced9173120f82ef98452b2d8cb3705c12db39d4286c70c4f5bb6b67a5e43" | ||
HELPER_CHECKSUM_RUNTIME="c5a48f5ba681088aa7922b79f2f1b55a1a006904b8de378790eb0e8b0ac66234" | ||
|
||
verlte() { | ||
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] | ||
} | ||
|
||
if verlte "10.14.4" "$MACOSX_DEPLOYMENT_TARGET"; then | ||
helper_name="LaunchAtLoginHelper" | ||
checksum="$HELPER_CHECKSUM" | ||
else | ||
helper_name="LaunchAtLoginHelper-with-runtime" | ||
checksum="$HELPER_CHECKSUM_RUNTIME" | ||
fi | ||
|
||
package_resources_path="$BUILT_PRODUCTS_DIR/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources" | ||
|
||
helper_path="$package_resources_path/$helper_name.zip" | ||
|
||
contents_path="$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH" | ||
login_items="$contents_path/Library/LoginItems" | ||
login_helper_path="$login_items/LaunchAtLoginHelper.app" | ||
|
||
rm -rf "$login_helper_path" | ||
mkdir -p "$login_items" | ||
|
||
# Verify SHA256 checksum of LaunchAtLoginHelper. | ||
zip_checksum="$(shasum -a 256 "$helper_path" | awk '{print $1}')" | ||
|
||
if [[ "$zip_checksum" != "$checksum" ]]; then | ||
echo "Wrong checksum of LaunchAtLoginHelper" | ||
exit 1 | ||
fi | ||
|
||
unzip "$helper_path" -d "$login_items/" | ||
|
||
defaults write "$login_helper_path/Contents/Info" CFBundleIdentifier -string "$PRODUCT_BUNDLE_IDENTIFIER-LaunchAtLoginHelper" | ||
|
||
if [[ -n $CODE_SIGN_ENTITLEMENTS ]]; then | ||
codesign --force --entitlements="$package_resources_path/LaunchAtLogin.entitlements" --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$login_helper_path" | ||
else | ||
codesign --force --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path" | ||
fi | ||
|
||
if [[ $CONFIGURATION == "Release" ]]; then | ||
rm -rf "$contents_path/Resources/LaunchAtLogin_LaunchAtLogin.bundle" | ||
fi |
28 changes: 28 additions & 0 deletions
28
EternalPower.app/Contents/Resources/com.joelucid.EternalPower.epd.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Label</key> | ||
<string>com.joelucid.EternalPower.epd</string> | ||
<key>Program</key> | ||
<string>/Library/Application Support/EternalPower/epd</string> | ||
<key>KeepAlive</key> | ||
<true/> | ||
<key>RunAtLoad</key> | ||
<true/> | ||
<key>AbandonProcessGroup</key> | ||
<true/> | ||
<key>ProgramArguments</key> | ||
<array> | ||
<string>epd</string> | ||
<string>35</string> | ||
<string>50</string> | ||
</array> | ||
<key>StandardOutPath</key> | ||
<string>/Library/Application Support/EternalPower/epd.log</string> | ||
<key>Version</key> | ||
<string> | ||
version=1.0 | ||
</string> | ||
</dict> | ||
</plist> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
chargeLimit = 35 | ||
dischargeTarget = 50 | ||
boostTarget = 40 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
boosting = 0 | ||
discharging = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
cd $DIR | ||
EPDIR="/Library/Application Support/EternalPower" | ||
PLIST=/Library/LaunchDaemons/com.joelucid.EternalPower.epd.plist | ||
if [ -f $PLIST ]; then | ||
/bin/launchctl unload $PLIST | ||
fi | ||
if [ ! -d "$EPDIR" ]; then | ||
/bin/mkdir "$EPDIR" | ||
/bin/chmod 755 "$EPDIR" | ||
fi | ||
/bin/cp epd "$EPDIR" | ||
if [ ! -f "${EPDIR}/epd.conf" ]; then | ||
/bin/cp epd.conf "$EPDIR" | ||
/bin/chmod 666 "$EPDIR/epd.conf" | ||
fi | ||
if [ ! -f "${EPDIR}/epd.state" ]; then | ||
/bin/cp epd.state "$EPDIR" | ||
/bin/chmod 644 "$EPDIR/epd.state" | ||
fi | ||
/usr/bin/touch "$EPDIR/epd.log" | ||
/bin/chmod 666 "$EPDIR/epd.log" | ||
/bin/cp com.joelucid.EternalPower.epd.plist /Library/LaunchDaemons | ||
/bin/launchctl load /Library/LaunchDaemons/com.joelucid.EternalPower.epd.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
cd $DIR | ||
EPDIR="/Library/Application Support/EternalPower" | ||
PLIST=/Library/LaunchDaemons/com.joelucid.EternalPower.epd.plist | ||
if [ -f $PLIST ]; then | ||
/bin/launchctl unload $PLIST | ||
/bin/rm $PLIST | ||
fi |
Oops, something went wrong.