diff --git a/EternalPower.app/Contents/Info.plist b/EternalPower.app/Contents/Info.plist new file mode 100644 index 0000000..e9bf1c8 --- /dev/null +++ b/EternalPower.app/Contents/Info.plist @@ -0,0 +1,52 @@ + + + + + BuildMachineOSBuild + 20D74 + CFBundleDevelopmentRegion + en + CFBundleExecutable + EternalPower + CFBundleIdentifier + Thorsten-Laux.ChargeLimiter + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + EternalPower + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D4e + DTPlatformName + macosx + DTPlatformVersion + 11.1 + DTSDKBuild + 20C63 + DTSDKName + macosx11.1 + DTXcode + 1240 + DTXcodeBuild + 12D4e + LSMinimumSystemVersion + 10.15 + LSUIElement + + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + + diff --git a/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/Info.plist b/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/Info.plist new file mode 100644 index 0000000..3f66876 Binary files /dev/null and b/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/Info.plist differ diff --git a/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/MacOS/LaunchAtLoginHelper b/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/MacOS/LaunchAtLoginHelper new file mode 100755 index 0000000..31886d9 Binary files /dev/null and b/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/MacOS/LaunchAtLoginHelper differ diff --git a/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/PkgInfo b/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/PkgInfo new file mode 100644 index 0000000..bd04210 --- /dev/null +++ b/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/_CodeSignature/CodeResources b/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/_CodeSignature/CodeResources new file mode 100644 index 0000000..d5d0fd7 --- /dev/null +++ b/EternalPower.app/Contents/Library/LoginItems/LaunchAtLoginHelper.app/Contents/_CodeSignature/CodeResources @@ -0,0 +1,115 @@ + + + + + files + + files2 + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/EternalPower.app/Contents/MacOS/EternalPower b/EternalPower.app/Contents/MacOS/EternalPower new file mode 100755 index 0000000..c9c3d8e Binary files /dev/null and b/EternalPower.app/Contents/MacOS/EternalPower differ diff --git a/EternalPower.app/Contents/PkgInfo b/EternalPower.app/Contents/PkgInfo new file mode 100644 index 0000000..bd04210 --- /dev/null +++ b/EternalPower.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/EternalPower.app/Contents/Resources/Assets.car b/EternalPower.app/Contents/Resources/Assets.car new file mode 100644 index 0000000..1673732 Binary files /dev/null and b/EternalPower.app/Contents/Resources/Assets.car differ diff --git a/EternalPower.app/Contents/Resources/Base.lproj/Main.storyboardc/Info.plist b/EternalPower.app/Contents/Resources/Base.lproj/Main.storyboardc/Info.plist new file mode 100644 index 0000000..2f3a655 Binary files /dev/null and b/EternalPower.app/Contents/Resources/Base.lproj/Main.storyboardc/Info.plist differ diff --git a/EternalPower.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib b/EternalPower.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib new file mode 100644 index 0000000..915f4a7 Binary files /dev/null and b/EternalPower.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib differ diff --git a/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Info.plist b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Info.plist new file mode 100644 index 0000000..b58c8cb --- /dev/null +++ b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Info.plist @@ -0,0 +1,40 @@ + + + + + BuildMachineOSBuild + 20D74 + CFBundleDevelopmentRegion + en + CFBundleIdentifier + LaunchAtLogin-LaunchAtLogin-resources + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + LaunchAtLogin_LaunchAtLogin + CFBundlePackageType + BNDL + CFBundleSupportedPlatforms + + MacOSX + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D4e + DTPlatformName + macosx + DTPlatformVersion + 11.1 + DTSDKBuild + 20C63 + DTSDKName + macosx11.1 + DTXcode + 1240 + DTXcodeBuild + 12D4e + LSMinimumSystemVersion + 10.12 + + diff --git a/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLogin.entitlements b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLogin.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLogin.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper-with-runtime.zip b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper-with-runtime.zip new file mode 100644 index 0000000..ef27b8e Binary files /dev/null and b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper-with-runtime.zip differ diff --git a/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper.zip b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper.zip new file mode 100644 index 0000000..64e9024 Binary files /dev/null and b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper.zip differ diff --git a/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh new file mode 100755 index 0000000..5d18a72 --- /dev/null +++ b/EternalPower.app/Contents/Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh @@ -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 diff --git a/EternalPower.app/Contents/Resources/com.joelucid.EternalPower.epd.plist b/EternalPower.app/Contents/Resources/com.joelucid.EternalPower.epd.plist new file mode 100644 index 0000000..0d93419 --- /dev/null +++ b/EternalPower.app/Contents/Resources/com.joelucid.EternalPower.epd.plist @@ -0,0 +1,28 @@ + + + + + Label + com.joelucid.EternalPower.epd + Program + /Library/Application Support/EternalPower/epd + KeepAlive + + RunAtLoad + + AbandonProcessGroup + + ProgramArguments + + epd + 35 + 50 + + StandardOutPath + /Library/Application Support/EternalPower/epd.log + Version + + version=1.0 + + + diff --git a/EternalPower.app/Contents/Resources/epd b/EternalPower.app/Contents/Resources/epd new file mode 100755 index 0000000..2a6e6e7 Binary files /dev/null and b/EternalPower.app/Contents/Resources/epd differ diff --git a/EternalPower.app/Contents/Resources/epd.conf b/EternalPower.app/Contents/Resources/epd.conf new file mode 100644 index 0000000..cfb1c8c --- /dev/null +++ b/EternalPower.app/Contents/Resources/epd.conf @@ -0,0 +1,4 @@ +chargeLimit = 35 +dischargeTarget = 50 +boostTarget = 40 + diff --git a/EternalPower.app/Contents/Resources/epd.state b/EternalPower.app/Contents/Resources/epd.state new file mode 100644 index 0000000..d435811 --- /dev/null +++ b/EternalPower.app/Contents/Resources/epd.state @@ -0,0 +1,2 @@ +boosting = 0 +discharging = 0 diff --git a/EternalPower.app/Contents/Resources/install_daemon.sh b/EternalPower.app/Contents/Resources/install_daemon.sh new file mode 100755 index 0000000..b5e3893 --- /dev/null +++ b/EternalPower.app/Contents/Resources/install_daemon.sh @@ -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 diff --git a/EternalPower.app/Contents/Resources/uninstall_daemon.sh b/EternalPower.app/Contents/Resources/uninstall_daemon.sh new file mode 100755 index 0000000..2699d19 --- /dev/null +++ b/EternalPower.app/Contents/Resources/uninstall_daemon.sh @@ -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 diff --git a/EternalPower.app/Contents/_CodeSignature/CodeResources b/EternalPower.app/Contents/_CodeSignature/CodeResources new file mode 100644 index 0000000..3a087b0 --- /dev/null +++ b/EternalPower.app/Contents/_CodeSignature/CodeResources @@ -0,0 +1,280 @@ + + + + + files + + Resources/Assets.car + + oEylGg9lIbbo4zo0YANPw7DNQYA= + + Resources/Base.lproj/Main.storyboardc/Info.plist + + M1rS+Tcas1ZdM4/iibTlduTJ22M= + + Resources/Base.lproj/Main.storyboardc/MainMenu.nib + + xaMNEpg7JXe1tXbN9px5PFqYYDk= + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Info.plist + + kWgXY7OWKh6/TamIXdUBx+S5lHg= + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLogin.entitlements + + EPWnZClCepLXTlRBQz8jOgCUyHo= + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper-with-runtime.zip + + yBCuoXdEZlSNyyA+VDZEGcZC1oE= + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper.zip + + XWFSHJCVROaW8BG9mdJ+TWr3awk= + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh + + Rf6MDaadQcgz81Em6mIj+1chuqs= + + Resources/com.joelucid.EternalPower.epd.plist + + OCbRj6monk1u7WaBrBUGJo8M4xw= + + Resources/epd + + eCkKmPepS9+CHOS93EXN7zxzo0I= + + Resources/epd.conf + + sfO+51XkOzCOZk7T2s4LxnI6WFE= + + Resources/epd.state + + mY/aEPw+9H9tPpS5UeCyoTTscBQ= + + Resources/install_daemon.sh + + tr7EerrM8DOJkxgHZwYWyR6tYkU= + + Resources/uninstall_daemon.sh + + Y4wqShcli3ft+f9sVsclSdBlWWg= + + + files2 + + Library/LoginItems/LaunchAtLoginHelper.app + + cdhash + + L3rZRd80dhX+4cTo3acBhssitDU= + + requirement + cdhash H"2f7ad945df347615fee1c4e8dda70186cb22b435" + + Resources/Assets.car + + hash2 + + 16062/k/QfwaD3JFkeNGYh2GDT5civ9N26j2f/iR9bg= + + + Resources/Base.lproj/Main.storyboardc/Info.plist + + hash2 + + 6/2HagpKuzGhxFgQU55Lc/bxgR30qm5eqHSV+p9e4/4= + + + Resources/Base.lproj/Main.storyboardc/MainMenu.nib + + hash2 + + Xn2S/42Q+9D4tqECGLAZtlKTnmCKjy25A7syA6RMZTE= + + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Info.plist + + hash2 + + aJbEjmRayS/zzk6LvFgmK807GZ6PK75mXc9KKVtVHJ8= + + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLogin.entitlements + + hash2 + + t0bHSyAeavTghk+9H09in5YVan7EtyCLyZXQpQibtZI= + + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper-with-runtime.zip + + hash2 + + xaSPW6aBCIqnkit58vG1WhoAaQS43jeHkOsOiwrGYjQ= + + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/LaunchAtLoginHelper.zip + + hash2 + + bqrO2RcxIPgu+YRSstjLNwXBLbOdQobHDE9btrZ6XkM= + + + Resources/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh + + hash2 + + 6+Sq0v7X8+b8D/n8qdCi6p3XYiMrf33mw6ojuO+XoSA= + + + Resources/com.joelucid.EternalPower.epd.plist + + hash2 + + 32VrYM20nPYy9wVYI36nEmCCW4ZWtlPkBx2irn3JUOw= + + + Resources/epd + + hash2 + + 3+UjeI5fcHvPbV6UsoGZ3kL5jqvJfaEQ1wXE4p/rogY= + + + Resources/epd.conf + + hash2 + + zzCU7WpyllvuWKh4hKE5dtq6GTEpmznohLKwSQt4f9k= + + + Resources/epd.state + + hash2 + + 4zM7KOF2HaIiBEqbRbxjgwsVp1K/q9axn3DkqTt79Uo= + + + Resources/install_daemon.sh + + hash2 + + fhZEM12vcq2c8TcKIOqLDGgrQTYO6qQAk7u+Po2B8TY= + + + Resources/uninstall_daemon.sh + + hash2 + + mPkRqALFNpT/sHOTikaWrLxClrzv+mmTTmcywjJTjVo= + + + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + +