Base working structure for app #1

Merged
JMR-dev merged 31 commits from setup_and_mvp into main 2025-08-25 16:18:49 +00:00
JMR-dev commented 2025-08-23 23:26:20 +00:00 (Migrated from github.com)

Progress bar is still WIP and not implemented

Not going with AppImage for Linux at present due to permissions problems and need for filesystem access

Progress bar is still WIP and not implemented Not going with AppImage for Linux at present due to permissions problems and need for filesystem access
github-advanced-security[bot] (Migrated from github.com) reviewed 2025-08-23 23:27:12 +00:00
@@ -0,0 +37,4 @@
try:
proc = subprocess.Popen(
cmd,
github-advanced-security[bot] (Migrated from github.com) commented 2025-08-23 23:27:11 +00:00

Uncontrolled command line

This command line depends on a user-provided value.
This command line depends on a user-provided value.

Show more details

## Uncontrolled command line This command line depends on a [user-provided value](1). This command line depends on a [user-provided value](2). [Show more details](https://github.com/JMR-dev/android_file_handler_adb/security/code-scanning/1)
@@ -0,0 +27,4 @@
try:
cmd = [ADB_BINARY_PATH, "shell", "ls", "-la", path]
result = subprocess.run(cmd, capture_output=True, text=True, timeout=10)
github-advanced-security[bot] (Migrated from github.com) commented 2025-08-23 23:27:12 +00:00

Uncontrolled command line

This command line depends on a user-provided value.

Show more details

## Uncontrolled command line This command line depends on a [user-provided value](1). [Show more details](https://github.com/JMR-dev/android_file_handler_adb/security/code-scanning/2)
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-08-23 23:28:07 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR establishes the base working structure for the Android File Handler application, implementing a complete GUI framework with modular components for Android file transfers via ADB. The PR creates a functional foundation with license agreement handling, file browsing capabilities, and transfer management, though progress bar functionality is noted as work-in-progress.

Key changes implemented:

  • Complete modular GUI structure with license agreement and main interface
  • ADB manager with device detection and file transfer capabilities
  • Android file browser with directory navigation and file selection
  • Build scripts for Windows executable and Linux AppImage distribution

Reviewed Changes

Copilot reviewed 32 out of 38 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/main.py Application entry point with import fallback handling
src/gui/main_window.py Main GUI application window with transfer logic and device management
src/gui/progress_handler.py Progress bar handling module (WIP, not fully implemented)
src/gui/license_agreement.py MIT license agreement interface with persistent storage
src/gui/file_browser.py Android filesystem browser with ADB integration
src/adb_manager.py Core ADB operations and device communication logic
scripts/build_exe.sh Windows executable build script using PyInstaller
scripts/build_AppImage.sh Linux AppImage build script with Python runtime

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

## Pull Request Overview This PR establishes the base working structure for the Android File Handler application, implementing a complete GUI framework with modular components for Android file transfers via ADB. The PR creates a functional foundation with license agreement handling, file browsing capabilities, and transfer management, though progress bar functionality is noted as work-in-progress. Key changes implemented: - Complete modular GUI structure with license agreement and main interface - ADB manager with device detection and file transfer capabilities - Android file browser with directory navigation and file selection - Build scripts for Windows executable and Linux AppImage distribution ### Reviewed Changes Copilot reviewed 32 out of 38 changed files in this pull request and generated 7 comments. <details> <summary>Show a summary per file</summary> | File | Description | | ---- | ----------- | | src/main.py | Application entry point with import fallback handling | | src/gui/main_window.py | Main GUI application window with transfer logic and device management | | src/gui/progress_handler.py | Progress bar handling module (WIP, not fully implemented) | | src/gui/license_agreement.py | MIT license agreement interface with persistent storage | | src/gui/file_browser.py | Android filesystem browser with ADB integration | | src/adb_manager.py | Core ADB operations and device communication logic | | scripts/build_exe.sh | Windows executable build script using PyInstaller | | scripts/build_AppImage.sh | Linux AppImage build script with Python runtime | </details> --- <sub>**Tip:** Customize your code reviews with copilot-instructions.md. <a href="/JMR-dev/android_file_handler_adb/new/main/.github?filename=copilot-instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Create the file</a> or <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">learn how to get started</a>.</sub>
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-08-23 23:28:07 +00:00

The Python build URL contains a hardcoded date (20240713) which may become outdated. Consider using a variable or more recent version, or add a comment explaining why this specific version is required.

# Date-based release tag for python-build-standalone; update as needed for newer releases
PYTHON_STANDALONE_DATE="20240713"
PYTHON_URL="https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz"
    echo "Error: Failed to download Python source"
    exit 1
fi

# For simplicity, let's use a pre-built Python binary instead
echo "Downloading pre-built Python 3.12 for Linux..."
if ! curl -L "https://github.com/indygreg/python-build-standalone/releases/download/${PYTHON_STANDALONE_DATE}/cpython-3.12.4+${PYTHON_STANDALONE_DATE}-x86_64-unknown-linux-gnu-install_only.tar.gz" -o "python-standalone.tar.gz"; then
The Python build URL contains a hardcoded date (20240713) which may become outdated. Consider using a variable or more recent version, or add a comment explaining why this specific version is required. ```suggestion # Date-based release tag for python-build-standalone; update as needed for newer releases PYTHON_STANDALONE_DATE="20240713" PYTHON_URL="https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz" echo "Error: Failed to download Python source" exit 1 fi # For simplicity, let's use a pre-built Python binary instead echo "Downloading pre-built Python 3.12 for Linux..." if ! curl -L "https://github.com/indygreg/python-build-standalone/releases/download/${PYTHON_STANDALONE_DATE}/cpython-3.12.4+${PYTHON_STANDALONE_DATE}-x86_64-unknown-linux-gnu-install_only.tar.gz" -o "python-standalone.tar.gz"; then ```
@@ -0,0 +1,825 @@
"""
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-08-23 23:28:07 +00:00

The AppImage detection logic using string matching on 'tmp' and '.mount_' is fragile and could incorrectly match other temporary directories. Consider using more specific AppImage environment variables like APPIMAGE or APPDIR.

    # For AppImages, use persistent storage if running from AppImage environment
    if sys.platform.startswith('linux') and (os.environ.get("APPIMAGE") or os.environ.get("APPDIR")):
        # AppImage detected via environment variable - use persistent user directory
The AppImage detection logic using string matching on 'tmp' and '.mount_' is fragile and could incorrectly match other temporary directories. Consider using more specific AppImage environment variables like APPIMAGE or APPDIR. ```suggestion # For AppImages, use persistent storage if running from AppImage environment if sys.platform.startswith('linux') and (os.environ.get("APPIMAGE") or os.environ.get("APPDIR")): # AppImage detected via environment variable - use persistent user directory ```
@@ -0,0 +1,501 @@
"""
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-08-23 23:28:06 +00:00

The module docstring incorrectly states this is for 'Windows' when the code actually supports both Windows and Linux. The docstring should reflect the cross-platform nature.

Cross-Platform Android Browser Module
Provides Android filesystem browsing capabilities for Windows and Linux using ADB.
The module docstring incorrectly states this is for 'Windows' when the code actually supports both Windows and Linux. The docstring should reflect the cross-platform nature. ```suggestion Cross-Platform Android Browser Module Provides Android filesystem browsing capabilities for Windows and Linux using ADB. ```
@@ -0,0 +30,4 @@
except ImportError:
# Fall back to direct imports
from src.gui.file_browser import AndroidFileBrowser
from src.gui.license_agreement import LicenseAgreementFrame, check_license_agreement
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-08-23 23:28:06 +00:00

The fallback import uses an absolute path 'src.gui.file_browser' which may fail if the module structure changes. Consider using a more robust import strategy or relative imports consistently.

    # Fall back: adjust sys.path and retry relative imports
    import os
    import sys
    current_dir = os.path.dirname(os.path.abspath(__file__))
    parent_dir = os.path.dirname(current_dir)
    if parent_dir not in sys.path:
        sys.path.insert(0, parent_dir)
    from .file_browser import AndroidFileBrowser
    from .license_agreement import LicenseAgreementFrame, check_license_agreement
The fallback import uses an absolute path 'src.gui.file_browser' which may fail if the module structure changes. Consider using a more robust import strategy or relative imports consistently. ```suggestion # Fall back: adjust sys.path and retry relative imports import os import sys current_dir = os.path.dirname(os.path.abspath(__file__)) parent_dir = os.path.dirname(current_dir) if parent_dir not in sys.path: sys.path.insert(0, parent_dir) from .file_browser import AndroidFileBrowser from .license_agreement import LicenseAgreementFrame, check_license_agreement ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-08-23 23:28:06 +00:00

The fallback import uses an absolute path 'src.gui.license_agreement' which may fail if the module structure changes. Consider using a more robust import strategy or relative imports consistently.

    from file_browser import AndroidFileBrowser
    from license_agreement import LicenseAgreementFrame, check_license_agreement
The fallback import uses an absolute path 'src.gui.license_agreement' which may fail if the module structure changes. Consider using a more robust import strategy or relative imports consistently. ```suggestion from file_browser import AndroidFileBrowser from license_agreement import LicenseAgreementFrame, check_license_agreement ```
JMR-dev (Migrated from github.com) reviewed 2025-08-23 23:35:04 +00:00
JMR-dev (Migrated from github.com) commented 2025-08-23 23:35:03 +00:00

Not using this approach, going a different route for publishing

Not using this approach, going a different route for publishing
JMR-dev (Migrated from github.com) reviewed 2025-08-23 23:36:05 +00:00
@@ -0,0 +1,501 @@
"""
JMR-dev (Migrated from github.com) commented 2025-08-23 23:36:05 +00:00

Updated

Updated
JMR-dev (Migrated from github.com) reviewed 2025-08-24 00:03:43 +00:00
@@ -0,0 +37,4 @@
try:
proc = subprocess.Popen(
cmd,
JMR-dev (Migrated from github.com) commented 2025-08-24 00:03:43 +00:00

This is mitigated by not allowing an open text box for the user to type in. Users will be selecting paths, reducing the likelihood for command injection. This is an important fix and will be updated, but right now, the app needs to be released to collect feedback and start iteration.

This is mitigated by not allowing an open text box for the user to type in. Users will be selecting paths, reducing the likelihood for command injection. This is an important fix and will be updated, but right now, the app needs to be released to collect feedback and start iteration.
JMR-dev (Migrated from github.com) reviewed 2025-08-24 00:04:47 +00:00
@@ -0,0 +1,825 @@
"""
JMR-dev (Migrated from github.com) commented 2025-08-24 00:04:47 +00:00

AppImage logic removed as it no longer reflects the direction of the application

AppImage logic removed as it no longer reflects the direction of the application
JMR-dev (Migrated from github.com) reviewed 2025-08-24 00:05:47 +00:00
@@ -0,0 +27,4 @@
try:
cmd = [ADB_BINARY_PATH, "shell", "ls", "-la", path]
result = subprocess.run(cmd, capture_output=True, text=True, timeout=10)
JMR-dev (Migrated from github.com) commented 2025-08-24 00:05:47 +00:00

Same as prior comment, mitigated by lack of open text box for malicious path injection

Same as prior comment, mitigated by lack of open text box for malicious path injection
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-08-24 01:28:14 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Sign in to join this conversation.