mirror of
https://github.com/bryangerlach/rdgen.git
synced 2025-11-29 00:23:27 +00:00
1.4.4
This commit is contained in:
67
.github/patches/allowCustom.py
vendored
Normal file
67
.github/patches/allowCustom.py
vendored
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
def remove_line_block(filepath, start_phrase, lines_to_remove_after_start):
|
||||||
|
"""
|
||||||
|
Removes a starting line and a fixed number of lines immediately following it.
|
||||||
|
|
||||||
|
:param filepath: The path to the file to modify.
|
||||||
|
:param start_phrase: The unique string to identify the first line of the block.
|
||||||
|
:param lines_to_remove_after_start: The number of lines to remove after the starting line.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# 1. Configuration for the removal logic
|
||||||
|
# The starting line is: const KEY: &str = "5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=";
|
||||||
|
# The block contains this line plus 8 following lines, so we want to skip 9 lines in total.
|
||||||
|
total_lines_to_skip = 1 + lines_to_remove_after_start # 1 (start line) + 8 (following lines) = 9
|
||||||
|
|
||||||
|
lines_to_keep = []
|
||||||
|
skip_count = 0
|
||||||
|
|
||||||
|
# 2. Read and filter the file content
|
||||||
|
try:
|
||||||
|
with open(filepath, 'r') as file:
|
||||||
|
for line in file:
|
||||||
|
|
||||||
|
# If we are currently in the process of skipping lines, decrement the counter and continue
|
||||||
|
if skip_count > 0:
|
||||||
|
skip_count -= 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Check if the line matches the start phrase (we use .strip() to ignore indentation/whitespace)
|
||||||
|
if line.strip().startswith(start_phrase.strip()):
|
||||||
|
# Start skipping the block (including the current line)
|
||||||
|
skip_count = total_lines_to_skip - 1
|
||||||
|
# Note: We subtract 1 because the 'continue' will handle the first line removal immediately
|
||||||
|
continue
|
||||||
|
|
||||||
|
# If we are not skipping, keep the line
|
||||||
|
lines_to_keep.append(line)
|
||||||
|
|
||||||
|
except FileNotFoundError:
|
||||||
|
print(f"Error: File not found at {filepath}")
|
||||||
|
return
|
||||||
|
|
||||||
|
# 3. Write the remaining lines back to the file (with backup)
|
||||||
|
try:
|
||||||
|
# Create a backup just in case
|
||||||
|
backup_filepath = filepath + '.bak'
|
||||||
|
shutil.copyfile(filepath, backup_filepath)
|
||||||
|
|
||||||
|
with open(filepath, 'w') as file:
|
||||||
|
file.writelines(lines_to_keep)
|
||||||
|
|
||||||
|
print(f"✅ Success! Removed the 9-line block starting with '{start_phrase.strip()}' from {filepath}.")
|
||||||
|
print(f"A backup of the original file was saved as {backup_filepath}.")
|
||||||
|
|
||||||
|
except IOError as e:
|
||||||
|
print(f"An error occurred while writing to the file: {e}")
|
||||||
|
|
||||||
|
def main():
|
||||||
|
file_path = 'src/common.rs'
|
||||||
|
start_phrase = 'const KEY: &str = "5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=";'
|
||||||
|
lines_to_remove_after_start = 8
|
||||||
|
remove_line_block(file_path, start_phrase, lines_to_remove_after_start)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
10
.github/patches/cycle_monitor.diff
vendored
10
.github/patches/cycle_monitor.diff
vendored
@@ -2,7 +2,7 @@ diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/deskt
|
|||||||
index 839ea1a81..9cee52263 100644
|
index 839ea1a81..9cee52263 100644
|
||||||
--- a/flutter/lib/desktop/widgets/remote_toolbar.dart
|
--- a/flutter/lib/desktop/widgets/remote_toolbar.dart
|
||||||
+++ b/flutter/lib/desktop/widgets/remote_toolbar.dart
|
+++ b/flutter/lib/desktop/widgets/remote_toolbar.dart
|
||||||
@@ -437,6 +437,7 @@ class _RemoteToolbarState extends State<RemoteToolbar> {
|
@@ -317,6 +317,7 @@ class _RemoteToolbarState extends State<RemoteToolbar> {
|
||||||
borderRadius: borderRadius,
|
borderRadius: borderRadius,
|
||||||
child: _DraggableShowHide(
|
child: _DraggableShowHide(
|
||||||
id: widget.id,
|
id: widget.id,
|
||||||
@@ -10,7 +10,7 @@ index 839ea1a81..9cee52263 100644
|
|||||||
sessionId: widget.ffi.sessionId,
|
sessionId: widget.ffi.sessionId,
|
||||||
dragging: _dragging,
|
dragging: _dragging,
|
||||||
fractionX: _fractionX,
|
fractionX: _fractionX,
|
||||||
@@ -2234,6 +2235,7 @@ class RdoMenuButton<T> extends StatelessWidget {
|
@@ -2460,6 +2460,7 @@ class RdoMenuButton<T> extends StatelessWidget {
|
||||||
|
|
||||||
class _DraggableShowHide extends StatefulWidget {
|
class _DraggableShowHide extends StatefulWidget {
|
||||||
final String id;
|
final String id;
|
||||||
@@ -18,7 +18,7 @@ index 839ea1a81..9cee52263 100644
|
|||||||
final SessionID sessionId;
|
final SessionID sessionId;
|
||||||
final RxDouble fractionX;
|
final RxDouble fractionX;
|
||||||
final RxBool dragging;
|
final RxBool dragging;
|
||||||
@@ -2246,6 +2248,7 @@ class _DraggableShowHide extends StatefulWidget {
|
@@ -2472,6 +2472,7 @@ class _DraggableShowHide extends StatefulWidget {
|
||||||
const _DraggableShowHide({
|
const _DraggableShowHide({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.id,
|
required this.id,
|
||||||
@@ -26,7 +26,7 @@ index 839ea1a81..9cee52263 100644
|
|||||||
required this.sessionId,
|
required this.sessionId,
|
||||||
required this.fractionX,
|
required this.fractionX,
|
||||||
required this.dragging,
|
required this.dragging,
|
||||||
@@ -2357,6 +2360,7 @@ class _DraggableShowHideState extends State<_DraggableShowHide> {
|
@@ -2583,6 +2583,7 @@ class _DraggableShowHideState extends State<_DraggableShowHide> {
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
_buildDraggable(context),
|
_buildDraggable(context),
|
||||||
@@ -34,7 +34,7 @@ index 839ea1a81..9cee52263 100644
|
|||||||
Obx(() => buttonWrapper(
|
Obx(() => buttonWrapper(
|
||||||
() {
|
() {
|
||||||
widget.setFullscreen(!isFullscreen.value);
|
widget.setFullscreen(!isFullscreen.value);
|
||||||
@@ -2463,3 +2467,50 @@ Widget _buildPointerTrackWidget(Widget child, FFI? ffi) {
|
@@ -2689,3 +2689,50 @@ Widget _buildPointerTrackWidget(Widget child, FFI? ffi) {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
6
.github/workflows/generator-windows.yml
vendored
6
.github/workflows/generator-windows.yml
vendored
@@ -229,7 +229,6 @@ jobs:
|
|||||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./flutter/windows/runner/Runner.rc
|
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./flutter/windows/runner/Runner.rc
|
||||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./Cargo.toml
|
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./Cargo.toml
|
||||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./libs/portable/Cargo.toml
|
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./libs/portable/Cargo.toml
|
||||||
sed -i -e 's|Purslane Ltd.|${{ fromJson(inputs.extras).compname }}|' ./res/setup.nsi
|
|
||||||
|
|
||||||
- name: change url to custom
|
- name: change url to custom
|
||||||
if: fromJson(inputs.extras).urlLink != 'https://rustdesk.com'
|
if: fromJson(inputs.extras).urlLink != 'https://rustdesk.com'
|
||||||
@@ -243,7 +242,6 @@ jobs:
|
|||||||
sed -i -e "s|const url = 'https://rustdesk.com/';|const url = '${{ fromJson(inputs.extras).urlLink }}';|" ./flutter/lib/mobile/pages/settings_page.dart
|
sed -i -e "s|const url = 'https://rustdesk.com/';|const url = '${{ fromJson(inputs.extras).urlLink }}';|" ./flutter/lib/mobile/pages/settings_page.dart
|
||||||
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ fromJson(inputs.extras).urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
|
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ fromJson(inputs.extras).urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
|
||||||
sed -i -e "s|https://rustdesk.com/privacy.html|${{ fromJson(inputs.extras).urlLink }}/privacy.html|" ./flutter/lib/desktop/pages/install_page.dart
|
sed -i -e "s|https://rustdesk.com/privacy.html|${{ fromJson(inputs.extras).urlLink }}/privacy.html|" ./flutter/lib/desktop/pages/install_page.dart
|
||||||
#sed -i -e "s|https://rustdesk.com/|${{fromJson(inputs.extras).urlLink }}|" ./res/setup.nsi
|
|
||||||
|
|
||||||
- name: change download link to custom
|
- name: change download link to custom
|
||||||
if: fromJson(inputs.extras).downloadLink != 'https://rustdesk.com/download'
|
if: fromJson(inputs.extras).downloadLink != 'https://rustdesk.com/download'
|
||||||
@@ -267,8 +265,8 @@ jobs:
|
|||||||
- name: allow custom.txt
|
- name: allow custom.txt
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.diff -OutFile allowCustom.diff
|
Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.py -OutFile allowCustom.py
|
||||||
git apply allowCustom.diff
|
python allowCustom.py
|
||||||
# Remove Setup Server Tip
|
# Remove Setup Server Tip
|
||||||
Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff -OutFile removeSetupServerTip.diff
|
Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff -OutFile removeSetupServerTip.diff
|
||||||
git apply removeSetupServerTip.diff
|
git apply removeSetupServerTip.diff
|
||||||
|
|||||||
Reference in New Issue
Block a user