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

Added adaway.root template #1337

Merged
merged 4 commits into from
Feb 21, 2024
Merged

Added adaway.root template #1337

merged 4 commits into from
Feb 21, 2024

Conversation

JohnRTitor
Copy link
Contributor

@JohnRTitor JohnRTitor commented Feb 2, 2024

Adaway only needs the following permissions to work properly: DAC_OVERRIDE, SYS_PTRACE.

Note: systemless hosts kernelsu module needs to be installed, to add support.

This PR only addresses the minimal permission requirements of Adaway to let it modify hosts file.

@tiann
Copy link
Owner

tiann commented Feb 3, 2024

Why needs PTRACE? please check: #1134 (comment)

@JohnRTitor
Copy link
Contributor Author

JohnRTitor commented Feb 4, 2024

To be honest, I just enabled all the permissions and kept removing them till I got to this list. These permission are "essential" without these, the app can not seem to be modify the hosts file.

If I just add it to the group readproc and remove the PTRACE perm:
Screenshot_20240204-204924_AdAway

Another thing I would like to note that there is a "Web server feature":
It needs to NET_BIND_SERVICE to work. (the certificate needs to be manually installed via certificate manager)
Screenshot_20240204-204326_AdAway

The app works fine with DAC_OVERRIDE, NET_BIND_SERVICE, SYS_PTRACE. or ofcourse, with the "default" app profile.

@tiann
Copy link
Owner

tiann commented Feb 5, 2024

The PTRACE is a very dangerous cap, i don't know why it needs ptrace to work

@JohnRTitor
Copy link
Contributor Author

Without this perm, the app can't seem to detect that it has root, on a fresh install/data cleared. I'm pinging @symbuzzer here who contributed to both KernelSU and Adaway for their input. Also pinging an Adaway maintainer @PerfectSlayer

@symbuzzer
Copy link
Contributor

It shouldn't need CAP_SYS_PTRACE I think. I also don't understand why it needs to read process

@JohnRTitor
Copy link
Contributor Author

It shouldn't need CAP_SYS_PTRACE I think. I also don't understand why it needs to read process

Can you find out why it needs to use the perm from the open source code? Adaway maintainer @PerfectSlayer seems to have stalled the project for a year. He is still active on GitHub though.

@symbuzzer
Copy link
Contributor

I have no motivation for this, sorry ,:(

@PerfectSlayer
Copy link

PerfectSlayer commented Feb 13, 2024

Hey AdAway maintainer here 👋

Not sure either why CAP_SYS _PTRACE is needed but if you get this error without it, it should mostly come from one of the two classes: RootModel or ShellUtils.

It might also help if you are able to provide a logcat when it’s failing.

@JohnRTitor
Copy link
Contributor Author

Here's the log snippet.
Log_2024-02-13_15-37-12.txt

I suppose this is the issue.
Screenshot_20240213-154016_Logcat Extreme~2

@symbuzzer
Copy link
Contributor

@PerfectSlayer
Wouldn't you consider creating the hosts file from the /data/data/org.adaway/files/ folder into the /data/adb/modules/systemless-hosts-KernelSU-module/system/etc/ folder? If KernelSU and systemless-hosts-KernelSU-module are installed, of course.

Adaway only needs the following permissions to work properly:
DAC_OVERRIDE, SYS_PTRACE
Also added Bengali translation
@tiann
Copy link
Owner

tiann commented Feb 21, 2024

Although there are still some doubts, I will merge it; because it is better to have restrictions than no restrictions at all. If you find out why PTRACE is needed, you are welcome to PR again.

@tiann tiann merged commit e85646f into tiann:main Feb 21, 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.

None yet

4 participants