Skip to content

Conversation

Ylarod
Copy link
Collaborator

@Ylarod Ylarod commented Sep 10, 2025

No description provided.

@Ylarod Ylarod requested a review from Copilot September 10, 2025 12:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a multi-module system architecture for KernelSU by refactoring the existing codebase into a modular structure. It introduces a metamodule system that allows for pluggable module system implementations while maintaining backward compatibility.

  • Creates a new ksu-core library containing shared utilities and constants
  • Introduces a new ksu-modsys-overlay implementation that provides the default overlay-based module system
  • Refactors ksud to delegate module operations through a transparent forwarding interface

Reviewed Changes

Copilot reviewed 40 out of 42 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
userspace/ksud/src/utils.rs Major refactoring to delegate utility functions to ksu-core and remove large functions
userspace/ksud/src/modsys.rs New module system interface providing transparent forwarding to selected modsys implementation
userspace/ksud/src/main.rs Updated module references to use new modsys interface
userspace/ksu-core/src/*.rs New shared library containing common utilities, constants, and system interfaces
userspace/ksu-modsys-overlay/src/*.rs New default module system implementation using overlay filesystem
userspace/Cargo.toml New workspace configuration organizing the three main components

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

Comment on lines +123 to +125
if let Some(caps) = re.captures(s)
&& (caps.get(1), caps.get(2)) != (None, None)
{
Copy link
Preview

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition (caps.get(1), caps.get(2)) != (None, None) is redundant since captures() already ensures capture groups exist. This condition will always be true when captures() succeeds.

Suggested change
if let Some(caps) = re.captures(s)
&& (caps.get(1), caps.get(2)) != (None, None)
{
if let Some(caps) = re.captures(s) {

Copilot uses AI. Check for mistakes.

Ok(vec![AtomicStatement {
cmd: CMD_TYPE_CHANGE,
subcmd,
subcmd: 0,
Copy link
Preview

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subcmd should differentiate between 'type_change' and 'type_member' operations but is hardcoded to 0, potentially causing incorrect policy handling.

Copilot uses AI. Check for mistakes.

yujincheng08
yujincheng08 previously approved these changes Sep 10, 2025
Copy link
Collaborator

@yujincheng08 yujincheng08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by Gemini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants