Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customize.sh #925

Closed
wants to merge 1 commit into from
Closed

customize.sh #925

wants to merge 1 commit into from

Conversation

ColaMiku
Copy link

@ColaMiku ColaMiku commented Nov 12, 2024

Fix the issue where the volume buttons do not trigger when installing this module.

testKernelSU()
{
    if [[ $(ksud -V 2>&1 | grep "not found" | wc -c) -eq 0 ]]; then #KSU installed
        if [[ $(pm list packages | grep $PKGNAME | wc -c) -eq 0 ]]; then #PixelXpert NOT installed yet
            ui_print ''
            ui_print '*******************************'
            ui_print 'KernelSU binaries found!'
            ui_print ''
            ui_print '        CAUTION!:      '
            ui_print 'Before installation, you MUST disable'
            ui_print '"Unmount modules by default"'
            ui_print 'Otherwise, your device will fall into BOOTLOOP!'
            ui_print ''
            ui_print 'Do you wish to continue?'
            ui_print 'Volume Up: Continue'
            ui_print 'Volume Down: Abort'

            # Wait for volume key input
            echo "Waiting for volume key input..."
            
            # Check for Volume Down
            if getevent -l -c 1 /dev/input/eventX | grep -q "KEY_VOLUMEDOWN"; then
                abort 'Installation cancelled'
            fi
            
            # Check for Volume Up
            if getevent -l -c 1 /dev/input/eventX | grep -q "KEY_VOLUMEUP"; then
                echo "Continuing installation..."
                # Continue with installation
            fi
        fi
    fi
}

Fix the issue where the volume buttons do not trigger when installing this module.
testKernelSU()
{
    if [[ $(ksud -V 2>&1 | grep "not found" | wc -c) -eq 0 ]]; then #KSU installed
        if [[ $(pm list packages | grep $PKGNAME | wc -c) -eq 0 ]]; then #PixelXpert NOT installed yet
            ui_print ''
            ui_print '*******************************'
            ui_print 'KernelSU binaries found!'
            ui_print ''
            ui_print '        CAUTION!:      '
            ui_print 'Before installation, you MUST disable'
            ui_print '"Unmount modules by default"'
            ui_print 'Otherwise, your device will fall into BOOTLOOP!'
            ui_print ''
            ui_print 'Do you wish to continue?'
            ui_print 'Volume Up: Continue'
            ui_print 'Volume Down: Abort'

            # Wait for volume key input
            echo "Waiting for volume key input..."
            
            # Check for Volume Down
            if getevent -l -c 1 /dev/input/eventX | grep -q "KEY_VOLUMEDOWN"; then
                abort 'Installation cancelled'
            fi
            
            # Check for Volume Up
            if getevent -l -c 1 /dev/input/eventX | grep -q "KEY_VOLUMEUP"; then
                echo "Continuing installation..."
                # Continue with installation
            fi
        fi
    fi
}
@siavash79
Copy link
Owner

That issue is already resolved. But thanks for your contribution

@siavash79 siavash79 closed this Dec 8, 2024
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