diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..f3a1c39 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,49 @@ +name: Theos CI + +on: + release: + types: + - created + +jobs: + build: + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: recursive + + - name: Theos Setup (Setup) + uses: NyaMisty/theos-action@master + + - name: Get tag + if: ${{ startsWith(github.ref, 'refs/tags/') }} + id: tag + uses: dawidd6/action-get-tag@v1 + + - name: Build Release package - Rootful + if: ${{ startsWith(github.ref, 'refs/tags/') }} + run: | + cd screendumpLowFrame + make clean + TAGNAME=${{ steps.tag.outputs.tag }} + make package FINALPACKAGE=1 PACKAGE_VERSION=${TAGNAME#v}-rootful + - name: Build Release package - Rootless + if: ${{ startsWith(github.ref, 'refs/tags/') }} + run: | + cd screendumpLowFrame + make clean + TAGNAME=${{ steps.tag.outputs.tag }} + make package THEOS_PACKAGE_SCHEME=rootless FINALPACKAGE=1 PACKAGE_VERSION=${TAGNAME#v}-rootless + + - name: Release + uses: softprops/action-gh-release@v1 + if: ${{ startsWith(github.ref, 'refs/tags/') }} + with: + files: | + ${{ github.workspace }}/screendumpLowFrame/packages/*.deb + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 996e30e..e325f6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.theos \ No newline at end of file +.theos +packages \ No newline at end of file diff --git a/screendumpLowFrame/Makefile b/screendumpLowFrame/Makefile index d21da17..03a9096 100644 --- a/screendumpLowFrame/Makefile +++ b/screendumpLowFrame/Makefile @@ -1,7 +1,12 @@ -TARGET = iphone:14.4:10.0 +TARGET = iphone:16.5:14.0 include $(THEOS)/makefiles/common.mk +ifeq ($(THEOS_PACKAGE_SCHEME),rootless) + PACKAGE_BUILDNAME := rootless +else + PACKAGE_BUILDNAME := rootful +endif TOOL_NAME = screendumpd $(TOOL_NAME)_FILES = main.mm @@ -23,3 +28,14 @@ include $(THEOS_MAKE_PATH)/tool.mk SUBPROJECTS += hooks include $(THEOS_MAKE_PATH)/aggregate.mk + +ifeq ($(THEOS_PACKAGE_SCHEME),rootless) +after-screendumpd-stage:: + $(ECHO_NOTHING) rm $(THEOS_STAGING_DIR)/Library/LaunchDaemons/com.julioverne.screendumpd.plist$(ECHO_END) + $(ECHO_NOTHING) mv $(THEOS_STAGING_DIR)/Library/LaunchDaemons/com.julioverne.screendumpd.rootless.plist $(THEOS_STAGING_DIR)/Library/LaunchDaemons/com.julioverne.screendumpd.plist$(ECHO_END) + $(ECHO_NOTHING)$(FAKEROOT) chown root:wheel $(THEOS_STAGING_DIR)/Library/LaunchDaemons/com.julioverne.screendumpd.plist$(ECHO_END) +else +after-screendumpd-stage:: + $(ECHO_NOTHING) rm $(THEOS_STAGING_DIR)/Library/LaunchDaemons/com.julioverne.screendumpd.rootless.plist$(ECHO_END) + $(ECHO_NOTHING)$(FAKEROOT) chown root:wheel $(THEOS_STAGING_DIR)/Library/LaunchDaemons/com.julioverne.screendumpd.plist$(ECHO_END) +endif diff --git a/screendumpLowFrame/build_packages.sh b/screendumpLowFrame/build_packages.sh new file mode 100755 index 0000000..4a99d82 --- /dev/null +++ b/screendumpLowFrame/build_packages.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "Building package for ROOTFUL Jailbreak" + +make clean +make package FINALPACKAGE=1 + +echo "Building package for ROOTLESS Jailbreak" + +make clean +make package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless diff --git a/screendumpLowFrame/hooks/Makefile b/screendumpLowFrame/hooks/Makefile index 5834112..9c6a8a6 100644 --- a/screendumpLowFrame/hooks/Makefile +++ b/screendumpLowFrame/hooks/Makefile @@ -1,7 +1,8 @@ -TARGET = iphone:14.4:10.0 +TARGET = iphone:16.5:14.0 include $(THEOS)/makefiles/common.mk + TWEAK_NAME = screendumpbb $(TWEAK_NAME)_FILES = Tweak.xm $(TWEAK_NAME)_FRAMEWORKS := IOSurface IOKit diff --git a/screendumpLowFrame/hooks/Tweak.xm b/screendumpLowFrame/hooks/Tweak.xm index 9080b32..7705452 100644 --- a/screendumpLowFrame/hooks/Tweak.xm +++ b/screendumpLowFrame/hooks/Tweak.xm @@ -2,11 +2,11 @@ #include #include #import +#import +#import #undef NSLog -#define kSettingsPath @"//var/mobile/Library/Preferences/com.cosmosgenius.screendump.plist" - extern "C" UIImage* _UICreateScreenUIImage(); static BOOL isEnabled; diff --git a/screendumpLowFrame/layout/DEBIAN/control b/screendumpLowFrame/layout/DEBIAN/control index f85f8fe..b0f1774 100644 --- a/screendumpLowFrame/layout/DEBIAN/control +++ b/screendumpLowFrame/layout/DEBIAN/control @@ -1,6 +1,6 @@ Package: com.cosmosgenius.screendump13 Name: screendump -Depends: mobilesubstrate, preferenceloader +Depends: preferenceloader Architecture: iphoneos-arm Description: VNC for ios Maintainer: Sharat M R diff --git a/screendumpLowFrame/layout/DEBIAN/postinst b/screendumpLowFrame/layout/DEBIAN/postinst index b39d767..50227eb 100755 --- a/screendumpLowFrame/layout/DEBIAN/postinst +++ b/screendumpLowFrame/layout/DEBIAN/postinst @@ -1,6 +1,11 @@ #!/bin/sh -launchctl unload //Library/LaunchDaemons/com.julioverne.screendumpd.plist -launchctl load //Library/LaunchDaemons/com.julioverne.screendumpd.plist +if [ -L "/var/jb" ]; then + launchctl unload /var/jb/Library/LaunchDaemons/com.julioverne.screendumpd.plist + launchctl load /var/jb/Library/LaunchDaemons/com.julioverne.screendumpd.plist +else + launchctl unload /Library/LaunchDaemons/com.julioverne.screendumpd.plist + launchctl load /Library/LaunchDaemons/com.julioverne.screendumpd.plist +fi exit 0; diff --git a/screendumpLowFrame/layout/DEBIAN/postrm b/screendumpLowFrame/layout/DEBIAN/postrm deleted file mode 100755 index e5f27c3..0000000 --- a/screendumpLowFrame/layout/DEBIAN/postrm +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -launchctl unload //Library/LaunchDaemons/com.julioverne.screendumpd.plist - -exit 0; diff --git a/screendumpLowFrame/layout/DEBIAN/prerm b/screendumpLowFrame/layout/DEBIAN/prerm new file mode 100755 index 0000000..0866b01 --- /dev/null +++ b/screendumpLowFrame/layout/DEBIAN/prerm @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ -L "/var/jb" ]; then + launchctl unload /var/jb/Library/LaunchDaemons/com.julioverne.screendumpd.plist +else + launchctl unload /Library/LaunchDaemons/com.julioverne.screendumpd.plist +fi + +exit 0; \ No newline at end of file diff --git a/screendumpLowFrame/layout/Library/LaunchDaemons/com.julioverne.screendumpd.rootless.plist b/screendumpLowFrame/layout/Library/LaunchDaemons/com.julioverne.screendumpd.rootless.plist new file mode 100644 index 0000000..64803f4 --- /dev/null +++ b/screendumpLowFrame/layout/Library/LaunchDaemons/com.julioverne.screendumpd.rootless.plist @@ -0,0 +1,16 @@ + + + + + Label + com.julioverne.screendumpd + ProgramArguments + + /var/jb/usr/libexec/screendumpd + + RunAtLoad + + KeepAlive + + + diff --git a/screendumpLowFrame/main.mm b/screendumpLowFrame/main.mm index 0bb4474..1252761 100644 --- a/screendumpLowFrame/main.mm +++ b/screendumpLowFrame/main.mm @@ -1,9 +1,9 @@ #include #include #include -#import - -#define kSettingsPath @"//var/mobile/Library/Preferences/com.cosmosgenius.screendump.plist" +#import +#import +#import static bool CCSisEnabled = true; static NSString *CCSPassword = nil;