Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 45e8471411 | |||
| 2e703d1225 | |||
| 486c150d93 | |||
| 7d509b3a44 | |||
| feda8cc7a1 | |||
| ac972bbedc | |||
| 8a7ae31775 | |||
|
|
6c6e43abc0 | ||
|
|
9855510d95 | ||
|
|
2d9baadcac | ||
|
|
d94d23ebc2 | ||
|
|
d107b21d5f | ||
|
|
6f80ce9993 | ||
|
|
26f21ff693 | ||
|
|
0ed9b9063c | ||
|
|
cf34c3e385 |
40
.github/workflows/ci.yaml
vendored
40
.github/workflows/ci.yaml
vendored
@@ -26,35 +26,39 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Theos Setup (Setup)
|
- name: Theos Setup
|
||||||
uses: NyaMisty/theos-action@master
|
uses: NyaMisty/theos-action@master
|
||||||
|
|
||||||
- name: Get tag
|
- name: Determine Tag or Default
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
id: determine_tag
|
||||||
id: tag
|
|
||||||
uses: dawidd6/action-get-tag@v1
|
|
||||||
|
|
||||||
- name: Build Release package - Rootful
|
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
||||||
run: |
|
run: |
|
||||||
cd screendumpLowFrame
|
# Check if the current ref is a tag
|
||||||
make clean
|
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
||||||
TAGNAME=${{ steps.tag.outputs.tag || '0.0.5' }} # Default value for manual run
|
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
||||||
make package FINALPACKAGE=1 PACKAGE_VERSION=${TAGNAME#v}-rootful
|
else
|
||||||
|
TAG_NAME="0.0.5" # Fallback tag version
|
||||||
|
fi
|
||||||
|
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Create Tag
|
||||||
|
run: |
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git tag ${{ env.TAG_NAME }} || echo "Tag already exists."
|
||||||
|
git push origin ${{ env.TAG_NAME }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build Release package - Rootless
|
- name: Build Release package - Rootless
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
||||||
run: |
|
run: |
|
||||||
cd screendumpLowFrame
|
cd screendumpLowFrame
|
||||||
make clean
|
make clean
|
||||||
TAGNAME=${{ steps.tag.outputs.tag || '0.0.5' }} # Default value for manual run
|
make package THEOS_PACKAGE_SCHEME=rootless FINALPACKAGE=1 PACKAGE_VERSION=${{ env.TAG_NAME }}-rootless
|
||||||
make package THEOS_PACKAGE_SCHEME=rootless FINALPACKAGE=1 PACKAGE_VERSION=${TAGNAME#v}-rootless
|
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
||||||
with:
|
with:
|
||||||
files: |
|
files: screendumpLowFrame/packages/*.deb
|
||||||
${{ github.workspace }}/screendumpLowFrame/packages/*.deb
|
tag_name: ${{ env.TAG_NAME }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
8
screendump/FrameUpdater.h
Normal file
8
screendump/FrameUpdater.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@interface FrameUpdater : NSObject
|
||||||
|
@property (nonatomic, retain) NSTimer* myTimer;
|
||||||
|
@property (nonatomic) BOOL isEnabled;
|
||||||
|
- (void)startFrameLoop;
|
||||||
|
- (void)stopFrameLoop;
|
||||||
|
@end
|
||||||
@@ -1,18 +1,23 @@
|
|||||||
TARGET = iphone:14.4:10.0
|
export THEOS_PACKAGE_SCHEME = rootless
|
||||||
|
export ARCHS = arm64
|
||||||
|
export TARGET = iphone:16.5:14.0
|
||||||
|
export GO_EASY_ON_ME = 1
|
||||||
|
export COPYFILE_DISABLE=1
|
||||||
|
|
||||||
include $(THEOS)/makefiles/common.mk
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
TOOL_NAME = screendumpd
|
TOOL_NAME = screendumpd
|
||||||
export ARCHS = arm64
|
|
||||||
$(TOOL_NAME)_ARCHS = arm64
|
|
||||||
$(TOOL_NAME)_FILES = main.mm
|
$(TOOL_NAME)_FILES = main.mm
|
||||||
$(TOOL_NAME)_FRAMEWORKS := IOSurface IOKit
|
$(TOOL_NAME)_FRAMEWORKS := IOSurface IOKit
|
||||||
$(TOOL_NAME)_PRIVATE_FRAMEWORKS := IOMobileFramebuffer IOSurface
|
$(TOOL_NAME)_PRIVATE_FRAMEWORKS := IOMobileFramebuffer IOSurface
|
||||||
$(TOOL_NAME)_OBJCFLAGS += -Ivncbuild/include -Iinclude
|
$(TOOL_NAME)_OBJCFLAGS += -I./vncbuild/include -Iinclude
|
||||||
$(TOOL_NAME)_LDFLAGS += -Wl,-segalign,4000 -Lvncbuild/lib -lvncserver -lpng -llzo2 -ljpeg -lssl -lcrypto -lz
|
$(TOOL_NAME)_LDFLAGS += -Wl,-segalign,4000 -L./vncbuild/lib -lvncserver -lpng -llzo2 -ljpeg -lssl -lcrypto -lz
|
||||||
$(TOOL_NAME)_CFLAGS = -w
|
$(TOOL_NAME)_CFLAGS = -w
|
||||||
$(TOOL_NAME)_CODESIGN_FLAGS = "-Sen.plist"
|
$(TOOL_NAME)_CODESIGN_FLAGS = "-Sen.plist"
|
||||||
$(TOOL_NAME)_INSTALL_PATH = /usr/libexec
|
$(TOOL_NAME)_INSTALL_PATH = /usr/libexec
|
||||||
|
|
||||||
|
before-stage::
|
||||||
|
$(ECHO_NOTHING)find . -name '.DS_Store' -type f -delete$(ECHO_END)
|
||||||
|
$(ECHO_NOTHING)chmod 0775 layout/DEBIAN/*$(ECHO_END)
|
||||||
|
|
||||||
include $(THEOS_MAKE_PATH)/tool.mk
|
include $(THEOS_MAKE_PATH)/tool.mk
|
||||||
|
|||||||
11
screendump/control
Normal file
11
screendump/control
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Package: ru.mostmodest.screendump
|
||||||
|
Name: screendump
|
||||||
|
Architecture: iphoneos-arm
|
||||||
|
Description: VNC for iOS15+ (rootless/Ellekit)
|
||||||
|
Maintainer: mostm
|
||||||
|
Author: cosmosgenius
|
||||||
|
Section: Tweaks
|
||||||
|
Conflicts: ru.mostmodest.screendump.lowframe
|
||||||
|
Depends: mobilesubstrate, preferenceloader
|
||||||
|
Icon: file:///Library/PreferenceLoader/Preferences/screendump/ScreenDump@2x.png
|
||||||
|
Version: 0.0.5.2
|
||||||
1
screendump/en.plist
Normal file → Executable file
1
screendump/en.plist
Normal file → Executable file
@@ -7,6 +7,7 @@
|
|||||||
<string>IOSurfaceAcceleratorClient</string>
|
<string>IOSurfaceAcceleratorClient</string>
|
||||||
<string>IOMobileFramebufferUserClient</string>
|
<string>IOMobileFramebufferUserClient</string>
|
||||||
<string>IOSurfaceRootUserClient</string>
|
<string>IOSurfaceRootUserClient</string>
|
||||||
|
<string>IOHIDLibUserClient</string>
|
||||||
</array>
|
</array>
|
||||||
<key>platform-application</key>
|
<key>platform-application</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
Package: com.julioverne.screendump13
|
|
||||||
Name: screendump (iOS 13)
|
|
||||||
Depends: mobilesubstrate, preferenceloader
|
|
||||||
Conflicts: com.cosmosgenius.screendump
|
|
||||||
Architecture: iphoneos-arm
|
|
||||||
Description: VNC for ios
|
|
||||||
Maintainer: Julio
|
|
||||||
Author: julioverne, Sharat M R
|
|
||||||
Section: Tweaks
|
|
||||||
Version: 0.0.3e
|
|
||||||
Depiction: http://julioverne.github.io/description.html?id=com.julioverne.screendump13
|
|
||||||
Icon: file:///Library/PreferenceLoader/Preferences/screendump/ScreenDump@2x.png
|
|
||||||
@@ -1,6 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
launchctl load /var/jb/Library/LaunchDaemons/ru.mostmodest.screendumpd.plist 2> /dev/null
|
||||||
launchctl unload /Library/LaunchDaemons/com.julioverne.screendumpd.plist
|
exit 0;
|
||||||
launchctl load /Library/LaunchDaemons/com.julioverne.screendumpd.plist
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
@@ -1,5 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
exit 0;
|
||||||
launchctl unload /Library/LaunchDaemons/com.julioverne.screendumpd.plist
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
3
screendump/layout/DEBIAN/preinst
Executable file
3
screendump/layout/DEBIAN/preinst
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
launchctl unload /var/jb/Library/LaunchDaemons/ru.mostmodest.screendumpd.plist 2> /dev/null
|
||||||
|
exit 0;
|
||||||
3
screendump/layout/DEBIAN/prerm
Executable file
3
screendump/layout/DEBIAN/prerm
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
launchctl unload /var/jb/Library/LaunchDaemons/ru.mostmodest.screendumpd.plist 2> /dev/null
|
||||||
|
exit 0;
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?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.julioverne.screendumpd</string>
|
|
||||||
<key>ProgramArguments</key>
|
|
||||||
<array>
|
|
||||||
<string>/usr/libexec/screendumpd</string>
|
|
||||||
</array>
|
|
||||||
<key>RunAtLoad</key>
|
|
||||||
<true/>
|
|
||||||
<key>KeepAlive</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>Label</key>
|
<key>Label</key>
|
||||||
<string>com.julioverne.screendumpd</string>
|
<string>ru.mostmodest.screendumpd</string>
|
||||||
<key>ProgramArguments</key>
|
<key>ProgramArguments</key>
|
||||||
<array>
|
<array>
|
||||||
<string>/var/jb/usr/libexec/screendumpd</string>
|
<string>/var/jb/usr/libexec/screendumpd</string>
|
||||||
@@ -21,13 +21,13 @@
|
|||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>PostNotification</key>
|
<key>PostNotification</key>
|
||||||
<string>com.cosmosgenius.screendump/restart</string>
|
<string>ru.mostmodest.screendump/restart</string>
|
||||||
<key>cell</key>
|
<key>cell</key>
|
||||||
<string>PSSwitchCell</string>
|
<string>PSSwitchCell</string>
|
||||||
<key>default</key>
|
<key>default</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>defaults</key>
|
<key>defaults</key>
|
||||||
<string>com.cosmosgenius.screendump</string>
|
<string>ru.mostmodest.screendump</string>
|
||||||
<key>key</key>
|
<key>key</key>
|
||||||
<string>CCSisEnabled</string>
|
<string>CCSisEnabled</string>
|
||||||
<key>label</key>
|
<key>label</key>
|
||||||
@@ -35,11 +35,11 @@
|
|||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>PostNotification</key>
|
<key>PostNotification</key>
|
||||||
<string>com.cosmosgenius.screendump/restart</string>
|
<string>ru.mostmodest.screendump/restart</string>
|
||||||
<key>cell</key>
|
<key>cell</key>
|
||||||
<string>PSSecureEditTextCell</string>
|
<string>PSSecureEditTextCell</string>
|
||||||
<key>defaults</key>
|
<key>defaults</key>
|
||||||
<string>com.cosmosgenius.screendump</string>
|
<string>ru.mostmodest.screendump</string>
|
||||||
<key>key</key>
|
<key>key</key>
|
||||||
<string>CCSPassword</string>
|
<string>CCSPassword</string>
|
||||||
<key>label</key>
|
<key>label</key>
|
||||||
@@ -55,11 +55,11 @@
|
|||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>PostNotification</key>
|
<key>PostNotification</key>
|
||||||
<string>com.cosmosgenius.screendump/restart</string>
|
<string>ru.mostmodest.screendump/restart</string>
|
||||||
<key>cell</key>
|
<key>cell</key>
|
||||||
<string>PSEditTextCell</string>
|
<string>PSEditTextCell</string>
|
||||||
<key>defaults</key>
|
<key>defaults</key>
|
||||||
<string>com.cosmosgenius.screendump</string>
|
<string>ru.mostmodest.screendump</string>
|
||||||
<key>key</key>
|
<key>key</key>
|
||||||
<string>height</string>
|
<string>height</string>
|
||||||
<key>label</key>
|
<key>label</key>
|
||||||
@@ -69,11 +69,11 @@
|
|||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>PostNotification</key>
|
<key>PostNotification</key>
|
||||||
<string>com.cosmosgenius.screendump/restart</string>
|
<string>ru.mostmodest.screendump/restart</string>
|
||||||
<key>cell</key>
|
<key>cell</key>
|
||||||
<string>PSEditTextCell</string>
|
<string>PSEditTextCell</string>
|
||||||
<key>defaults</key>
|
<key>defaults</key>
|
||||||
<string>com.cosmosgenius.screendump</string>
|
<string>ru.mostmodest.screendump</string>
|
||||||
<key>key</key>
|
<key>key</key>
|
||||||
<string>width</string>
|
<string>width</string>
|
||||||
<key>label</key>
|
<key>label</key>
|
||||||
|
|||||||
143
screendump/main.mm
Normal file → Executable file
143
screendump/main.mm
Normal file → Executable file
@@ -1,8 +1,12 @@
|
|||||||
#include <errno.h>
|
#import <errno.h>
|
||||||
#include <substrate.h>
|
#import <substrate.h>
|
||||||
#include <rfb/rfb.h>
|
#import <rfb/rfb.h>
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#define kSettingsPath @"//var/mobile/Library/Preferences/com.cosmosgenius.screendump.plist"
|
#import "FrameUpdater.h"
|
||||||
|
|
||||||
|
#define kSettingsPath @"/var/mobile/Library/Preferences/ru.mostmodest.screendump.plist"
|
||||||
|
|
||||||
static bool CCSisEnabled = true;
|
static bool CCSisEnabled = true;
|
||||||
static NSString *CCSPassword = nil;
|
static NSString *CCSPassword = nil;
|
||||||
@@ -49,7 +53,7 @@ typedef mach_port_t io_service_t;
|
|||||||
typedef kern_return_t IOReturn;
|
typedef kern_return_t IOReturn;
|
||||||
typedef IOReturn IOMobileFramebufferReturn;
|
typedef IOReturn IOMobileFramebufferReturn;
|
||||||
typedef io_service_t IOMobileFramebufferService;
|
typedef io_service_t IOMobileFramebufferService;
|
||||||
extern "C" mach_port_t mach_task_self(void);
|
// extern "C" mach_port_t mach_task_self(void);
|
||||||
extern "C" void IOSurfaceFlushProcessorCaches(IOSurfaceRef buffer);
|
extern "C" void IOSurfaceFlushProcessorCaches(IOSurfaceRef buffer);
|
||||||
extern "C" int IOSurfaceLock(IOSurfaceRef surface, uint32_t options, uint32_t *seed);
|
extern "C" int IOSurfaceLock(IOSurfaceRef surface, uint32_t options, uint32_t *seed);
|
||||||
extern "C" int IOSurfaceUnlock(IOSurfaceRef surface, uint32_t options, uint32_t *seed);
|
extern "C" int IOSurfaceUnlock(IOSurfaceRef surface, uint32_t options, uint32_t *seed);
|
||||||
@@ -58,8 +62,10 @@ extern "C" CFMutableDictionaryRef IOServiceMatching(const char *name);
|
|||||||
extern "C" const mach_port_t kIOMasterPortDefault;
|
extern "C" const mach_port_t kIOMasterPortDefault;
|
||||||
extern "C" io_service_t IOServiceGetMatchingService(mach_port_t masterPort, CFDictionaryRef matching);
|
extern "C" io_service_t IOServiceGetMatchingService(mach_port_t masterPort, CFDictionaryRef matching);
|
||||||
extern "C" IOMobileFramebufferReturn IOMobileFramebufferGetLayerDefaultSurface(IOMobileFramebufferRef pointer, int surface, IOSurfaceRef *buffer);
|
extern "C" IOMobileFramebufferReturn IOMobileFramebufferGetLayerDefaultSurface(IOMobileFramebufferRef pointer, int surface, IOSurfaceRef *buffer);
|
||||||
|
extern "C" IOMobileFramebufferReturn IOMobileFramebufferCopyLayerDisplayedSurface(IOMobileFramebufferRef pointer, int surface, IOSurfaceRef *buffer);
|
||||||
extern "C" IOMobileFramebufferReturn IOMobileFramebufferOpen(IOMobileFramebufferService service, mach_port_t owningTask, unsigned int type, IOMobileFramebufferRef *pointer);
|
extern "C" IOMobileFramebufferReturn IOMobileFramebufferOpen(IOMobileFramebufferService service, mach_port_t owningTask, unsigned int type, IOMobileFramebufferRef *pointer);
|
||||||
extern "C" IOMobileFramebufferReturn IOMobileFramebufferGetMainDisplay(IOMobileFramebufferRef *pointer);
|
extern "C" IOMobileFramebufferReturn IOMobileFramebufferGetMainDisplay(IOMobileFramebufferRef *pointer);
|
||||||
|
extern "C" mach_port_t mach_task_self();
|
||||||
static IOSurfaceAcceleratorRef accelerator;
|
static IOSurfaceAcceleratorRef accelerator;
|
||||||
static IOSurfaceRef static_buffer;
|
static IOSurfaceRef static_buffer;
|
||||||
|
|
||||||
@@ -68,8 +74,6 @@ static void VNCUpdateRunState(bool shouldStart);
|
|||||||
static void handleVNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client);
|
static void handleVNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client);
|
||||||
static void handleVNCPointer(int buttons, int x, int y, rfbClientPtr client);
|
static void handleVNCPointer(int buttons, int x, int y, rfbClientPtr client);
|
||||||
|
|
||||||
static BOOL isLoopFrame;
|
|
||||||
|
|
||||||
static rfbBool VNCCheck(rfbClientPtr client, const char *data, int size)
|
static rfbBool VNCCheck(rfbClientPtr client, const char *data, int size)
|
||||||
{
|
{
|
||||||
NSString *password = reinterpret_cast<NSString *>(screen->authPasswdData);
|
NSString *password = reinterpret_cast<NSString *>(screen->authPasswdData);
|
||||||
@@ -89,27 +93,24 @@ static rfbBool VNCCheck(rfbClientPtr client, const char *data, int size)
|
|||||||
static IOSurfaceRef screenSurface = NULL;
|
static IOSurfaceRef screenSurface = NULL;
|
||||||
static IOMobileFramebufferRef framebufferConnection = NULL;
|
static IOMobileFramebufferRef framebufferConnection = NULL;
|
||||||
|
|
||||||
@interface FrameUpdater : NSObject
|
|
||||||
@property (nonatomic, retain) NSTimer* myTimer;
|
|
||||||
- (void)startFrameLoop;
|
|
||||||
- (void)stopFrameLoop;
|
|
||||||
@end
|
|
||||||
|
|
||||||
static void VNCSetup()
|
static void VNCSetup()
|
||||||
{
|
{
|
||||||
if(!screenSurface) {
|
if(!screenSurface) {
|
||||||
IOSurfaceAcceleratorCreate(kCFAllocatorDefault, 0, &accelerator);
|
IOSurfaceAcceleratorCreate(kCFAllocatorDefault, 0, &accelerator);
|
||||||
|
|
||||||
IOMobileFramebufferGetMainDisplay(&framebufferConnection);
|
IOMobileFramebufferGetMainDisplay(&framebufferConnection);
|
||||||
|
|
||||||
IOMobileFramebufferGetLayerDefaultSurface(framebufferConnection, 0, &screenSurface);
|
IOMobileFramebufferGetLayerDefaultSurface(framebufferConnection, 0, &screenSurface);
|
||||||
|
if(screenSurface == NULL)
|
||||||
|
IOMobileFramebufferCopyLayerDisplayedSurface(framebufferConnection, 0, &screenSurface);
|
||||||
|
|
||||||
//CGSize size;
|
//CGSize size;
|
||||||
//IOMobileFramebufferGetDisplaySize(framebufferConnection, &size);
|
//IOMobileFramebufferGetDisplaySize(framebufferConnection, &size);
|
||||||
//width = size.width/2;
|
//width = size.width/2;
|
||||||
//height = size.height/2;
|
//height = size.height/2;
|
||||||
|
|
||||||
width = prefferW==0?IOSurfaceGetWidth(screenSurface):prefferW;
|
width = prefferW == 0 ? IOSurfaceGetWidth(screenSurface) : prefferW;
|
||||||
height = prefferW==0?IOSurfaceGetHeight(screenSurface):prefferH;
|
height = prefferW == 0 ? IOSurfaceGetHeight(screenSurface) : prefferH;
|
||||||
|
|
||||||
size_image = IOSurfaceGetAllocSize(screenSurface);
|
size_image = IOSurfaceGetAllocSize(screenSurface);
|
||||||
bytesPerRow = IOSurfaceGetBytesPerRow(screenSurface);
|
bytesPerRow = IOSurfaceGetBytesPerRow(screenSurface);
|
||||||
@@ -154,6 +155,7 @@ static void VNCSettings(bool shouldStart, NSString* password)
|
|||||||
CCSPassword = password;
|
CCSPassword = password;
|
||||||
}
|
}
|
||||||
NSString *sEnabled = CCSisEnabled ? @"YES": @"NO";
|
NSString *sEnabled = CCSisEnabled ? @"YES": @"NO";
|
||||||
|
[[FrameUpdater shared] setIsEnabled:CCSisEnabled];
|
||||||
VNCUpdateRunState(CCSisEnabled);
|
VNCUpdateRunState(CCSisEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,28 +167,20 @@ static void VNCUpdateRunState(bool shouldStart)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CCSPassword && CCSPassword.length) {
|
||||||
if(CCSPassword && CCSPassword.length) {
|
|
||||||
screen->authPasswdData = (void *) CCSPassword;
|
screen->authPasswdData = (void *) CCSPassword;
|
||||||
} else {
|
} else {
|
||||||
screen->authPasswdData = NULL;
|
screen->authPasswdData = NULL;
|
||||||
}
|
}
|
||||||
if(shouldStart == isVNCRunning) {
|
if (shouldStart == isVNCRunning) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(shouldStart) {
|
if (shouldStart) {
|
||||||
rfbInitServer(screen);
|
rfbInitServer(screen);
|
||||||
rfbRunEventLoop(screen, -1, true);
|
rfbRunEventLoop(screen, -1, true);
|
||||||
|
|
||||||
isLoopFrame = YES;
|
|
||||||
|
|
||||||
[[FrameUpdater shared] startFrameLoop];
|
[[FrameUpdater shared] startFrameLoop];
|
||||||
|
} else {
|
||||||
} else {
|
|
||||||
isLoopFrame = NO;
|
|
||||||
|
|
||||||
[[FrameUpdater shared] stopFrameLoop];
|
[[FrameUpdater shared] stopFrameLoop];
|
||||||
|
|
||||||
rfbShutdownServer(screen, true);
|
rfbShutdownServer(screen, true);
|
||||||
}
|
}
|
||||||
isVNCRunning = shouldStart;
|
isVNCRunning = shouldStart;
|
||||||
@@ -196,7 +190,7 @@ static void loadPrefs(void)
|
|||||||
{
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
NSDictionary* defaults = nil;
|
NSDictionary* defaults = nil;
|
||||||
CFStringRef appID = CFSTR("com.cosmosgenius.screendump");
|
CFStringRef appID = CFSTR("ru.mostmodest.screendump");
|
||||||
CFArrayRef keyList = CFPreferencesCopyKeyList(appID, CFSTR("mobile"), kCFPreferencesAnyHost);
|
CFArrayRef keyList = CFPreferencesCopyKeyList(appID, CFSTR("mobile"), kCFPreferencesAnyHost);
|
||||||
if(keyList) {
|
if(keyList) {
|
||||||
defaults = (NSDictionary *)CFPreferencesCopyMultiple(keyList, appID, CFSTR("mobile"), kCFPreferencesAnyHost)?:@{};
|
defaults = (NSDictionary *)CFPreferencesCopyMultiple(keyList, appID, CFSTR("mobile"), kCFPreferencesAnyHost)?:@{};
|
||||||
@@ -215,36 +209,43 @@ static void loadPrefs(void)
|
|||||||
|
|
||||||
static uint32_t oldSeed;
|
static uint32_t oldSeed;
|
||||||
|
|
||||||
@implementation FrameUpdater
|
@implementation FrameUpdater {
|
||||||
{
|
NSOperationQueue *_q;
|
||||||
NSOperationQueue *q;
|
BOOL _isLoopFrame;
|
||||||
}
|
}
|
||||||
@synthesize myTimer;
|
@synthesize myTimer;
|
||||||
+ (id)shared
|
@synthesize isEnabled;
|
||||||
|
|
||||||
|
+(id)shared
|
||||||
{
|
{
|
||||||
static __strong FrameUpdater* initFrame;
|
static dispatch_once_t onceToken = 0;
|
||||||
if(!initFrame) {
|
__strong static FrameUpdater* sharedInstance = nil;
|
||||||
initFrame = [[[self class] alloc] init];
|
dispatch_once(&onceToken, ^{
|
||||||
}
|
sharedInstance = [[self alloc] init];
|
||||||
return initFrame;
|
});
|
||||||
|
return sharedInstance;
|
||||||
}
|
}
|
||||||
- (id)init
|
|
||||||
|
-(id)init
|
||||||
{
|
{
|
||||||
self = [super init];
|
if ((self = [super init]))
|
||||||
|
{
|
||||||
q = [[NSOperationQueue alloc] init];
|
_q = [[NSOperationQueue alloc] init];
|
||||||
|
_isLoopFrame = NO;
|
||||||
|
isEnabled = NO;
|
||||||
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
- (void)_upFrameLoop
|
|
||||||
|
-(void)_upFrameLoop
|
||||||
{
|
{
|
||||||
if(isLoopFrame && CCSisEnabled) {
|
if (_isLoopFrame && isEnabled) {
|
||||||
//check if screen changed
|
//check if screen changed
|
||||||
uint32_t newSeed = IOSurfaceGetSeed(screenSurface);
|
uint32_t newSeed = IOSurfaceGetSeed(screenSurface);
|
||||||
|
|
||||||
if(oldSeed != newSeed && rfbIsActive(screen)) {
|
if(oldSeed != newSeed && rfbIsActive(screen)) {
|
||||||
oldSeed = newSeed;
|
oldSeed = newSeed;
|
||||||
[q addOperationWithBlock: ^{
|
[_q addOperationWithBlock: ^{
|
||||||
IOSurfaceAcceleratorTransferSurface(accelerator, screenSurface, static_buffer, NULL, NULL, NULL, NULL);
|
IOSurfaceAcceleratorTransferSurface(accelerator, screenSurface, static_buffer, NULL, NULL, NULL, NULL);
|
||||||
rfbMarkRectAsModified(screen, 0, 0, width, height);
|
rfbMarkRectAsModified(screen, 0, 0, width, height);
|
||||||
}];
|
}];
|
||||||
@@ -253,30 +254,36 @@ static uint32_t oldSeed;
|
|||||||
[self stopFrameLoop];
|
[self stopFrameLoop];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- (void)stopFrameLoop
|
|
||||||
|
-(void)stopFrameLoop
|
||||||
{
|
{
|
||||||
if(myTimer && [myTimer isValid]) {
|
if(myTimer && [myTimer isValid]) {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^(void){
|
dispatch_async(dispatch_get_main_queue(), ^(void){
|
||||||
[myTimer invalidate];
|
[myTimer invalidate];
|
||||||
|
_isLoopFrame = NO;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- (void)startFrameLoop
|
|
||||||
|
-(void)startFrameLoop
|
||||||
{
|
{
|
||||||
if(size_image == 0) {
|
if(size_image == 0) {
|
||||||
VNCSetup();
|
VNCSetup();
|
||||||
}
|
}
|
||||||
[self stopFrameLoop];
|
[self stopFrameLoop];
|
||||||
|
_isLoopFrame = YES;
|
||||||
dispatch_async(dispatch_get_main_queue(), ^(void){
|
dispatch_async(dispatch_get_main_queue(), ^(void){
|
||||||
myTimer = [NSTimer scheduledTimerWithTimeInterval:1/400 target:self selector:@selector(_upFrameLoop) userInfo:nil repeats:YES];
|
myTimer = [NSTimer scheduledTimerWithTimeInterval:1/400 target:self selector:@selector(_upFrameLoop) userInfo:nil repeats:YES];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
[self stopFrameLoop];
|
[self stopFrameLoop];
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
static void restartServer()
|
static void restartServer()
|
||||||
{
|
{
|
||||||
exit(0);
|
exit(0);
|
||||||
@@ -284,8 +291,8 @@ static void restartServer()
|
|||||||
|
|
||||||
int main(int argc, const char *argv[])
|
int main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("com.cosmosgenius.screendump/preferences.changed"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("ru.mostmodest.screendump/preferences.changed"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||||
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)restartServer, CFSTR("com.cosmosgenius.screendump/restart"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)restartServer, CFSTR("ru.mostmodest.screendump/restart"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||||
|
|
||||||
loadPrefs();
|
loadPrefs();
|
||||||
|
|
||||||
@@ -300,12 +307,12 @@ int main(int argc, const char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include <mach/mach.h>
|
#import <mach/mach.h>
|
||||||
#include <mach/mach_time.h>
|
#import <mach/mach_time.h>
|
||||||
#include <rfb/rfb.h>
|
#import <rfb/rfb.h>
|
||||||
#include <rfb/keysym.h>
|
#import <rfb/keysym.h>
|
||||||
#include "./include/IOKit/hid/IOHIDEventTypes.h"
|
#import "./include/IOKit/hid/IOHIDEventTypes.h"
|
||||||
#include "./include/IOKit/hidsystem/IOHIDUsageTables.h"
|
#import "./include/IOKit/hidsystem/IOHIDUsageTables.h"
|
||||||
|
|
||||||
typedef uint32_t IOHIDDigitizerTransducerType;
|
typedef uint32_t IOHIDDigitizerTransducerType;
|
||||||
|
|
||||||
@@ -416,12 +423,12 @@ static void VNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client)
|
|||||||
|
|
||||||
case XK_Shift_L: usage = kHIDUsage_KeyboardLeftShift; break;
|
case XK_Shift_L: usage = kHIDUsage_KeyboardLeftShift; break;
|
||||||
case XK_Shift_R: usage = kHIDUsage_KeyboardRightShift; break;
|
case XK_Shift_R: usage = kHIDUsage_KeyboardRightShift; break;
|
||||||
case XK_Control_L: usage = kHIDUsage_KeyboardLeftControl; break;
|
case XK_Control_L: usage = kHIDUsage_KeyboardLeftGUI; break;
|
||||||
case XK_Control_R: usage = kHIDUsage_KeyboardRightControl; break;
|
case XK_Control_R: usage = kHIDUsage_KeyboardRightGUI; break;
|
||||||
case XK_Meta_L: usage = kHIDUsage_KeyboardLeftAlt; break;
|
case XK_Meta_L: usage = kHIDUsage_KeyboardLeftControl; break;
|
||||||
case XK_Meta_R: usage = kHIDUsage_KeyboardRightAlt; break;
|
case XK_Meta_R: usage = kHIDUsage_KeyboardRightControl; break;
|
||||||
case XK_Alt_L: usage = kHIDUsage_KeyboardLeftGUI; break;
|
case XK_Alt_L: usage = kHIDUsage_KeyboardLeftAlt; break;
|
||||||
case XK_Alt_R: usage = kHIDUsage_KeyboardRightGUI; break;
|
case XK_Alt_R: usage = kHIDUsage_KeyboardRightAlt; break;
|
||||||
|
|
||||||
case XK_Up: usage = kHIDUsage_KeyboardUpArrow; break;
|
case XK_Up: usage = kHIDUsage_KeyboardUpArrow; break;
|
||||||
case XK_Down: usage = kHIDUsage_KeyboardDownArrow; break;
|
case XK_Down: usage = kHIDUsage_KeyboardDownArrow; break;
|
||||||
@@ -528,3 +535,17 @@ static void handleVNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client)
|
|||||||
static void handleVNCPointer(int buttons, int x, int y, rfbClientPtr client) {
|
static void handleVNCPointer(int buttons, int x, int y, rfbClientPtr client) {
|
||||||
VNCPointer(buttons, x, y, client);
|
VNCPointer(buttons, x, y, client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 기본 22:11:52.331940+0900 kernel Corpse released, count at 0
|
||||||
|
// 기본 22:11:52.414493+0900 kernel IOMFB: default_fb_surface: No Default FB Surface found. Return error
|
||||||
|
// 기본 22:11:52.414536+0900 kernel screendumpd[43722] Corpse allowed 1 of 5
|
||||||
|
// 기본 22:11:52.606790+0900 kernel Corpse released, count at 0
|
||||||
|
// 기본 22:11:52.682856+0900 kernel IOMFB: default_fb_surface: No Default FB Surface found. Return error
|
||||||
|
// 기본 22:11:52.682905+0900 kernel screendumpd[43723] Corpse allowed 1 of 5
|
||||||
|
// 기본 22:11:52.876255+0900 kernel Corpse released, count at 0
|
||||||
|
// 기본 22:11:52.915524+0900 kernel IOMFB: default_fb_surface: No Default FB Surface found. Return error
|
||||||
|
// 기본 22:11:52.915570+0900 kernel screendumpd[43724] Corpse allowed 1 of 5
|
||||||
|
// 기본 22:11:53.105917+0900 kernel Corpse released, count at 0
|
||||||
|
// 기본 22:11:53.277579+0900 kernel IOMFB: default_fb_surface: No Default FB Surface found. Return error
|
||||||
|
// 기본 22:11:53.277657+0900 kernel screendumpd[43725] Corpse allowed 1 of 5
|
||||||
|
// 기본 22:11:53.407555+0900 kernel IOMFB: default_fb_surface: No Default FB Surface found. Return error
|
||||||
|
|||||||
7
screendump/update_repo.sh
Executable file
7
screendump/update_repo.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
rm -rf packages/*
|
||||||
|
export FINALPACKAGE=1
|
||||||
|
make clean package
|
||||||
|
# ssh mostm@denver.lan "rm -rf /home/mostm/projects/repo/data/secure/debs/ru.mostmodest.screendump_*"
|
||||||
|
scp packages/* mostm@denver.lan:/home/mostm/projects/repo/data/secure/debs/
|
||||||
|
ssh mostm@denver.lan "bash /home/mostm/projects/repo/data/secure/updaterepo.sh"
|
||||||
BIN
screendumpLowFrame/.DS_Store
vendored
Normal file
BIN
screendumpLowFrame/.DS_Store
vendored
Normal file
Binary file not shown.
15
screendumpLowFrame/Capturer/Makefile
Normal file
15
screendumpLowFrame/Capturer/Makefile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
INSTALL_TARGET_PROCESSES = SpringBoard
|
||||||
|
|
||||||
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
|
TWEAK_NAME = screendumpbb
|
||||||
|
$(TWEAK_NAME)_FILES = Tweak.xm
|
||||||
|
#$(TWEAK_NAME)_ARCHS = arm64
|
||||||
|
#$(TWEAK_NAME)_FRAMEWORKS := IOSurface IOKit
|
||||||
|
#$(TWEAK_NAME)_PRIVATE_FRAMEWORKS := IOMobileFramebuffer IOSurface
|
||||||
|
|
||||||
|
#ADDITIONAL_OBJCFLAGS += -I../vncbuild/include -Iinclude
|
||||||
|
#ADDITIONAL_LDFLAGS += -Wl,-segalign,4000 -L../vncbuild/lib -lvncserver -lpng -llzo2 -ljpeg -lssl -lcrypto -lz
|
||||||
|
#ADDITIONAL_CFLAGS = -w
|
||||||
|
|
||||||
|
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
#include <errno.h>
|
#import <errno.h>
|
||||||
#include <substrate.h>
|
#import <substrate.h>
|
||||||
#include <rfb/rfb.h>
|
|
||||||
#import <notify.h>
|
#import <notify.h>
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
#import <rootless.h>
|
#import <rootless.h>
|
||||||
|
|
||||||
#undef NSLog
|
#define kSettingsPath @"/var/mobile/Library/Preferences/ru.mostmodest.screendump.plist"
|
||||||
|
|
||||||
extern "C" UIImage* _UICreateScreenUIImage();
|
extern "C" UIImage* _UICreateScreenUIImage();
|
||||||
|
|
||||||
@@ -17,13 +16,32 @@ static BOOL isBlackScreen;
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation CapturerScreen
|
@implementation CapturerScreen
|
||||||
- (id)init
|
|
||||||
|
-(id)init
|
||||||
{
|
{
|
||||||
|
NSLog(@"screendump bb: CapturerScreen init");
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
// [self start];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
- (unsigned char *)pixelBRGABytesFromImageRef:(CGImageRef)imageRef
|
|
||||||
|
+(void)load
|
||||||
|
{
|
||||||
|
CapturerScreen* instance = [self sharedInstance];
|
||||||
|
[instance start];
|
||||||
|
}
|
||||||
|
|
||||||
|
+(instancetype)sharedInstance
|
||||||
|
{
|
||||||
|
static dispatch_once_t onceToken = 0;
|
||||||
|
__strong static CapturerScreen* sharedInstance = nil;
|
||||||
|
dispatch_once(&onceToken, ^{
|
||||||
|
sharedInstance = [[self alloc] init];
|
||||||
|
});
|
||||||
|
return sharedInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
-(unsigned char *)pixelBRGABytesFromImageRef:(CGImageRef)imageRef
|
||||||
{
|
{
|
||||||
|
|
||||||
NSUInteger iWidth = CGImageGetWidth(imageRef);
|
NSUInteger iWidth = CGImageGetWidth(imageRef);
|
||||||
@@ -51,17 +69,18 @@ static BOOL isBlackScreen;
|
|||||||
|
|
||||||
return imageBytes;
|
return imageBytes;
|
||||||
}
|
}
|
||||||
- (unsigned char *)pixelBRGABytesFromImage:(UIImage *)image
|
-(unsigned char *)pixelBRGABytesFromImage:(UIImage *)image
|
||||||
{
|
{
|
||||||
return [self pixelBRGABytesFromImageRef:image.CGImage];
|
return [self pixelBRGABytesFromImageRef:image.CGImage];
|
||||||
}
|
}
|
||||||
- (void)start
|
-(void)start
|
||||||
{
|
{
|
||||||
dispatch_async(dispatch_get_main_queue(), ^(void){
|
dispatch_async(dispatch_get_main_queue(), ^(void){
|
||||||
|
NSLog(@"screendumpbb: setting capture timer every 0.4f");
|
||||||
[NSTimer scheduledTimerWithTimeInterval:0.4f target:self selector:@selector(capture) userInfo:nil repeats:YES];
|
[NSTimer scheduledTimerWithTimeInterval:0.4f target:self selector:@selector(capture) userInfo:nil repeats:YES];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
- (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize
|
-(UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize
|
||||||
{
|
{
|
||||||
//UIGraphicsBeginImageContext(newSize);
|
//UIGraphicsBeginImageContext(newSize);
|
||||||
UIGraphicsBeginImageContextWithOptions(newSize, NO, 1.0f);
|
UIGraphicsBeginImageContextWithOptions(newSize, NO, 1.0f);
|
||||||
@@ -71,15 +90,19 @@ static BOOL isBlackScreen;
|
|||||||
[image release];
|
[image release];
|
||||||
return newImage;
|
return newImage;
|
||||||
}
|
}
|
||||||
- (void)capture
|
-(void)capture
|
||||||
{
|
{
|
||||||
|
NSLog(@"screendumpbb: capture");
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
|
||||||
|
NSLog(@"screendumpbb: capture - isBlackScreen: %d", isBlackScreen);
|
||||||
|
NSLog(@"screendumpbb: capture - isEnabled: %d", isEnabled);
|
||||||
if(isBlackScreen || !isEnabled) {
|
if(isBlackScreen || !isEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UIImage* image = _UICreateScreenUIImage();
|
UIImage* image = _UICreateScreenUIImage();
|
||||||
|
NSLog(@"screendumpbb: capture - got frame, now resizing...");
|
||||||
|
|
||||||
CGSize newS = CGSizeMake(image.size.width, image.size.height);
|
CGSize newS = CGSizeMake(image.size.width, image.size.height);
|
||||||
|
|
||||||
@@ -94,19 +117,24 @@ static BOOL isBlackScreen;
|
|||||||
size_t size = iWidth * iHeight * iBytesPerPixel;
|
size_t size = iWidth * iHeight * iBytesPerPixel;
|
||||||
|
|
||||||
unsigned char * bytes = [self pixelBRGABytesFromImageRef:imageRef];
|
unsigned char * bytes = [self pixelBRGABytesFromImageRef:imageRef];
|
||||||
|
NSLog(@"screendumpbb: capture - resize complete, got bytes");
|
||||||
|
|
||||||
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
NSLog(@"screendumpbb: capture - writing buffer...");
|
||||||
NSData *imageData = [NSData dataWithBytesNoCopy:bytes length:size freeWhenDone:YES];
|
NSData *imageData = [NSData dataWithBytesNoCopy:bytes length:size freeWhenDone:YES];
|
||||||
[imageData writeToFile:@"//tmp/screendump_Buff.tmp" atomically:YES];
|
[imageData writeToFile:@"//tmp/screendump_Buff.tmp" atomically:YES];
|
||||||
[@{@"width":@(iWidth), @"height":@(iHeight), @"size":@(size),} writeToFile:@"//tmp/screendump_Info.tmp" atomically:YES];
|
[@{@"width":@(iWidth), @"height":@(iHeight), @"size":@(size),} writeToFile:@"//tmp/screendump_Info.tmp" atomically:YES];
|
||||||
notify_post("com.julioverne.screendump/frameChanged");
|
NSLog(@"screendumpbb: capture - notifying daemon");
|
||||||
|
notify_post("ru.mostmodest.screendump/frameChanged");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/*
|
||||||
%hook SpringBoard
|
%hook SpringBoard
|
||||||
- (void)applicationDidFinishLaunching:(id)application
|
- (void)applicationDidFinishLaunching:(id)application
|
||||||
{
|
{
|
||||||
@@ -115,7 +143,7 @@ static BOOL isBlackScreen;
|
|||||||
[cap start];
|
[cap start];
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
*/
|
||||||
|
|
||||||
static void screenDisplayStatus(CFNotificationCenterRef center, void* observer, CFStringRef name, const void* object, CFDictionaryRef userInfo)
|
static void screenDisplayStatus(CFNotificationCenterRef center, void* observer, CFStringRef name, const void* object, CFDictionaryRef userInfo)
|
||||||
{
|
{
|
||||||
@@ -129,21 +157,29 @@ static void screenDisplayStatus(CFNotificationCenterRef center, void* observer,
|
|||||||
} else {
|
} else {
|
||||||
isBlackScreen = NO;
|
isBlackScreen = NO;
|
||||||
}
|
}
|
||||||
|
NSLog(@"screendumpbb: screenDisplayStatus - isBlackScreen: %d", isBlackScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void loadPrefs(CFNotificationCenterRef center, void* observer, CFStringRef name, const void* object, CFDictionaryRef userInfo)
|
static void loadPrefs(CFNotificationCenterRef center, void* observer, CFStringRef name, const void* object, CFDictionaryRef userInfo)
|
||||||
{
|
{
|
||||||
|
NSLog(@"screendumpbb: loadPrefs");
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:@"com.cosmosgenius.screendump"];
|
NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:@"ru.mostmodest.screendump"];
|
||||||
isEnabled = [[defaults objectForKey:@"CCSisEnabled"]?:@NO boolValue];
|
isEnabled = [[defaults objectForKey:@"CCSisEnabled"]?:@NO boolValue];
|
||||||
|
NSLog(@"screendumpbb: loadPrefs - isEnabled: %d", isEnabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%ctor
|
%ctor
|
||||||
{
|
{
|
||||||
|
NSLog(@"screendumpbb: ctor");
|
||||||
|
isEnabled = NO;
|
||||||
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, screenDisplayStatus, CFSTR("com.apple.iokit.hid.displayStatus"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, screenDisplayStatus, CFSTR("com.apple.iokit.hid.displayStatus"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||||
|
NSLog(@"screendumpbb: ctor 1");
|
||||||
|
|
||||||
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, loadPrefs, CFSTR("com.cosmosgenius.screendump/preferences.changed"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, loadPrefs, CFSTR("ru.mostmodest.screendump/preferences.changed"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||||
|
NSLog(@"screendumpbb: ctor 2");
|
||||||
|
|
||||||
loadPrefs(NULL, NULL, NULL, NULL, NULL);
|
loadPrefs(NULL, NULL, NULL, NULL, NULL);
|
||||||
|
NSLog(@"screendumpbb: ctor 3");
|
||||||
}
|
}
|
||||||
5
screendumpLowFrame/Capturer/screendumpbb.plist
Normal file
5
screendumpLowFrame/Capturer/screendumpbb.plist
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
Filter = {
|
||||||
|
Bundles = ( "com.apple.springboard" );
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,41 +1,14 @@
|
|||||||
TARGET = iphone:16.5:14.0
|
export THEOS_PACKAGE_SCHEME = rootless
|
||||||
|
export ARCHS = arm64 arm64e
|
||||||
|
export TARGET = iphone:16.5:14.0
|
||||||
|
export GO_EASY_ON_ME = 1
|
||||||
|
export COPYFILE_DISABLE=1
|
||||||
|
|
||||||
include $(THEOS)/makefiles/common.mk
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
ifeq ($(THEOS_PACKAGE_SCHEME),rootless)
|
SUBPROJECTS += Capturer Server
|
||||||
PACKAGE_BUILDNAME := rootless
|
|
||||||
else
|
|
||||||
PACKAGE_BUILDNAME := rootful
|
|
||||||
endif
|
|
||||||
|
|
||||||
TOOL_NAME = screendumpd
|
|
||||||
$(TOOL_NAME)_FILES = main.mm
|
|
||||||
export ARCHS = arm64
|
|
||||||
$(TOOL_NAME)_ARCHS = arm64
|
|
||||||
ARCHS = arm64
|
|
||||||
$(TOOL_NAME)_VALID_ARCHS = arm64
|
|
||||||
$(TOOL_NAME)_FRAMEWORKS := IOSurface IOKit
|
|
||||||
$(TOOL_NAME)_PRIVATE_FRAMEWORKS := IOMobileFramebuffer IOSurface
|
|
||||||
$(TOOL_NAME)_OBJCFLAGS += -Ivncbuild/include -Iinclude
|
|
||||||
$(TOOL_NAME)_LDFLAGS += -Wl,-segalign,4000 -Lvncbuild/lib -lvncserver -lpng -llzo2 -ljpeg -lssl -lcrypto -lz
|
|
||||||
$(TOOL_NAME)_CFLAGS = -w
|
|
||||||
$(TOOL_NAME)_CODESIGN_FLAGS = "-Sen.plist"
|
|
||||||
$(TOOL_NAME)_INSTALL_PATH = /usr/libexec
|
|
||||||
|
|
||||||
include $(THEOS_MAKE_PATH)/tool.mk
|
|
||||||
|
|
||||||
|
|
||||||
SUBPROJECTS += hooks
|
|
||||||
|
|
||||||
include $(THEOS_MAKE_PATH)/aggregate.mk
|
include $(THEOS_MAKE_PATH)/aggregate.mk
|
||||||
|
|
||||||
ifeq ($(THEOS_PACKAGE_SCHEME),rootless)
|
|
||||||
after-screendumpd-stage::
|
after-screendumpd-stage::
|
||||||
$(ECHO_NOTHING) rm $(THEOS_STAGING_DIR)/Library/LaunchDaemons/com.julioverne.screendumpd.plist$(ECHO_END)
|
$(ECHO_NOTHING)$(FAKEROOT) chown root:wheel $(THEOS_STAGING_DIR)/Library/LaunchDaemons/ru.mostmodest.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
|
|
||||||
17
screendumpLowFrame/Server/Makefile
Normal file
17
screendumpLowFrame/Server/Makefile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
|
TOOL_NAME = screendumpd
|
||||||
|
$(TOOL_NAME)_FILES = main.mm
|
||||||
|
$(TOOL_NAME)_ARCHS = arm64
|
||||||
|
$(TOOL_NAME)_FRAMEWORKS := IOSurface IOKit
|
||||||
|
$(TOOL_NAME)_PRIVATE_FRAMEWORKS := IOMobileFramebuffer IOSurface
|
||||||
|
$(TOOL_NAME)_OBJCFLAGS += -I../vncbuild/include -Iinclude
|
||||||
|
$(TOOL_NAME)_LDFLAGS += -Wl,-segalign,4000 -L../vncbuild/lib -lvncserver -lpng -llzo2 -ljpeg -lssl -lcrypto -lz
|
||||||
|
$(TOOL_NAME)_INSTALL_PATH = /usr/libexec
|
||||||
|
$(TOOL_NAME)_CFLAGS = -w
|
||||||
|
$(TOOL_NAME)_CODESIGN_FLAGS = -Sentitlements.plist
|
||||||
|
|
||||||
|
include $(THEOS_MAKE_PATH)/tool.mk
|
||||||
|
|
||||||
|
after-screendumpd-stage::
|
||||||
|
$(ECHO_NOTHING)$(FAKEROOT) chown root:wheel $(THEOS_STAGING_DIR)/Library/LaunchDaemons/ru.mostmodest.screendumpd.plist$(ECHO_END)
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
<?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">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
@@ -47,4 +46,4 @@
|
|||||||
<key>com.apple.private.security.disk-device-access</key>
|
<key>com.apple.private.security.disk-device-access</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
64
screendumpLowFrame/main.mm → screendumpLowFrame/Server/main.mm
Normal file → Executable file
64
screendumpLowFrame/main.mm → screendumpLowFrame/Server/main.mm
Normal file → Executable file
@@ -1,10 +1,12 @@
|
|||||||
#include <errno.h>
|
#import <errno.h>
|
||||||
#include <substrate.h>
|
#import <substrate.h>
|
||||||
#include <rfb/rfb.h>
|
#import <rfb/rfb.h>
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <IOSurface/IOSurfaceRef.h>
|
#import <IOSurface/IOSurfaceRef.h>
|
||||||
#import <rootless.h>
|
#import <rootless.h>
|
||||||
|
|
||||||
|
#define kSettingsPath @"/var/mobile/Library/Preferences/ru.mostmodest.screendump.plist"
|
||||||
|
|
||||||
static bool CCSisEnabled = true;
|
static bool CCSisEnabled = true;
|
||||||
static NSString *CCSPassword = nil;
|
static NSString *CCSPassword = nil;
|
||||||
static rfbScreenInfoPtr screen;
|
static rfbScreenInfoPtr screen;
|
||||||
@@ -45,7 +47,7 @@ typedef mach_port_t io_service_t;
|
|||||||
typedef kern_return_t IOReturn;
|
typedef kern_return_t IOReturn;
|
||||||
typedef IOReturn IOMobileFramebufferReturn;
|
typedef IOReturn IOMobileFramebufferReturn;
|
||||||
typedef io_service_t IOMobileFramebufferService;
|
typedef io_service_t IOMobileFramebufferService;
|
||||||
extern "C" mach_port_t mach_task_self(void);
|
extern "C" mach_port_t mach_task_self();
|
||||||
extern "C" void IOSurfaceFlushProcessorCaches(IOSurfaceRef buffer);
|
extern "C" void IOSurfaceFlushProcessorCaches(IOSurfaceRef buffer);
|
||||||
extern "C" int IOSurfaceLock(IOSurfaceRef surface, uint32_t options, uint32_t *seed);
|
extern "C" int IOSurfaceLock(IOSurfaceRef surface, uint32_t options, uint32_t *seed);
|
||||||
extern "C" int IOSurfaceUnlock(IOSurfaceRef surface, uint32_t options, uint32_t *seed);
|
extern "C" int IOSurfaceUnlock(IOSurfaceRef surface, uint32_t options, uint32_t *seed);
|
||||||
@@ -64,6 +66,7 @@ static void handleVNCPointer(int buttons, int x, int y, rfbClientPtr client);
|
|||||||
|
|
||||||
static rfbBool VNCCheck(rfbClientPtr client, const char *data, int size)
|
static rfbBool VNCCheck(rfbClientPtr client, const char *data, int size)
|
||||||
{
|
{
|
||||||
|
NSLog(@"screendumpd: VNCCheck");
|
||||||
NSString *password = reinterpret_cast<NSString *>(screen->authPasswdData);
|
NSString *password = reinterpret_cast<NSString *>(screen->authPasswdData);
|
||||||
if(!password) {
|
if(!password) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -80,6 +83,7 @@ static rfbBool VNCCheck(rfbClientPtr client, const char *data, int size)
|
|||||||
|
|
||||||
static void VNCSetup()
|
static void VNCSetup()
|
||||||
{
|
{
|
||||||
|
NSLog(@"screendumpd: VNCSetup");
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
NSDictionary* frameInfo = [NSDictionary dictionaryWithContentsOfFile:@"//tmp/screendump_Info.tmp"]?:@{};
|
NSDictionary* frameInfo = [NSDictionary dictionaryWithContentsOfFile:@"//tmp/screendump_Info.tmp"]?:@{};
|
||||||
width = [frameInfo[@"width"]?:@(0) intValue];
|
width = [frameInfo[@"width"]?:@(0) intValue];
|
||||||
@@ -114,43 +118,59 @@ static void VNCSettings(bool shouldStart, NSString* password)
|
|||||||
CCSPassword = password;
|
CCSPassword = password;
|
||||||
}
|
}
|
||||||
NSString *sEnabled = CCSisEnabled ? @"YES": @"NO";
|
NSString *sEnabled = CCSisEnabled ? @"YES": @"NO";
|
||||||
|
NSLog(@"screendumpd: VNCSettings - is enabled - %@", sEnabled);
|
||||||
|
NSLog(@"screendumpd: VNCSettings - password - %@", CCSPassword);
|
||||||
VNCUpdateRunState(CCSisEnabled);
|
VNCUpdateRunState(CCSisEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void VNCUpdateRunState(bool shouldStart)
|
static void VNCUpdateRunState(bool shouldStart)
|
||||||
{
|
{
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState");
|
||||||
if(screen == NULL) {
|
if(screen == NULL) {
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - screen is nil");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(CCSPassword && CCSPassword.length) {
|
if(CCSPassword && CCSPassword.length) {
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - configured password");
|
||||||
screen->authPasswdData = (void *) CCSPassword;
|
screen->authPasswdData = (void *) CCSPassword;
|
||||||
} else {
|
} else {
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - set password to nil");
|
||||||
screen->authPasswdData = NULL;
|
screen->authPasswdData = NULL;
|
||||||
}
|
}
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - vnc is running?");
|
||||||
if(shouldStart == isVNCRunning) {
|
if(shouldStart == isVNCRunning) {
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - vnc is running");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - vnc is not running");
|
||||||
if(shouldStart) {
|
if(shouldStart) {
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - rfbInitServer");
|
||||||
rfbInitServer(screen);
|
rfbInitServer(screen);
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - rfbRunEventLoop");
|
||||||
rfbRunEventLoop(screen, -1, true);
|
rfbRunEventLoop(screen, -1, true);
|
||||||
} else {
|
} else {
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - rfbShutdownServer");
|
||||||
rfbShutdownServer(screen, true);
|
rfbShutdownServer(screen, true);
|
||||||
}
|
}
|
||||||
isVNCRunning = shouldStart;
|
isVNCRunning = shouldStart;
|
||||||
|
NSLog(@"screendumpd: VNCUpdateRunState - isVNCRunning: %d", isVNCRunning);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void loadPrefs(void)
|
static void loadPrefs(void)
|
||||||
{
|
{
|
||||||
|
NSLog(@"screendumpd: load prefs");
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
NSDictionary* defaults = nil;
|
NSDictionary* defaults = nil;
|
||||||
CFStringRef appID = CFSTR("com.cosmosgenius.screendump");
|
CFStringRef appID = CFSTR("ru.mostmodest.screendump");
|
||||||
CFArrayRef keyList = CFPreferencesCopyKeyList(appID, CFSTR("mobile"), kCFPreferencesAnyHost);
|
CFArrayRef keyList = CFPreferencesCopyKeyList(appID, CFSTR("mobile"), kCFPreferencesAnyHost);
|
||||||
if(keyList) {
|
if(keyList) {
|
||||||
defaults = (NSDictionary *)CFPreferencesCopyMultiple(keyList, appID, CFSTR("mobile"), kCFPreferencesAnyHost)?:@{};
|
defaults = (NSDictionary *)CFPreferencesCopyMultiple(keyList, appID, CFSTR("mobile"), kCFPreferencesAnyHost)?:@{};
|
||||||
CFRelease(keyList);
|
CFRelease(keyList);
|
||||||
}
|
}
|
||||||
BOOL isEnabled = [[defaults objectForKey:@"CCSisEnabled"]?:@NO boolValue];
|
BOOL isEnabled = [[defaults objectForKey:@"CCSisEnabled"]?:@NO boolValue];
|
||||||
|
NSLog(@"screendumpd: prefs - is enabled - %d", isEnabled);
|
||||||
NSString *password = [defaults objectForKey:@"CCSPassword"];
|
NSString *password = [defaults objectForKey:@"CCSPassword"];
|
||||||
|
NSLog(@"screendumpd: prefs - password - %@", password);
|
||||||
VNCSettings(isEnabled, password);
|
VNCSettings(isEnabled, password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,22 +182,28 @@ static void VNCBlack()
|
|||||||
|
|
||||||
static void upFrame()
|
static void upFrame()
|
||||||
{
|
{
|
||||||
|
NSLog(@"screendumpd: upFrame");
|
||||||
if(size_image == 0) {
|
if(size_image == 0) {
|
||||||
|
NSLog(@"screendumpd: upFrame - size_image = 0");
|
||||||
VNCSetup();
|
VNCSetup();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(screen == NULL) {
|
if(screen == NULL) {
|
||||||
|
NSLog(@"screendumpd: upFrame - screen is nil");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@try {
|
@try {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
NSLog(@"screendumpd: upFrame - updating buffer...");
|
||||||
NSData *data = [[NSFileManager defaultManager] contentsAtPath:@"//tmp/screendump_Buff.tmp"];
|
NSData *data = [[NSFileManager defaultManager] contentsAtPath:@"//tmp/screendump_Buff.tmp"];
|
||||||
memcpy(screen->frameBuffer, (void*)data.bytes, data.length);
|
memcpy(screen->frameBuffer, (void*)data.bytes, data.length);
|
||||||
|
NSLog(@"screendumpd: upFrame - updated buffer");
|
||||||
}
|
}
|
||||||
}@catch(NSException*e){
|
}@catch(NSException*e){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSLog(@"screendumpd: upFrame - requesting to send a new frame");
|
||||||
rfbMarkRectAsModified(screen, 0, 0, width, height);
|
rfbMarkRectAsModified(screen, 0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,34 +212,40 @@ extern "C" IOMobileFramebufferReturn IOMobileFramebufferGetMainDisplay(IOMobileF
|
|||||||
int main(int argc, const char *argv[])
|
int main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
|
isVNCRunning = NO;
|
||||||
|
NSLog(@"screendumpd: main start");
|
||||||
CFNotificationCenterAddObserver(
|
CFNotificationCenterAddObserver(
|
||||||
CFNotificationCenterGetDarwinNotifyCenter(),
|
CFNotificationCenterGetDarwinNotifyCenter(),
|
||||||
NULL, (CFNotificationCallback)loadPrefs,
|
NULL, (CFNotificationCallback)loadPrefs,
|
||||||
CFSTR("com.cosmosgenius.screendump/preferences.changed"),
|
CFSTR("ru.mostmodest.screendump/preferences.changed"),
|
||||||
NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||||
|
|
||||||
CFNotificationCenterAddObserver(
|
CFNotificationCenterAddObserver(
|
||||||
CFNotificationCenterGetDarwinNotifyCenter(),
|
CFNotificationCenterGetDarwinNotifyCenter(),
|
||||||
NULL, (CFNotificationCallback)upFrame,
|
NULL, (CFNotificationCallback)upFrame,
|
||||||
CFSTR("com.julioverne.screendump/frameChanged"),
|
CFSTR("ru.mostmodest.screendump/frameChanged"),
|
||||||
NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||||
|
|
||||||
loadPrefs();
|
NSLog(@"screendumpd: main - vnc setup");
|
||||||
|
|
||||||
VNCSetup();
|
VNCSetup();
|
||||||
//VNCBlack();
|
//VNCBlack();
|
||||||
|
|
||||||
|
NSLog(@"screendumpd: main - load prefs");
|
||||||
|
loadPrefs();
|
||||||
|
|
||||||
|
NSLog(@"screendumpd: main - loop");
|
||||||
[[NSRunLoop currentRunLoop] run];
|
[[NSRunLoop currentRunLoop] run];
|
||||||
|
NSLog(@"screendumpd: main - end");
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include <mach/mach.h>
|
#import <mach/mach.h>
|
||||||
#include <mach/mach_time.h>
|
#import <mach/mach_time.h>
|
||||||
#include <rfb/rfb.h>
|
#import <rfb/rfb.h>
|
||||||
#include <rfb/keysym.h>
|
#import <rfb/keysym.h>
|
||||||
#include "./include/IOKit/hid/IOHIDEventTypes.h"
|
#import "./include/IOKit/hid/IOHIDEventTypes.h"
|
||||||
#include "./include/IOKit/hidsystem/IOHIDUsageTables.h"
|
#import "./include/IOKit/hidsystem/IOHIDUsageTables.h"
|
||||||
|
|
||||||
typedef uint32_t IOHIDDigitizerTransducerType;
|
typedef uint32_t IOHIDDigitizerTransducerType;
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/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
|
|
||||||
11
screendumpLowFrame/control
Normal file
11
screendumpLowFrame/control
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Package: ru.mostmodest.screendump.lowframe
|
||||||
|
Name: screendumpLowFrame
|
||||||
|
Architecture: iphoneos-arm
|
||||||
|
Description: VNC for iOS15+ (rootless/Ellekit)
|
||||||
|
Maintainer: mostm
|
||||||
|
Author: julioverne
|
||||||
|
Section: Tweaks
|
||||||
|
Conflicts: ru.mostmodest.screendump
|
||||||
|
Depends: mobilesubstrate, preferenceloader
|
||||||
|
Icon: file:///Library/PreferenceLoader/Preferences/screendump/ScreenDump@2x.png
|
||||||
|
Version: 0.0.5
|
||||||
@@ -1,18 +0,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
|
|
||||||
$(TWEAK_NAME)_PRIVATE_FRAMEWORKS := IOMobileFramebuffer IOSurface
|
|
||||||
|
|
||||||
ADDITIONAL_OBJCFLAGS += -I../vncbuild/include -Iinclude
|
|
||||||
ADDITIONAL_LDFLAGS += -Wl,-segalign,4000
|
|
||||||
ADDITIONAL_CFLAGS = -w
|
|
||||||
|
|
||||||
export ARCHS = arm64
|
|
||||||
$(TWEAK_NAME)_ARCHS = arm64
|
|
||||||
|
|
||||||
include $(THEOS_MAKE_PATH)/tweak.mk
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
Filter = {
|
|
||||||
Executables = (
|
|
||||||
"SpringBoard",
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
Package: com.cosmosgenius.screendump13
|
|
||||||
Name: screendump
|
|
||||||
Depends: preferenceloader
|
|
||||||
Architecture: iphoneos-arm
|
|
||||||
Description: VNC for ios
|
|
||||||
Maintainer: Sharat M R <cosmosgenius@gmail.com>
|
|
||||||
Author: Sharat M R <cosmosgenius@gmail.com>
|
|
||||||
Section: Tweaks
|
|
||||||
Version: 0.0.4
|
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ -L "/var/jb" ]; then
|
if [ -L "/var/jb" ]; then
|
||||||
launchctl unload /var/jb/Library/LaunchDaemons/com.julioverne.screendumpd.plist
|
launchctl load /var/jb/Library/LaunchDaemons/ru.mostmodest.screendumpd.plist
|
||||||
launchctl load /var/jb/Library/LaunchDaemons/com.julioverne.screendumpd.plist
|
|
||||||
else
|
else
|
||||||
launchctl unload /Library/LaunchDaemons/com.julioverne.screendumpd.plist
|
launchctl load /Library/LaunchDaemons/ru.mostmodest.screendumpd.plist
|
||||||
launchctl load /Library/LaunchDaemons/com.julioverne.screendumpd.plist
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|||||||
9
screendumpLowFrame/layout/DEBIAN/preinst
Executable file
9
screendumpLowFrame/layout/DEBIAN/preinst
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -L "/var/jb" ]; then
|
||||||
|
launchctl unload /var/jb/Library/LaunchDaemons/ru.mostmodest.screendumpd.plist
|
||||||
|
else
|
||||||
|
launchctl unload /Library/LaunchDaemons/ru.mostmodest.screendumpd.plist
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
if [ -L "/var/jb" ]; then
|
if [ -L "/var/jb" ]; then
|
||||||
launchctl unload /var/jb/Library/LaunchDaemons/com.julioverne.screendumpd.plist
|
launchctl unload /var/jb/Library/LaunchDaemons/ru.mostmodest.screendumpd.plist
|
||||||
else
|
else
|
||||||
launchctl unload /Library/LaunchDaemons/com.julioverne.screendumpd.plist
|
launchctl unload /Library/LaunchDaemons/ru.mostmodest.screendumpd.plist
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>Label</key>
|
<key>Label</key>
|
||||||
<string>com.julioverne.screendumpd</string>
|
<string>ru.mostmodest.screendumpd</string>
|
||||||
<key>ProgramArguments</key>
|
<key>ProgramArguments</key>
|
||||||
<array>
|
<array>
|
||||||
<string>/usr/libexec/screendumpd</string>
|
<string>/var/jb/usr/libexec/screendumpd</string>
|
||||||
</array>
|
</array>
|
||||||
<key>RunAtLoad</key>
|
<key>RunAtLoad</key>
|
||||||
<true/>
|
<true/>
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
Filter = {
|
|
||||||
Executables = (
|
|
||||||
"SpringBoard",
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Binary file not shown.
7
screendumpLowFrame/update_repo.sh
Executable file
7
screendumpLowFrame/update_repo.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
rm -rf packages/*
|
||||||
|
export FINALPACKAGE=1
|
||||||
|
make clean package
|
||||||
|
# ssh mostm@denver.lan "rm -rf /home/mostm/projects/repo/data/secure/debs/ru.mostmodest.screendump_*"
|
||||||
|
scp packages/* mostm@denver.lan:/home/mostm/projects/repo/data/secure/debs/
|
||||||
|
ssh mostm@denver.lan "bash /home/mostm/projects/repo/data/secure/updaterepo.sh"
|
||||||
2
screendumpLowFrame/vncbuild/include/rfb/rfbclient.h
Normal file → Executable file
2
screendumpLowFrame/vncbuild/include/rfb/rfbclient.h
Normal file → Executable file
@@ -81,7 +81,7 @@
|
|||||||
#define TUNNEL_PORT_OFFSET 5500
|
#define TUNNEL_PORT_OFFSET 5500
|
||||||
#define SERVER_PORT_OFFSET 5900
|
#define SERVER_PORT_OFFSET 5900
|
||||||
|
|
||||||
#define DEFAULT_SSH_CMD "/usr/bin/ssh"
|
#define DEFAULT_SSH_CMD "/var/jb/usr/bin/ssh"
|
||||||
#define DEFAULT_TUNNEL_CMD \
|
#define DEFAULT_TUNNEL_CMD \
|
||||||
(DEFAULT_SSH_CMD " -f -L %L:localhost:%R %H sleep 20")
|
(DEFAULT_SSH_CMD " -f -L %L:localhost:%R %H sleep 20")
|
||||||
#define DEFAULT_VIA_CMD \
|
#define DEFAULT_VIA_CMD \
|
||||||
|
|||||||
Reference in New Issue
Block a user