Bulid.prop - Moto G Power Questions & Answers

How to edit bulid.prop? I have g8 power root and magisk. I tested various programs and the changes are not saved (I installed the r / w system). Is it possible to change bulid.prop using a computer at the moment?

I have the Stylus and have achieved root using the same method, however there is something not quite right with the permissions. I cannot make changes to any root files. I'm not sure how to correct this.

Since it doesn't appear anyone has answered this yet, I spent a majority of yesterday attempting to figure it out as I had the same issue when attempting to edit build.prop.
The system files appear to be read only, although you can utilize the resetprop tool that is built into Magisk to modify the values in build.prop
1. Get a terminal emulator, I used Termux
2. Type in su
3. Type in setprop [the line you wish to add to build.prop]
4. You will require 2 arguments (see "setprop --help")
Example:
setprop net.tethering.noprovisioning
It will then request the value
Type true
Hopefully this is helpful for others.

Related

[MOD] Change WiFi hostname - for custom ROMs (Sept 23)

This is useful for identifying phones on the local networks by looking at DHCP lease tables in the routers. It doesn't make your phone appear on Windows networks, since the phone needs to broadcast NetBIOS name for that. If you want your phone to show up on Windows networks (and share files) - you need Samba server, and JimmyChingala is working on one.
ROM developers can insert the option to customize hostname using the way described below in their Spare Parts options. Feel free to do so.
[SOLUTION]
The following shell command does the job of changing WiFi hostname:
echo YOURHOSTNAME > /proc/sys/kernel/hostname
Click to expand...
Click to collapse
For the change to stay, it should be executed on each boot. And here the things start being more problematic.
For custom ROMs:
Most, if not all, custom ROMs include some user init shell script that will be executed on boot, making the solution easy.
Enter the following line in the Terminal / ADB shell:
echo "echo YOURHOSTNAME > /proc/sys/kernel/hostname" >> the_path_and_name_of_userinit_script.sh
chmod 777 the_path_and_name_of_userinit_script.sh
Click to expand...
Click to collapse
Several examples of custom ROMs and their userinit scripts:
Suggested - will work for most ROMs (creates another file in directory of autoexecuted scripts): /etc/init.d/88hostnameinit
Additional possibility for Enomther's ROM: /data/local/userinit.sh
Additional possibility for CyanogenMOD: /sd-ext/userinit.sh
For stock ROMs:
There is no autorun script for stock ROMs, so they have to be added through modifying boot.img. It's a complicated procedure, and even though guides exist for it - I suggest not to mess with it only because of the hostname. The easiest solution would be to create a script file with the line above using Gscript or other scripting solutions, and execute it after each reboot. If anyone really wishes to modify boot.img - I assume that he/she knows enough about Linux/Android since it can be relatively easily done only on Linux, can find the necessary guides with some googling (like I did), and in this case the modification is easiest to do directly in init.rc - changing "hostname localhost" to "hostname name_of_your_choice".
[ORIGINAL POST]
Hi people,
I'm not much of a dev, but I can find my way around with a bit of Google search And sorry about the links that don't link, new user's permissions don't allow me to...
Anyway, after messing with my router today I've noticed that Nexus transmits "localhost" as its host name to DHCP server, causing my DD-WRT to show it as "*". I went to Google and to my surprise, discovered that there isn't such an option in any Nexus ROM yet.
Found this: LINK_www_laslow_net_?p=501
To change your hostname on Cyanogen 5.x, add the following line to the bottom of /system/etc/init.d/01sysctl -- and make sure you make a backup of 01sysctl before editing it!
echo NEWHOSTNAME > /proc/sys/kernel/hostname
Click to expand...
Click to collapse
I tested it, and it didn't work. After booting, the file still read "localhost" in it, and the hostname on DHCP server reflected it.
But, I didn't get frustrated, connected with ADB, manually executed the command:
echo MyHostName > /proc/sys/kernel/hostname
checked that the file was overwritten, disabled WiFi, deleted DHCP lease, enabled WiFi back - and voila, I have a new hostname!
Then I went to search for hostname setting, which got me to /init.rc:
on boot
# basic network init
ifup lo
hostname localhost
domainname localdomain
Click to expand...
Click to collapse
Well, I guess that's the place. A tiny problem, though - it's in the boot image, which can't be easily modified. Thanks to the latest thread on update.zip creation I can probably do it myself, but I wanted to share the findings and ask for the correct way to implement.
There's a "dirty but functional" way of "disable WiFi - override /proc/sys/kernel/hostname - enable WiFi", and it's probably not a problem to stick it somewhere in the boot sequence, or even write an app that writes those changes to one of the boot scripts and allows configuration of host and domain names. But it's not the best way - DHCP might already give out a lease, and the new host name might not register.
And there's a correct (?) way of doing it, introducing it into init.rc. Since it's "on boot", I suppose that it runs after mounting the partitions - which means that the partitions are already accessible.
In this case, the best way would be executing a small shell script that would check for existence of, say, "/system/etc/settinghostdomainnames.rc" and create a default one if it's not there, then use "import /system/etc/settinghostdomainnames.rc" and set a manual trigger, like the guy is trying to do here:
LINK_groups.google.co.jp_group_android-developers_browse_thread_thread_e2f432707b735ff0
"trigger someeventtobringupnetworkinterface"
That would allow to use a custom setting for host and domain names that can be changed by SW, and adding that as another option into ROM Settings app or external app.
But the guy in question didn't succeed. What did he miss? Would it be better to do something like "on fakesystemproperty=something" and instead of manual trigger, doing "setprop fakesystemproperty something"?
I can probably test it and find out myself, but it would take loads of time compared to one of the kernel devs, and I don't even have the environment set up for modifying boot images. I was kinda hoping that one of the kernel devs would test it. I can write and post the modifications to init.rc and the custom script, they're very simple.
So, who can help me with answering the questions in the thread, and/or testing the modification?
Thanks! It's back.
Oh well, I'll keep preparing Ubuntu VM anyway
OK, first test fired - updated /init.rc in my own boot.img, checked the values. It's working, hostname is indeed modified.
Now I'll try to rewrite /init.rc in such way as to load the hostname setting from elsewhere, while not screwing the security. Will post results soon.
Setting it to the same value as the BT value would be ideal. I'm not sure how you could do that though, because the init scripts run before the frameworks load
Looking forward for a fix to this problem.
Update, but only partially on topic:
God, I hate SH scripting. Couldn't even google a normal tutorial that would explain where I went wrong. A script of 10 lines, and I can't make it work.
Let's see, I need something like this:
#!/system/bin/sh
echo "on service-exited-network_prepare" > /system/etc/net_init.rc
echo " ifup lo" >> /system/etc/net_init.rc
if [ -e "/system/etc/net_init.domain" ];
then
echo "hostname `cat /system/etc/net_init.host`" >> /system/etc/net_init.rc
else
echo "hostname localhost" >> /system/etc/net_init.rc
fi
if [ -e "/system/etc/net_init.domain" ];
then
echo "domainname `cat /system/etc/net_init.domain`" >> /system/etc/net_init.rc
else
echo "domainname localdomain" >> /system/etc/net_init.rc
fi
echo >> /system/etc/net_init.rc
Of course, this thing fails miserably with -
Syntax error: end of file unexpected (expecting "then")
What the hell am I doing wrong? Never used SH before, mostly tcsh and perl.
Thanks.
Oh well, I guess I got the problem.. Unix vs Windows file format. Sorry for bothering.
its always bothered me that you cant change the device name for wifi networks, and ive always looked for a way to change it.
kudos to you for the ambition and diligence to do it!
dont give up, if you can get it smoothed out enough im sure cyanogen will implement it in his next mod. ive always wished there was an option in wifi settings to change device name. itd be very useful for lan ip configuring and when your connected to a random hotspot lol
Ok, after fighting for a day, I still didn't manage to import another .RC file and run on service exit (I don't even see the trace of the process I'm trying to start - the first thing it does is attempting to write log, and there is no log, no matter where I put the start command), but at least for a "quick-and-dirty way" there's a very simple solution, given SD-EXT partition (I believe everyone creates it):
open terminal application, type the following command:
echo "echo YOURHOSTNAME > /proc/sys/kernel/hostname" > /sd-ext/userinit.sh
That would override the hostname of the system before boot completion.
After some reading, I believe there's nothing bad in setting the hostname twice - once default localhost in init.rc, and then overriding it using /proc/sys directory, Linux is designed to cope with that and hopefully so does Android.
So, as to pershoot's request, it's possible to write a small application to read Bluetooth device name value and write it as WiFi hostname, and include it in boot process right before 20userinit.
Now this is a task I'm not suitable for, I have no knowledge of frameworks whatsoever. Anybody up to the task?
Jack_R1 said:
After some reading, I believe there's nothing bad in setting the hostname twice - once default localhost in init.rc, and then overriding it using /proc/sys directory, Linux is designed to cope with that and hopefully so does Android.
So, as to pershoot's request, it's possible to write a small application to read Bluetooth device name value and write it as WiFi hostname, and include it in boot process right before 20userinit.
Now this is a task I'm not suitable for, I have no knowledge of frameworks whatsoever. Anybody up to the task?
Click to expand...
Click to collapse
I requested it and I'm not pershoot
Oops Sorry, my bad. Fever and lots of time in front of the computer don't do me good...
Kudos to you Jack_R1. Watching this.
Let me know if you need any help with shell scripting.
Gonna watch this and try it out later, the solution so far.
is this a stable fix?
is this confirmed to work?
Sorted out, updated with the most current info and several examples of custom ROMs.
Jack_R1 said:
Sorted out, updated with the most current info and several examples of custom ROMs.
Click to expand...
Click to collapse
I am running CM6 with a2sd and somehow the /sd-ext/userinit.rc is not executed. Even if I change permissions of the file to 777, it's not executed.
I also haven't found in init.d the script which executes userinit.rc, might be because I am running custom kernel? (wildmonks).
The only way for me to do it was to put the script in /etc/init.d/88userinit file and change it's permissions to 777
It's /scripts/userinit.sh, not userinit.rc
The execution of /sd-ext/userinit.rc used to be in /init.rc, in boot.img.
But the preferred way for most of the ROMs is to use /etc/init.d/ scripts anyway, since a lot of ROMs use them.
Changed the 1st post to reflect it.

[HOWTO] Remove bash Color Codes

Anyone who uses the latest roms, mods, etc. is probably using bash. Bash is awesome, bash is great bash is...annoying if you use Windows with adb.
Familiar sight?
bash-4.1# ls
ls
←[1;36mbin←[0m ←[1;32minit.rc←[0m ←[1;34msbin←[0m
←[1;34mcache←[0m ←[1;32minit.smdkc110.rc←[0m ←[1;34msdcard←[0m
←[1;34mconfig←[0m ←[1;32minit.smdkc110.sh←[0m ←[1;34msqlite_stmt_journals←[0m
←[1;34mdata←[0m ←[1;36minit_samsung←[0m ←[1;34msys←[0m
←[1;34mdbdata←[0m ←[1;34mlib←[0m ←[1;34msystem←[0m
←[1;32mdefault.prop←[0m ←[1;32mlpm.rc←[0m ←[1;32msystem.prop←[0m
←[1;34mdev←[0m ←[1;34mmnt←[0m ←[1;34mtmp←[0m
←[1;34mefs←[0m ←[1;34mpreinstall←[0m ←[1;34muserdata←[0m
←[1;36metc←[0m ←[1;34mproc←[0m ←[1;36musr←[0m
←[1;32mfota.rc←[0m ←[1;32mrecovery.rc←[0m ←[1;34mvoodoo←[0m
←[1;36minit←[0m ←[1;34mres←[0m
Now my way:
bash-4.1# ls
ls
bin init.rc sbin
cache init.smdkc110.rc sdcard
config init.smdkc110.sh sqlite_stmt_journals
data init_samsung sys
dbdata lib system
default.prop lpm.rc system.prop
dev mnt tmp
efs preinstall userdata
etc proc usr
fota.rc recovery.rc voodoo
init res
Requirements:
Root.
Clockworkmod Recovery.
My busybox.
My color code removal patch.
Patch
http://dl.dropbox.com/u/2056318/bash_nocolor_1.1.zip
Install both via cwm. Make a nandroid backup first, JUST IN CASE.
If my patch hosed ls on your phone, this should fix it. Sorry about that.
http://dl.dropbox.com/u/2056318/bash_nocolor_fix.zip
Great Work!
What is this?
Did you remove all color from bash, or is it just not doing ls in color by default?
I would recommend people use something like mintty or console2 as their terminal on Windows instead of a regular cmd anyway, for anyone who actually uses the terminal frequently. Well, so console2 gets the same stupid behavior as the standard cmd with escape codes in adb for some reason, but it works with bash color escape codes in general (I have them in my $PS1). Mintty does support escape codes in adb shell, and is generally pretty nice, but doesn't have tabs unfortunately. Just a tip for people.
Nice job for those who don't want to change their terminal, of course. I just feel that for power users mintty is a better solution.
It removes them from ls, which is which is the only place the problem will lie for most windows users. I require my busybox, as there are many versions out there, but mine is the latest, and I know it supports ls. My patch removes the ls binary from Android and replaces it with my own symlink.
As for those options, I will stick with my powershell, but thanks. A poweruser should be using Linux anyway (I do normally).
Ah, yeah, that's probably true. But why is the default ls with colors in Android anyway? I normally need to create an alias to set ls to ls --color=auto or something along those lines usually. Is it just not getting the terminal info properly? I'm just curious about this I guess.
I'm a weird person who uses Unix shells on Windows, I guess because I like games too much.
Its not. ls in itself is a binary, not a symlink. It is running through the bash shell. Bash, is what supports colors. By default Android does not run bash, but sh.
Oh huh, didn't realize Android used sh by default. Guess I never paid attention.
Do you drop busybox in /system/bin to install it? That is, if you aren't flashing it from cwm.
Hate to be the bringer of bad news, but something in this breaks WiFi. After installing it, I can no longer connect to my router, it just stalls at "Obtaining address". When I check the router, it's already assigned an address.
I reflashed DL09 cleanly, and it connects right away. I re-apply this fix, and WiFi stops working again.
I did say make a nandroid backup....right?
Anyway, you are correct. Patch has been removed until I can figure something else out.
I did say make a nandroid backup....right?
Anyway, you are correct. Patch has been removed until I can figure something else out. Please revert to an earlier nandroid.
First post updated with a better fix that disables color for bash, system wide. Thanks to enderst from irc for the help.

[How-to] Set up EAP-TLS or other advanced Wifi connections on NT (root only!)

Hello all,
I figured this tutorial may come in handy to a few people out there since the documentation for getting this to work is quite atrocious.
What this tutorial is:
A step-by-step walkthrough of setting up wpa_supplicant.conf to access advanced networking protocols that we otherwise don't have access to (note, this will ONLY work with root at the moment).
What this tutorial is not:
A wireless troubleshooting thread for any wireless issues not related to wpa_supplicant, EAP-TLS, EAP-TTLS, etc.
Thanks ahead of time.
NOTE: This tutorial will be giving instructions for a Windows 7 machine, but 90% of the code I provide can easily be copied over to Linux/BSD/OSX, just replace with the Bash equivalents.
To begin, you will need a few things:
--ADB, with working drivers, though you don't NEED root access through it it is nice to have, since it cuts the typing in half, and the setup for that can be found here: [App]: ADB Root Hijack [ADB Runs as Root now]
--openSSL, for converting certificates to the proper formats.
Windows instructions: Requires Cygwin, see this link here. This will install several other useful tools, and you'll love Cygwin if you're a power user
Linux/BSD/OSX instructions: install using your favorite repositories or from binaries (in the case of OSX). For Ubuntu/Debian: sudo apt-get install openssl
--You will need access to the Development menu (use an app or the Any Cut app to make a shortcut), as well as Root Browser lite (or Root Explorer).
--Alot of patience, and a bit of time. This should be straightforward, but don't expect a perfect solution for everyone.
1) The most important step, since this will cause you no end of headaches for possibly an hour or two as you trace it down: Go into the Development menu, UNCHECK USB Debugging and RECHECK it, then UNCHECK Auto Mount. So, even if debugging is checked, uncheck and check it anyway. And make SURE Auto Mount is unchecked, otherwise this will automatically install the "normal" NT drivers and screw up the entire process.
2) Plug in the Nook, and bring up the command line (cmd.exe). Run:
Code:
adb devices
If this returns an alphanumeric string (or anything), your device is in and you're good to go. Otherwise, check the other forum topics for troubleshooting (link to come).
3) To begin, we need to convert our tickets to the correct format. For this we will use OpenSSL. To make this easy, I piled all of my working space into a folder in the root of the C: drive, called "certs". For this example, I will assume that you were given a root certificate named rootCA.crt and a private certificate names [email protected].p12 (because I was, for the eduroam worldwide network).
This example also assumes EAP-TLS authentication. To convert the files:
Code:
openssl x509 -in rootCA.crt -out rootCA.der -outform DER
openssl x509 -in rootCA.der -inform DER -out rootCA.pem -outform PEM
then
openssl pkcs12 -in [email protected] -out cert.pem -clcerts -nokeys
openssl pkcs12 -in [email protected] -out key.pem -nocerts
Note: even if your business/Uni doesn't use a separate hashed key normally (For example, the University of Alaska system), you will need it here. Normally a certificate app handles all of this (on AOSP and custom builds).
4) Thanks to good ol' FSTAB, we will have to remount /system so we can read/write to it:
Code:
adb shell
su
mount -o remount,rw /system /system
5) Now, we have three new files: rootCA.pem, cert.pem and key.pem in the C:\certs folder. We push them to their proper directory on the NT:
Code:
adb push rootCA.pem /system/etc/wifi/
adb push cert.pem /system/etc/wifi/
adb push key.pem /system/etc/wifi/
Note: This is where it gets tricky without root ADB access...the option is to push them to "/media/My Files/My Downloads/" (including quotes) and then use a terminal or root browser to move them to /system/etc/wifi/
6) Next, we get to pull wpa_supplicant finally!
Code:
adb pull /system/etc/wifi/wpa_supplicant.conf .
Note: Make sure to include the . at the end, this means 'copy it to the current directory'
7) Open wpa_supplicant.conf in Wordpad (NOT notepad, wrapping issues), and build a profile based on the examples located here.
Here is an edited version of mine, if you use EAP-TLS this will work for you:
Code:
network={
ssid="YourAPNameHere"
scan_ssid=1
key_mgmt=WPA-EAP
pairwise=CCMP TKIP
group=CCMP TKIP
eap=TLS
identity="[email protected]"
ca_cert="/system/etc/wifi/rootCA.pem"
client_cert="/system/etc/wifi/cert.pem"
private_key="/system/etc/wifi/key.pem"
private_key_passwd="yourPassHere"
priority=20
}
Change ssid, identity, and private_key_passwd to your respective information.
NOTE: priority, near the bottom, determines when it will connect to the network when others are around. Compare it to the values of the priority's set in /data/misc/wifi/wpa_supplicant.conf, the higher the value the higher the priority when they're all within range.
Now save and close the file.
8) Now, we push and reboot:
Code:
adb push wpa_supplicant.conf /system/etc/wifi/
then reboot the nook.
Now, after reboot, it should be good to go!
Notice, one bit of trouble I ran into, if you just get "error" when turning on the wireless after reboot, double-check that your certificates are correct and in the correct places, and wpa_supplicant.conf points at them. If thats fine, try erasing /data/misc/wifi/wpa_supplicant.conf, then reboot, and the list will be rebuilt and your AP will automatically connect.
Please let me know if there are any issues with the instructions, it's 6am and I haven't slept more than 8 hours in the last 3 days troubleshooting this, building kernels and playing Skyrim
reserved for future things
Also of note: I'm working on making this into scripts, don't worry everyone. And, if you bork your wifi, I will have a wireless fix in the works too.
Hi
First of all, thanks for this tutorial
I'm pretty sure this should be very straightforward but not to mess this thing up what do I need to change for a network with the following definitions:
Network SSID: eduroam
Security: 802.1x Enterprise
EAP method: PEAP
Phase 2 authentication: MSCHAPV2
Cheers
LacerdaPT said:
Hi
First of all, thanks for this tutorial
I'm pretty sure this should be very straightforward but not to mess this thing up what do I need to change for a network with the following definitions:
Network SSID: eduroam
Security: 802.1x Enterprise
EAP method: PEAP
Phase 2 authentication: MSCHAPV2
Cheers
Click to expand...
Click to collapse
Hey, it's not a problem at all. Pulled from the source here: NookDevs.com wpa_supplicant.conf I built this skeleton here:
Code:
network={
ssid="eduroam"
scan_ssid=1
key_mgmt=WPA-EAP
pairwise=CCMP TKIP
group=CCMP TKIP
eap=PEAP
identity="[email protected]"
password="YOUR-PASSWORD"
ca_cert="/system/etc/wifi/cacert.pem"
phase1="peapver=0"
phase2="MSCHAPV2" }
As you can see, you'll need to enter your University email in the identity field and your password in the password field, and if you don't have the needed certificates/password/etc you can get that from your local IT office (I would ask to speak with your network technicians though, helpdesk may not have it). Make SURE to read the instructions in that link, the openssl bit is different than the guide above!
Thanks!
On monday I will try that and will report the outcome.
Cheers
Hi.
It worked like a charm! No problem at all.
Thanks!
Cheers
Awesome! Glad to hear it.

[APP] CommandCenter the power of shell without having to use the termina

Have you ever dreamed of an app to execute your favorite shell commands, whether it is for collection dmesg/logcat/dumpsys or set kernel parameters.
Well here comes CommandCenter, a generic app for grouping all your favorite commands.
CommandCenter is free with ads and can be downloaded from the Android Markethttps://market.android.com/search?q=com.asksven.commandcenter(IT TAKES SOME TIME TO UPDATE CUZ ITS JUST PUBLISHED
It is also open source
If you are a kernel developer you may want to provide a tool for your users to run certain commands without havint to maintain an app for that; if yes just submit a Command Set and have your users download it.
If you are a poweruser there are commands that you use all the time, wither from adb shell or in the terminal. Make one or multiple Command Set and enjoy the comfort of an Android app and the power of your favorite commands.
http://market.android.com/publish/i...0_ndAPFoAzfqVabGrGq2vHV4L2LRT4mKNjfMwlEo5.png
How it works
The command sets are stored of the sdcard in the app's private folder /sdcard/Android/data/com.asksven.commandcenter/files in the form of json files. On load the files are parsed and each file (Command Set) shown as a tab.
A single click on a Command displays its details, a long click pops up a dialog from where you can run the command (this is configurable in the preferences).
A command has two parts:
- the command to be executed itself: it may contain a variable and in that case a popup will ask for the value to be used
- an optional command to retrieve a status: if a status can be read it will be displayed
CommandCenter comes with two pre-configured Command Sets:
- general commands for logging / diagnosis
- a few command for Fracisco Franco's awsome GN kernel
Caution
Always check the command's before running them. CommandCenter support 'su' command and you should know what you do as those could harm your phone. I will not take any responsibility for any dammage caused by command run using CommandCenter
RELEASE NOTES:
v0.7.2 2012-02-12
#2: dumpsys missing su, and logcat files have zero-length
#3: A few issues with backward compat to Android 2.1/2.2 fixed
v0.7.1 2012-02-11
#1: fixed Android 2.1 compatibility issue
v0.7 2012-02-11 Initial release
ALL CREDITS TO chamonix FOR THE GIFT
Wrong section bro..!
Themes and Apps!
Sent from my iPad 3 using XDA App
does it even matter if it solves the purpose??
it is not about what matters and what not!it is all about being sorted and arranged.
I think this thread should be deleted, it's not even related to the phone!
Greets!

[Q] Insecure boot.img (Jelly Bean)

Hi,
I try to have my own insecure boot.img for my Galaxy S3 (GT-I9300) on Jelly Bean.
I have repack boot.img with ro.secure=0 and ro.debuggable=1, but it doesn't work on JB (it works on ICS).
Do you know why it doesn't work ? Have you a solution ?
PS : I wouldn't use Insecure Adbd by Chainfire, even if he has worked fine and I love his work.
Best regards,
adbd binaries from release builds of JB ignore the ro.secure setting. You can unpack the initrd of the Perseus kernel to use the JB adbd binary I built that doesn't drop root privileges, or extract adbd.png from adbd Insecure and use that binary in your initrd.
Sent from my GT-I9300 using Tapatalk 2
qwerty12 said:
adbd binaries from release builds of JB ignore the ro.secure setting. You can unpack the initrd of the Perseus kernel to use the JB adbd binary I built that doesn't drop root privileges, or extract adbd.png from adbd Insecure and use that binary in your initrd.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
First, thanks you for you reply.
If I understand, two solutions :
1 - Use adbd binary built by you (but I don't understand : that doesn't drop root privileges -> That means our own read ro.secure value ?)
2 - Use adbd.png (not an image file ?) to replace the original one
It's right ?
If I understand, two solutions :
1 - Use adbd binary built by you (but I don't understand : that doesn't drop root privileges -> That means our own read ro.secure value ?)
Click to expand...
Click to collapse
adbd is started as root by init; however, it will usually switch user to the "shell" account, which is, well, not as powerful as root. I'm sure you see it when you run "adb shell" currently
If you look at adb.c, line 899 you'll see that if ALLOW_ADBD_ROOT is not defined then adbd will not even look at the ro.secure property to determine whether it should then drop its root privileges; it will always do so (the function always returns 1).
ALLOW_ADBD_ROOT is only defined when the build target is set to a debug one, not a release one. With ALLOW_ADBD_ROOT defined, only then adbd, through the now more "complete" should_drop_privileges function, will look at the ro.secure property to determine whether it should drop its privileges.
Instead of changing Android.mk to always define ALLOW_ADBD_ROOT, I changed "return 1" into "return 0" because I don't want to change the ro.secure property, but I don't want adbd to drop privileges. I don't know if it does it now, but the SysScope service on Samsung phones that checks for root may also look at the ro.secure property and I don't want to give it another reason to mark my device as Modified.
2 - Use adbd.png (not an image file ?) to replace the original one
It's right ?
Click to expand...
Click to collapse
adbd.png is the adbd binary in Chainfire's adbd Insecure apk. It has the .png extension so that some tool in the SDK won't attempt to compress it. It also doesn't drop privileges and is JB compatible. Just offering it as an alternative
Best regards
You are so helpful for me with your explanations about adb.c.
I'm so stupid, I haven't look the source code. Shame on me, I use and build apps for GNU/Linux for over 10 years and I don't look that.
Thanks man !

Categories

Resources