Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/tiann/KernelSU into main
Browse files Browse the repository at this point in the history
* 'main' of https://github.com/tiann/KernelSU:
  build(deps): bump the npm group in /website with 3 updates (tiann#1903)
  build(deps): bump syn from 2.0.71 to 2.0.72 in /userspace/ksud in the crates group (tiann#1902)
  Upgrade rustix (tiann#1900)
  build(deps): bump the npm group in /website with 2 updates (tiann#1899)
  build(deps): bump the crates group in /userspace/ksud with 3 updates (tiann#1898)
  build(deps): bump the npm group in /website with 13 updates (tiann#1893)
  build(deps): bump the crates group in /userspace/ksud with 40 updates (tiann#1894)
  [skip ci] Group dependabot dependencies (tiann#1892)
  Upgrade zip (tiann#1891)
  build(deps): bump io.coil-kt:coil-compose from 2.6.0 to 2.7.0 in /manager (tiann#1888)
  build(deps): bump org.lsposed.libcxx:libcxx from 27.0.11718014-beta1 to 27.0.12077973 in /manager (tiann#1885)
  Upgrade deps (tiann#1886)
  build(deps-dev): bump vitepress from 1.3.0 to 1.3.1 in /website (tiann#1879)
  build(deps): bump com.google.devtools.ksp from 2.0.0-1.0.22 to 2.0.0-1.0.23 in /manager (tiann#1872)
  build(deps): bump agp from 8.5.0 to 8.5.1 in /manager (tiann#1873)
  Allow skipping commented policy (tiann#1870)
  build(deps): bump rust-embed from 8.4.0 to 8.5.0 in /userspace/ksud (tiann#1869)
  build(deps): bump clap from 4.5.8 to 4.5.9 in /userspace/ksud (tiann#1868)
  Setup Android SDK (tiann#1867)
  Upgrade gradle (tiann#1866)
  build(deps-dev): bump vitepress from 1.2.3 to 1.3.0 in /website (tiann#1865)
  Revert "ksud: [Fix] grant root to the shell in debug mode" (tiann#1860)
  ksud: upgrade zip (tiann#1859)
  ksud: [Fix] grant root to the shell in debug mode (tiann#1853)
  build(deps): bump lifecycle from 2.8.1 to 2.8.3 in /manager (tiann#1851)
  build(deps): bump clap from 4.5.7 to 4.5.8 in /userspace/ksud (tiann#1850)
  website: fix typo (tiann#1834)
  build(deps): bump android_logger from 0.13.3 to 0.14.1 in /userspace/ksud (tiann#1830)
  build(deps): bump log from 0.4.21 to 0.4.22 in /userspace/ksud (tiann#1843)
  Update resetprop (tiann#1842)
  throne_tracker: skip iterate if failed to open dir (tiann#1832)
  Translations update from Hosted Weblate (tiann#1734)
  build(deps): bump com.google.devtools.ksp from 2.0.0-1.0.21 to 2.0.0-1.0.22 in /manager (tiann#1811)
  manager: improve grammar in english (tiann#1814)
  Redirect the Feature Requests issue template tab (tiann#1788)
  website: fix typo (tiann#1807)
  build(deps): bump zip from 2.1.2 to 2.1.3 in /userspace/ksud (tiann#1810)
  build(deps): bump regex from 1.10.4 to 1.10.5 in /userspace/ksud (tiann#1815)
  build(deps): bump clap from 4.5.4 to 4.5.7 in /userspace/ksud (tiann#1817)
  build(deps): bump androidx.compose:compose-bom from 2024.05.00 to 2024.06.00 in /manager (tiann#1820)
  build(deps): bump agp from 8.4.1 to 8.5.0 in /manager (tiann#1824)
  build(deps): bump lifecycle from 2.8.0 to 2.8.1 in /manager (tiann#1782)
  website: update translations (tiann#1796)
  build(deps): bump zip-extensions from 0.6.2 to 0.7.0 in /userspace/ksud (tiann#1798)
  build(deps): bump zip from 2.1.0 to 2.1.2 in /userspace/ksud (tiann#1799)
  build(deps-dev): bump vitepress from 1.2.2 to 1.2.3 in /website (tiann#1803)
  manager: fix update no response when changelog is empty (tiann#1786)
  Convert devpts domain to ksu_file (tiann#1801)
  non-GKI:Remove maintainer Coconutat's  repositories (tiann#1794)
  从非官方支持设备中移除K-Nel-M1721 (tiann#1792)

Signed-off-by: Edwiin Kusuma Jaya <[email protected]>
  • Loading branch information
kutemeikito committed Jul 22, 2024
2 parents ad552fc + 226025e commit 31c75ca
Show file tree
Hide file tree
Showing 32 changed files with 1,012 additions and 971 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Feature Request
url: https://github.com/tiann/KernelSU/issues/1705
about: "We do not accept external Feature Requests, see this link for more details."
39 changes: 0 additions & 39 deletions .github/ISSUE_TEMPLATE/feature_request.yml

This file was deleted.

23 changes: 20 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,35 @@ updates:
directory: /
schedule:
interval: daily

groups:
actions:
patterns:
- "*"
- package-ecosystem: cargo
directory: userspace/ksud
schedule:
interval: daily

allow:
- dependency-type: "all"
groups:
crates:
patterns:
- "*"
- package-ecosystem: gradle
directory: manager
schedule:
interval: daily

groups:
maven:
patterns:
- "*"
- package-ecosystem: npm
directory: website
schedule:
interval: daily
allow:
- dependency-type: "all"
groups:
npm:
patterns:
- "*"
5 changes: 4 additions & 1 deletion .github/workflows/build-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ jobs:
with:
gradle-home-cache-cleanup: true

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Download arm64 ksud
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -157,4 +160,4 @@ jobs:
APK=$(find ./app/build/outputs/apk/release -name "*.apk")
pip3 install telethon
python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK
fi
fi
4 changes: 2 additions & 2 deletions kernel/selinux/selinux.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ bool is_zygote(void *sec)
return result;
}

#define DEVPTS_DOMAIN "u:object_r:devpts:s0"
#define DEVPTS_DOMAIN "u:object_r:ksu_file:s0"

u32 ksu_get_devpts_sid()
{
Expand All @@ -142,4 +142,4 @@ u32 ksu_get_devpts_sid()
pr_info("get devpts sid err %d\n", err);
}
return devpts_sid;
}
}
4 changes: 2 additions & 2 deletions kernel/throne_tracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ void search_manager(const char *path, int depth, struct list_head *uid_data)
file = ksu_filp_open_compat(pos->dirpath, O_RDONLY | O_NOFOLLOW, 0);
if (IS_ERR(file)) {
pr_err("Failed to open directory: %s, err: %ld\n", pos->dirpath, PTR_ERR(file));
return;
goto skip_iterate;
}

iterate_dir(file, &ctx.ctx);
filp_close(file, NULL);
}

skip_iterate:
list_del(&pos->list);
if (pos != &data)
kfree(pos);
Expand Down
3 changes: 3 additions & 0 deletions manager/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ android {
aidl = true
buildConfig = true
compose = true
prefab = true
}

kotlinOptions {
Expand Down Expand Up @@ -113,4 +114,6 @@ dependencies {

implementation(libs.markdown)
implementation(libs.androidx.webkit)

implementation(libs.lsposed.cxx)
}
3 changes: 3 additions & 0 deletions manager/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ cmake_minimum_required(VERSION 3.18.1)

project("kernelsu")

find_package(cxx REQUIRED CONFIG)
link_libraries(cxx::cxx)

add_library(kernelsu
SHARED
jni.cc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ fun UpdateCard() {
message = stringResource(id = R.string.new_version_available).format(newVersionCode),
MaterialTheme.colorScheme.outlineVariant
) {
if (changelog.isNotEmpty()) {
if (changelog.isEmpty()) {
uriHandler.openUri(newVersionUrl)
} else {
updateDialog.showConfirm(
title = title,
content = changelog,
Expand Down Expand Up @@ -414,8 +416,8 @@ private fun InfoCard() {
}

fun getManagerVersion(context: Context): Pair<String, Int> {
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)
return Pair(packageInfo.versionName, packageInfo.versionCode)
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)!!
return Pair(packageInfo.versionName!!, packageInfo.versionCode)
}

@Preview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SuperUserViewModel : ViewModel() {
val packageName: String
get() = packageInfo.packageName
val uid: Int
get() = packageInfo.applicationInfo.uid
get() = packageInfo.applicationInfo!!.uid

val allowSu: Boolean
get() = profile != null && profile.allowSu
Expand Down Expand Up @@ -90,7 +90,7 @@ class SuperUserViewModel : ViewModel() {
.toPinyinString(it.label).contains(search, true)
}.filter {
it.uid == 2000 // Always show shell
|| showSystemApps || it.packageInfo.applicationInfo.flags.and(ApplicationInfo.FLAG_SYSTEM) == 0
|| showSystemApps || it.packageInfo.applicationInfo!!.flags.and(ApplicationInfo.FLAG_SYSTEM) == 0
}
}

Expand Down Expand Up @@ -146,7 +146,7 @@ class SuperUserViewModel : ViewModel() {

apps = packages.map {
val appInfo = it.applicationInfo
val uid = appInfo.uid
val uid = appInfo!!.uid
val profile = Natives.getAppProfile(it.packageName, uid)
AppInfo(
label = appInfo.loadLabel(pm).toString(),
Expand Down
4 changes: 4 additions & 0 deletions manager/app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,9 @@
<string name="open">Öffnen</string>
<string name="settings_check_update">Updates suchen</string>
<string name="settings_check_update_summary">Automatisch nach Updates suchen beim Öffnen der App</string>
<string name="settings_uninstall_temporary">Temporär deinstallieren</string>
<string name="settings_uninstall">Deinstallieren</string>
<string name="settings_uninstall_permanent_message">KernelSU (Root und alle Module) vollständig und dauerhaft deinstallieren.</string>
<string name="shrink_sparse_image_message">Ändert die Größe des Sparse-Images, in dem sich das Modul befindet, auf seine tatsächliche Größe. Beachten Sie, dass dies dazu führen kann, dass das Modul nicht ordnungsgemäß funktioniert; verwenden Sie es daher nur, wenn es notwendig ist (z. B. für ein Backup).</string>
<string name="save_log">Protokolle Speichern</string>
</resources>
4 changes: 2 additions & 2 deletions manager/app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
<string name="install_next">Suivant</string>
<string name="select_file_tip">L\'image de la partition %1$s est recommandée</string>
<string name="select_kmi">Sélectionner une KMI</string>
<string name="shrink_sparse_image">Minimiser l\'image clairsemée</string>
<string name="shrink_sparse_image_message">Redimensionne l\'image clairsemée où se trouve le module à sa taille réelle. Notez que cela peut entraîner un dysfonctionnement du module, alors utilisez cette fonctionnalité uniquement lorsque nécessaire (pour la sauvegarde, par exemple)</string>
<string name="shrink_sparse_image">Minimiser la taille de l\'image partiellement allouée</string>
<string name="shrink_sparse_image_message">Redimensionner à sa taille réelle l\'image partiellement allouée où se trouve le module. Notez que cela peut entraîner un dysfonctionnement du module, utilisez donc cette fonctionnalité uniquement lorsque c\'est nécessaire (par exemple pour la sauvegarde de l\'appareil).</string>
<string name="settings_uninstall">Désinstaller</string>
<string name="settings_uninstall_temporary">Désinstaller temporairement</string>
<string name="settings_uninstall_permanent">Désinstaller définitivement</string>
Expand Down
3 changes: 3 additions & 0 deletions manager/app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,8 @@
<string name="settings_uninstall_permanent">Permanent verwijderen</string>
<string name="settings_restore_stock_image">Herstel stockafbeelding</string>
<string name="settings_uninstall_temporary_message">Verwijder KernelSU tijdelijk en herstel het naar de oorspronkelijke staat na de volgende herstart.</string>
<string name="settings_uninstall_permanent_message">Het verwijderen van KernelSU (Root en alle modules) volledig en permanent.</string>
<string name="settings_restore_stock_image_message">Herstel de fabrieksimage (als er een back-up bestaat), meestal gebruikt vóór OTA; als u KernelSU moet verwijderen, gebruik dan \"Permanent verwijderen\".</string>
<string name="flashing">Knipperen</string>
<string name="save_log">Logboeken Opslaan</string>
</resources>
48 changes: 24 additions & 24 deletions manager/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
<string name="reboot_edl">Reboot to EDL</string>
<string name="about">About</string>
<string name="module_uninstall_confirm">Are you sure you want to uninstall module %s?</string>
<string name="module_uninstall_success">%s is uninstalled</string>
<string name="module_uninstall_success">%s uninstalled</string>
<string name="module_uninstall_failed">Failed to uninstall: %s</string>
<string name="module_version">Version</string>
<string name="module_author">Author</string>
<string name="module_overlay_fs_not_available">overlayfs is not available, module cannot work!</string>
<string name="module_overlay_fs_not_available">Modules are unavailable as OverlayFS is disabled by the kernel.</string>
<string name="refresh">Refresh</string>
<string name="show_system_apps">Show system apps</string>
<string name="hide_system_apps">Hide system apps</string>
<string name="send_log">Report Log</string>
<string name="send_log">Send logs</string>
<string name="safe_mode">Safe mode</string>
<string name="reboot_to_apply">Reboot to take effect</string>
<string name="module_magisk_conflict">Modules are disabled because it is conflict with Magisk\'s!</string>
<string name="module_magisk_conflict">Modules are unavailable due to a conflict with Magisk!</string>
<string name="home_learn_kernelsu">Learn KernelSU</string>
<string name="home_learn_kernelsu_url">https://kernelsu.org/guide/what-is-kernelsu.html</string>
<string name="home_click_to_learn_kernelsu">Learn how to install KernelSU and use modules</string>
Expand All @@ -69,36 +69,36 @@
<string name="failed_to_update_app_profile">Failed to update App Profile for %s</string>
<string name="require_kernel_version">The current KernelSU version %d is too low for the manager to function properly. Please upgrade to version %d or higher!</string>
<string name="settings_umount_modules_default">Umount modules by default</string>
<string name="settings_umount_modules_default_summary">The global default value for \"Umount modules\" in App Profiles. If enabled, it will remove all module modifications to the system for applications that do not have a Profile set.</string>
<string name="profile_umount_modules_summary">Enabling this option will allow KernelSU to restore any modified files by the modules for this application.</string>
<string name="settings_umount_modules_default_summary">The global default value for \"Umount modules\" in App Profile. If enabled, it will remove all module modifications to the system for apps that don\'t have a Profile set.</string>
<string name="profile_umount_modules_summary">Enabling this option will allow KernelSU to restore any modified files by the modules for this app.</string>
<string name="profile_selinux_domain">Domain</string>
<string name="profile_selinux_rules">Rules</string>
<string name="module_update">Update</string>
<string name="module_downloading">Downloading module: %s</string>
<string name="module_start_downloading">Start downloading: %s</string>
<string name="new_version_available">New version: %s is available, click to upgrade</string>
<string name="new_version_available">New version %s is available, click to upgrade.</string>
<string name="launch_app">Launch</string>
<string name="force_stop_app">Force Stop</string>
<string name="force_stop_app">Force stop</string>
<string name="restart_app">Restart</string>
<string name="failed_to_update_sepolicy">Failed to update SELinux rules for: %s</string>
<string name="module_changelog">Changelog</string>
<string name="settings_profile_template">App Profile Template</string>
<string name="settings_profile_template_summary">Manage local and online template of App Profile</string>
<string name="app_profile_template_create">Create Template</string>
<string name="app_profile_template_edit">Edit Template</string>
<string name="app_profile_template_create">Create template</string>
<string name="app_profile_template_edit">Edit template</string>
<string name="app_profile_template_id">id</string>
<string name="app_profile_template_id_invalid">Invalid template id</string>
<string name="app_profile_template_name">Name</string>
<string name="app_profile_template_description">Description</string>
<string name="app_profile_template_save">Save</string>
<string name="app_profile_template_delete">Delete</string>
<string name="app_profile_template_view">View Template</string>
<string name="app_profile_template_view">View template</string>
<string name="app_profile_template_readonly">readonly</string>
<string name="app_profile_template_id_exist">template id already exists!</string>
<string name="app_profile_import_export">Import/Export</string>
<string name="app_profile_import_from_clipboard">Import from clipboard</string>
<string name="app_profile_export_to_clipboard">Export to clipboard</string>
<string name="app_profile_template_export_empty">Can not find local template to export!</string>
<string name="app_profile_template_export_empty">Cannot find local template to export!</string>
<string name="app_profile_template_import_success">Imported successfully</string>
<string name="app_profile_template_sync">Sync online templates</string>
<string name="app_profile_template_save_failed">Failed to save template</string>
Expand All @@ -110,25 +110,25 @@
<string name="open">Open</string>
<string name="enable_web_debugging">Enable WebView Debugging</string>
<string name="enable_web_debugging_summary">Can be used to debug WebUI, please enable only when needed.</string>
<string name="direct_install">Direct Install (Recommended)</string>
<string name="select_file">Select a File</string>
<string name="install_inactive_slot">Install to Inactive Slot (After OTA)</string>
<string name="direct_install">Direct install (Recommended)</string>
<string name="select_file">Select a file</string>
<string name="install_inactive_slot">Install to inactive slot (After OTA)</string>
<string name="install_inactive_slot_warning">Your device will be **FORCED** to boot to the current inactive slot after a reboot!\nOnly use this option after OTA is done.\nContinue?</string>
<string name="install_next">Next</string>
<string name="select_file_tip">%1$s partition image is recommended</string>
<string name="select_kmi">Select KMI</string>
<string name="shrink_sparse_image">Minimize sparse image</string>
<string name="shrink_sparse_image_message">Resize the sparse image where the module is located to its actual size. Note that this may cause the module to work abnormally, so please only use when necessary (such as for backup)</string>
<string name="shrink_sparse_image_message">Resize the sparse image where the module is located to its actual size. Note that this may cause the module to work abnormally, so please only use when necessary (such as for backup).</string>
<string name="settings_uninstall">Uninstall</string>
<string name="settings_uninstall_temporary">Uninstall Temporarily</string>
<string name="settings_uninstall_permanent">Uninstall Permanently</string>
<string name="settings_restore_stock_image">Restore Stock Image</string>
<string name="settings_uninstall_temporary">Uninstall temporarily</string>
<string name="settings_uninstall_permanent">Uninstall permanently</string>
<string name="settings_restore_stock_image">Restore stock image</string>
<string name="settings_uninstall_temporary_message">Temporarily uninstall KernelSU, restore to original state after next reboot.</string>
<string name="settings_uninstall_permanent_message">Uninstalling KernelSU(Root and all modules) completely and permanently.</string>
<string name="settings_restore_stock_image_message">Restore the stock factory image (if a backup exists), usually used before OTA; if you need to uninstall KernelSU, please use \"Permanent Uninstall\".</string>
<string name="settings_uninstall_permanent_message">Uninstalling KernelSU (Root and all modules) completely and permanently.</string>
<string name="settings_restore_stock_image_message">Restore the stock factory image (If a backup exists), usually used before OTA; if you need to uninstall KernelSU, please use \"Uninstall permanently\".</string>
<string name="flashing">Flashing</string>
<string name="flash_success">Flash success</string>
<string name="flash_failed">Flash failed</string>
<string name="selected_lkm">Selected lkm: %s</string>
<string name="save_log">Save Logs</string>
</resources>
<string name="selected_lkm">Selected LKM: %s</string>
<string name="save_log">Save logs</string>
</resources>
20 changes: 7 additions & 13 deletions manager/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,23 @@ cmaker {
default {
arguments.addAll(
arrayOf(
"-DANDROID_STL=c++_static",
"-DANDROID_STL=none",
)
)
val flags = arrayOf(
"-Wno-gnu-string-literal-operator-template",
"-Wno-c++2b-extensions",
)
cFlags.addAll(flags)
cppFlags.addAll(flags)
abiFilters("arm64-v8a", "x86_64")
abiFilters("arm64-v8a", "x86_64", "riscv64")
}
buildTypes {
if (it.name == "release") {
arguments += "-DDEBUG_SYMBOLS_PATH=${buildDir.absolutePath}/symbols"
arguments += "-DDEBUG_SYMBOLS_PATH=${layout.buildDirectory.asFile.get().absolutePath}/symbols"
}
}
}

val androidMinSdkVersion = 26
val androidTargetSdkVersion = 34
val androidCompileSdkVersion = 34
val androidBuildToolsVersion = "34.0.0"
val androidCompileNdkVersion = "26.3.11579264"
val androidTargetSdkVersion = 35
val androidCompileSdkVersion = 35
val androidBuildToolsVersion = "35.0.0"
val androidCompileNdkVersion = "27.0.12077973"
val androidSourceCompatibility = JavaVersion.VERSION_21
val androidTargetCompatibility = JavaVersion.VERSION_21
val managerVersionCode by extra(getVersionCode())
Expand Down
Loading

0 comments on commit 31c75ca

Please sign in to comment.