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

sudo4droid #1

Open
wants to merge 9 commits into
base: 1500
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 4 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
# Magisk Module Template
# Sudo4Droid Magisk Module

This `README.md` will be shown in Magisk Manager. Place any information / changelog / notes you like.

**Please update `README.md` if you want to submit your module to the online repo!**

Github has its own online markdown editor with a preview feature, you can use it to update your `README.md`! If you need more advanced syntax, check the [Markdown Cheat Sheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).

For more information about modules and repos, please check the [official documentations](https://github.com/topjohnwu/Magisk/blob/master/docs/modules.md)

---
# **Module Name**
## Description
Description here
## Changelog
Changelog here
## Requirements
- Requirement 1
- Requirement *
- Requirement n
## Instructions
Instructions here
- Or other instructions here
- Followed by more instructions
1. Or a list of instructions
2. With more instructions
## Links
[Module XDA Forum Thread](https://forum.xda-developers.com/apps/magisk/module-url-here "Module official XDA thread")
This module adds the sudo command to Android. It adds the file "/system/xbin/sudo", which is a script that passes all arguments to 'su -c'. Specifically, the code is 'su -c "$@"'.

[Latest stable Magisk](http://www.tiny.cc/latestmagisk)
## Changelog
v1.1: Update to template 1500
30 changes: 11 additions & 19 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
#
# 1. Place your files into system folder (delete the placeholder file)
# 2. Fill in your module's info into module.prop
# 3. Configure the settings in this file (config.sh)
# 4. If you need boot scripts, add them into common/post-fs-data.sh or common/service.sh
# 5. Add your additional or modified system properties into common/system.prop
# 3. Configure the settings in this file (common/config.sh)
# 4. For advanced features, add shell commands into the script files under common:
# post-fs-data.sh, service.sh
# 5. For changing props, add your additional/modified props into common/system.prop
#
##########################################################################################

Expand Down Expand Up @@ -41,7 +42,7 @@ LATESTARTSERVICE=false

print_modname() {
ui_print "*******************************"
ui_print " Magisk Module Template "
ui_print " Sudo4Droid Magisk Module "
ui_print "*******************************"
}

Expand All @@ -50,8 +51,10 @@ print_modname() {
##########################################################################################

# List all directories you want to directly replace in the system
# Check the documentations for more info about how Magic Mount works, and why you need this
# By default Magisk will merge your files with the original system
# Directories listed here however, will be directly mounted to the correspond directory in the system

# You don't need to remove the example below, these values will be overwritten by your own list
# This is an example
REPLACE="
/system/app/Youtube
Expand All @@ -60,7 +63,7 @@ REPLACE="
/system/framework
"

# Construct your own list here, it will override the example above
# Construct your own list here, it will overwrite the example
# !DO NOT! remove this if you don't need to replace anything, leave it empty as it is now
REPLACE="
"
Expand All @@ -78,22 +81,11 @@ set_permissions() {
# set_perm_recursive <dirname> <owner> <group> <dirpermission> <filepermission> <contexts> (default: u:object_r:system_file:s0)
# set_perm_recursive $MODPATH/system/lib 0 0 0755 0644

# set_perm <filename> <owner> <group> <permission> <contexts> (default: u:object_r:system_file:s0)
# set_perm <filename> <owner> <group> permission> <contexts> (default: u:object_r:system_file:s0)
# set_perm $MODPATH/system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0
# set_perm $MODPATH/system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0
# set_perm $MODPATH/system/lib/libart.so 0 0 0644

# The following is default permissions, DO NOT remove
set_perm_recursive $MODPATH 0 0 0755 0644
set_perm_recursive $MODPATH/system/xbin/sudo 0 0 0755
}

##########################################################################################
# Custom Functions
##########################################################################################

# This file (config.sh) will be sourced by the main flash script after util_functions.sh
# If you need custom logic, please add them here as functions, and call these functions in
# update-binary. Refrain from adding code directly into update-binary, as it will make it
# difficult for you to migrate your modules to newer template versions.
# Make update-binary as clean as possible, try to only do function calls in it.

10 changes: 5 additions & 5 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=template
name=Template Module
id=sudo4droid-magisk
name=Sudo4Droid
version=v1
versionCode=1
author=topjohnwu
description=A short description
versionCode=2
author=PorygonZRocks
description=Sudo for Android (requires MagiskSU)
minMagisk=1500
1 change: 1 addition & 0 deletions system/xbin/sudo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
su -c "$@"