Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0457695
提交文件
Mar 29, 2023
adcb704
fix: 修复无法注入su到第二个进程
Mar 30, 2023
155bc1e
fix: 优化速度
Mar 30, 2023
7ab9f55
fix: run init error
Apr 4, 2023
07e078b
添加su设置身份代码
Apr 6, 2023
9cddb4e
移除setresuid搜索方法,更换为更简单的proc_pid_status方法
Apr 6, 2023
7c1de38
新版本:新增安全位securebits与seccomp清除功能
Apr 6, 2023
2173322
feat: 添加工具源码
Apr 7, 2023
f25b635
add tip
Apr 7, 2023
69909d9
优化算法
Apr 8, 2023
8a84141
细节优化
Apr 8, 2023
06afa89
printf
Apr 8, 2023
fb1a956
printf
Apr 8, 2023
290df2c
printf
Apr 8, 2023
d0bbf7a
修复部分内核解析错误
Apr 8, 2023
bd6b8cc
Update README.md
abcz316 Apr 8, 2023
bd93277
Update README.md
abcz316 Apr 8, 2023
3249ad6
修复老内核4.4.X的兼容性
Apr 8, 2023
9db749e
兼容输入信息的格式
Apr 9, 2023
67bc24f
Update README.md
abcz316 Apr 9, 2023
9fee453
fix: format error
Apr 9, 2023
15d6a12
Merge branch 'master' of https://github.com/abcz316/linuxKernelRoot
Apr 9, 2023
044b8ff
Update README.md
abcz316 Apr 9, 2023
c4c04a7
Update README.md
abcz316 Apr 9, 2023
a687e71
fix: function entry is second addr
Apr 10, 2023
e1087af
Merge branch 'master' of https://github.com/abcz316/linuxKernelRoot
Apr 10, 2023
2862644
fix: tip
Apr 10, 2023
90f0bc8
fix: tip
Apr 10, 2023
f3aa4b7
feat: function entry strong
Apr 11, 2023
ea6508d
remove fork sleep
Apr 11, 2023
a6a454a
Add Auto_Build Scripts and Initial commit for ArmAsmHelper_Linux.h an…
Nobooooody Apr 11, 2023
62a299a
增强扫描
Apr 13, 2023
8f05533
Update README.md
abcz316 Apr 13, 2023
f0f4acf
Merge branch 'abcz316:master' into patch-1
DataEraserC Apr 14, 2023
bc8b0e4
Update AndroidSDK
Apr 14, 2023
0b7861f
Merge branch 'master' of https://github.com/abcz316/linuxKernelRoot
Apr 14, 2023
bcf3935
Update AndroidSDK
Apr 14, 2023
de87c45
Update AndroidSDK
Apr 14, 2023
e88fff2
Add APK
Apr 14, 2023
df51bc8
优化交互逻辑
Apr 15, 2023
2bf26ff
将seccomp调整为非必需项
Apr 16, 2023
11847d3
新增su过期说明
Apr 23, 2023
064adf7
Merge branch 'abcz316:master' into patch-1
Nobooooody Apr 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/PermissionManager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PermissionManager_CIBuild

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: 11
- name: Build with Gradle
run: |
cd PermissionManager
chmod +x ./gradlew
./gradlew assembleRelease
- name: Upload Artifacts
uses: actions/upload-artifact@v2
if: ${{ !github.event.pull_request }}
with:
path: "PermissionManager/app/build/outputs/apk/release/app-release-unsigned.apk"
name: app-release-unsigned.apk
37 changes: 37 additions & 0 deletions .github/workflows/SKRootKernelRoot_Windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: SKRootKernelRoot_Windows_CIBuild
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
build:
name: Compile SKRoot Kernel Root on Windows
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: List files in current directory
run: |
Get-ChildItem -Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\" -Filter vcvarsall.bat -File -Recurse
Get-ChildItem -Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\" -Filter vcvars64.bat -File -Recurse
- name: Compile patch_kernel_root
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cl patch_kernel_root\patch_kernel_root.cpp /EHsc /Fe:patch_kernel_root /Ipatch_kernel_root /I "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include"
- name: List files in current directory
run: |
ls patch_kernel_root
Get-ChildItem -Path . -Filter 'patch_kernel_root.*' -File -Recurse
Get-ChildItem -Path . -Filter '*.exe' -File -Recurse
- name: Upload artifacts
uses: Actions/upload-artifact@main
with:
name: patch_kernel_root
path: patch_kernel_root.exe
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
35 changes: 35 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 要求最低的 CMake 版本
cmake_minimum_required(VERSION 3.0)

# 启用 CMP0048 策略
cmake_policy(SET CMP0048 NEW)

# 设置项目名称和版本号
project(patch_kernel_root VERSION 1.0)


# 要求 C++17 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# 添加头文件目录
include_directories(include)

# 添加所有源文件(排除测试文件)
file(GLOB SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/patch_kernel_root/*.cpp")
list(FILTER SRC_FILES EXCLUDE REGEX "^Byte2HexTest.cpp$")

# 添加可执行文件
add_executable(patch_kernel_root ${SRC_FILES})

# 添加测试文件
option(BUILD_TESTING "Build the tests" ON)
if(BUILD_TESTING)
enable_testing()
file(GLOB TEST_SOURCES "tests/*.cpp")
foreach(TEST_SOURCE ${TEST_SOURCES})
get_filename_component(TEST_NAME ${TEST_SOURCE} NAME_WE)
add_executable(${TEST_NAME} ${TEST_SOURCE})
target_link_libraries(${TEST_NAME} patch_kernel_root)
endforeach()
endif()
15 changes: 15 additions & 0 deletions PermissionManager/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions PermissionManager/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions PermissionManager/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions PermissionManager/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions PermissionManager/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions PermissionManager/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
53 changes: 53 additions & 0 deletions PermissionManager/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
plugins {
id 'com.android.application'
}

android {
compileSdk 31

defaultConfig {
applicationId "com.linux.permissionmanager"
minSdk 23
targetSdk 31
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags '-std=c++17'
abiFilters "arm64-v8a" //需要什么构架的so,就在这边添加即
}
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
externalNativeBuild {
cmake {
path file('src/main/cpp/CMakeLists.txt')
version '3.18.1'
}
}
buildFeatures {
viewBinding true
}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
21 changes: 21 additions & 0 deletions PermissionManager/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.linux.permissionmanager;

import android.content.Context;

import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.linux.permissionmanager", appContext.getPackageName());
}
}
28 changes: 28 additions & 0 deletions PermissionManager/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.linux.permissionmanager">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.PermissionManager">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.GET_INSTALLED_APPS"/>
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
</manifest>
Binary file added PermissionManager/app/src/main/assets/su
Binary file not shown.
52 changes: 52 additions & 0 deletions PermissionManager/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html

# Sets the minimum version of CMake required to build the native library.

cmake_minimum_required(VERSION 3.18.1)

# Declares and names the project.

project("permissionmanager")

# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.

add_library( # Sets the name of the library.
permissionmanager

# Sets the library as a shared library.
SHARED

# Provides a relative path to your source file(s).
../../../../../testRoot/process64_inject.cpp
../../../../../testRoot/ptrace_arm64_utils.cpp
../../../../../testRoot/su_install_helper.cpp
../../../../../testRoot/base64.cpp
root.cpp)

# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build.

find_library( # Sets the name of the path variable.
log-lib

# Specifies the name of the NDK library that
# you want CMake to locate.
log)

# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.

target_link_libraries( # Specifies the target library.
permissionmanager

# Links the target library to the log library
# included in the NDK.
${log-lib})
Loading