[Q] How to edit default.prop? - Nexus 4 Q&A, Help & Troubleshooting

I want to edit my default.prop such that:
ro.secure=0
ro.debuggable=1
persist.service.adb.enable=1
Currently my default.prop
ro.secure=1
ro.debuggable=0
persist.service.adb.enable=0
I tried to use setpropex to change it, but it doesn't seem to work in Android 4.4. When I type in getprop in ADB my default.prop shows that it has not been changed.

default.prop is stored in the ramdisk and it's values cannot be modified by setprop by design on all versions of android
prop files are merely text files that android loads the values of at runtime, if you change their values with setprop the files wont be changed unless you manually modify them.
You can either unpack the ramdisk, modify it's contents, repack it, flash the updated boot.img
or use something like: [root] adbd Insecure - Chainfire (there's a free version in the description)
Most custom kernels should already have those values, if you manually modify the stock one,
keep in mind that you will need to undo and redo it every time you use an official ota or it will fail to patch.

Related

permanently change $PATH

I'm trying to change $PATH to have /system/xbin/ before /system/bin/.
I could do this manually but I'm lazy, so I'm looking for a way to have it like that on boot. But no matter whether I change it in init.rc, fota.rc, recovery.rc, they're all back in the old order after a reboot.
Anyone know which file I have to change to make my path changes stick?
XlAfbk said:
I'm trying to change $PATH to have /system/xbin/ before /system/bin/.
I could do this manually but I'm lazy, so I'm looking for a way to have it like that on boot. But no matter whether I change it in init.rc, fota.rc, recovery.rc, they're all back in the old order after a reboot.
Anyone know which file I have to change to make my path changes stick?
Click to expand...
Click to collapse
The init.rc file is a part of the initramfs which is included in the kernel image (zImage). You need to change the init.rc and recompile the kernel with the updated initramfs to make the changes stick.
There is also a way to unpack and repack an existing kernel image, but IMHO recompiling the kernel is much simpler.
hm, compiling kernels isn't really my thing.
is there another way to insert commands into boot process or change path on startup?
XlAfbk said:
hm, compiling kernels isn't really my thing.
is there another way to insert commands into boot process or change path on startup?
Click to expand...
Click to collapse
I think if you have a kernel with init.d support, you can just drop a script in the init.d directory and it will get automatically executed.
I think all the custom kernels (at least ones based on Voodoo) have init.d support -- never actually tried this so I am not totally sure about this.
I'm using the hacked voodoo kernel for gingerbread, created a /init.d/test.rc with "export PATH ... " but it didn't work. Is it supposed to be a .rc script? supposed to work in gingerbread kernel?
edit: after a closer looks it seems that the script is not only not run but /init.d is completly and without a trace gone after rebooting

[GUIDE][LINUX] MIUI patchrom for jellybean roms

I searched and reading a lot but can't find properly guide how to use miui patchrom for jellybean roms. So i decided share what i've found and put all in one guide.
1. First of all you need linux on your machine. I use kubuntu, installed from windows (wubi) ->http://www.kubuntu.org/getkubuntu/download
2. Now you need SDK tools for linux http://developer.android.com/sdk/index.html
-download and unzip it to for egz home/your_username/android-sdk-linux
-set PATH for tools and platform-tools folders
Code:
export PATH=/home/your_username/android-sdk-linux/platform-tools:/home/your_username/android-sdk-linux/tools:$PATH
On x64 systems you are required to install some 32-bit libraries so in a terminal write:
Code:
sudo apt-get install ia32-libs
3. Download ROM which you want to patch with miui patchrom, must be deodexed and rooted. For us it must be jellybean ROM for egz 4.1.2. I suggest to use CM or AOSP based roms because stock sammy roms have a lot of differences and it's not so easy to port them. After downloading your ROM base rename it to something short and easy i use stock.zip.
In home create folder i use patchrom folder in this folder create for egz stock folder and put downloaded rom to it.
4. Download from MiCode github all necessary files https://github.com/MiCode we need:
https://github.com/MiCode/patchrom_tools/archive/jellybean.zip tools
https://github.com/MiCode/patchrom_miui/archive/jellybean.zip miui
https://github.com/MiCode/patchrom_i9100/archive/jellybean.zip i9100
https://github.com/MiCode/patchrom_build/archive/jellybean.zip build
https://github.com/MiCode/patchrom_android/archive/jellybean.zip android
all zips for jellybean, why downloading zips? because for me repo don't download all files, that way is much easiest.
Unzip all files to your stock folder which you create in step 3. Rename all folders by this way patchrom_tools_jellybean becomes tools, patchrom_miui_jellybean becomes miui ...
5. In i9100 folder you can find makefile its first of configuring files which you need to copy to stock folder and edit it.
This is my makefile, you should edit using this explanations:
'local-zip-file' = Name of your original ROM zip
'local-out-zip-file' = Name for your finished MIUI rom
'local-modified-apps' = Apps that will be modified to fit in with the framework. They need to be modified because they contact with the system
'local-miui-apps' = MIUI Apps that will be integrated into the zip
'local-remove-apps' = Apps that will be removed from the original ROM
'local-pre-zip' = Refers to codeblock that should be executed before the zip is done.
'local-after-zip' = Refers to codeblock executed after the zip is completed
'local-zip-misc' = The codeblock just described at 'local-pre-zip'. It adds some Google Apps and a buid.prop
'local-test' = Another codeblock
Code:
#
# Makefile for i9100
#
PORT_BUILD=/home/jack/patchrom/build
PORT_ROOT=/home/jack/patchrom
# The original zip file, MUST be specified by each product
local-zip-file := stock.zip
# The output zip file of MIUI rom, the default is porting_miui.zip if not specified
local-out-zip-file := MIUI_i9100.zip
# the location for local-ota to save target-file
local-previous-target-dir := ~/workspace/ota_base/i9100_4.1
# All apps from original ZIP, but has smali files chanded
local-modified-apps := LogsProvider Phone MediaProvider Settings
local-modified-jars :=
# All apks from MIUI
local-miui-removed-apps := MediaProvider Stk
local-miui-modified-apps := MiuiHome Settings Phone Mms ThemeManager MiuiSystemUI
# Config density for co-developers to use the aaps with HDPI or XHDPI resource,
# Default configrations are HDPI for ics branch and XHDPI for jellybean branch
local-density := HDPI
include phoneapps.mk
# To include the local targets before and after zip the final ZIP file,
# and the local-targets should:
# (1) be defined after including porting.mk if using any global variable(see porting.mk)
# (2) the name should be leaded with local- to prevent any conflict with global targets
local-pre-zip := local-pre-zip-misc
local-after-zip:= local-put-to-phone
# The local targets after the zip file is generated, could include 'zip2sd' to
# deliver the zip file to phone, or to customize other actions
include $(PORT_BUILD)/porting.mk
# To define any local-target
updater := $(ZIP_DIR)/META-INF/com/google/android/updater-script
pre_install_data_packages := $(TMP_DIR)/pre_install_apk_pkgname.txt
local-pre-zip-misc:
cp other/spn-conf.xml $(ZIP_DIR)/system/etc/spn-conf.xml
cp other/build.prop $(ZIP_DIR)/system/build.prop
#cp stockrom/system/app/FFFFFFFF000000000000000000000001.drbin $(ZIP_DIR)/system/app
#cp -r stockrom/system/app/mcRegistry $(ZIP_DIR)/system/app
rm -rf $(ZIP_DIR)/system/csc
rm -rf $(pre_install_data_packages)
for apk in $(ZIP_DIR)/data/media/preinstall_apps/*.apk; do\
$(AAPT) d --values resources $$apk | grep 'id=127 packageCount' | sed -e "s/^.*name=//" >> $(pre_install_data_packages);\
done
more $(pre_install_data_packages) | wc -l > $(ZIP_DIR)/system/etc/enforcecopyinglibpackages.txt
more $(pre_install_data_packages) >> $(ZIP_DIR)/system/etc/enforcecopyinglibpackages.txt
out/framework2.jar : out/framework.jar
%.phone : out/%.jar
[user=279333]@ECHO[/user] push -- to --- phone
adb remount
adb push $< /system/framework
adb shell chmod 644 /system/framework/$*.jar
#adb shell stop
#adb shell start
#adb reboot
%.sign-plat : out/%
#%.sign-plat : /home/gexudong/libra.jbmiui/out/target/product/maguro/system/app/%
java -jar $(TOOL_DIR)/signapk.jar $(PORT_ROOT)/build/security/platform.x509.pem $(PORT_ROOT)/build/security/platform.pk8 $< $<.signed
[user=279333]@ECHO[/user] push -- to --- phone
adb remount
adb push $<.signed /system/app/$*
adb shell chmod 644 /system/app/$*
So, you have to change:
local-zip-file := stock.zip name of your base rom
PORT_BUILD=/home/jack/patchrom/build to your patch for build folder
PORT_ROOT=/home/jack/patchrom to your root folder
After edit in makefile and save it in patchrom/stock folder you sholud copy from patchrom/build folder these files: porting.mk and phoneapps.mk
you can edit phoneapps.mk too add or delete files which you want.
File structure must look like this:
home
-your_username
-android-sdk-linux:
(-extras
-platform-tools
-platforms
-system-images
-tools)
-patchrom:
(-android
-build
-i9100
-miui
-stock (including: stock.zip - your base rom, makefile edited by you, phoneapps.mk edited by you, porting.mk - copied from build folder)
-tools)
6. Ok, files is prepared, now we can start. Open console and type:
cd patchrom - go to patchrom folder
cd stock - go to stock folder
cd .. - go back
make workspace - this command create temp folder in stock folder, and decompile all necessary files from stock.zip and from miui patchrom, it decompile also files which you add in makefile 'local-modified-apps'
Now in temp you have 5 folders, in reject folder you can resolve any conflicts to prepare necessary files for miui rom.
7. After fixing problems with smali type in console
make firstpatch
this command will apply all rej changes and miui patch for your decompiled files.
8. In console type:
Code:
source build/envsetup.sh
cd stock
make zipfile
Thats all.
If you have problems google it
Don't ask me for anything, use your brain!
Thank you for the information!
I think, you should add a couple of words to help linux newbies.
1. To set $PATH variable you need to edit "bashrc" file.
open terminal, run following command
Code:
gedit ~/.bashrc
gedit is an editor in Ubuntu, you can use any other editor
add to the begining
Code:
export PATH=/home/your_username/android-sdk-linux/platform-tools:/home/your_username/android-sdk-linux/tools:$PATH
save file
reboot to activate changes
test - open terminal, and execute "echo $PATH"
2. You need to generate keys to sign your rom.
http://android-dls.com/wiki/index.php?title=Generating_Keys
can I use this guide to build a miui patch rom for my galaxy nexus toro? which rom do you guys suggest me to use?
Hi,
I just need to ask a few things.
1. How do we know which local apps need to be modified. and which miui apps need to be modified.? I mean is there a pre-defined list or its hit n trial??
I can follow the instructions and run the scripts, but i need to make sure how do we select the criteria for above files. Rest i'll try to figure out myself.
Regards
Yasir
I think a couple of mistakes there are, its make fullota where you have written make firstpatch because make firstpatch will create the temp poster where the 5 folders exist. Once you've fixed the rejects, that's when you make fullota. Also, we don't need PORT_BUILD and PORT_ROOT exports.
MTK Mediatek MIUI
will this work for MTK phones? if yes is it the same process??
rnovino said:
will this work for MTK phones? if yes is it the same process??
Click to expand...
Click to collapse
maybe and you can't use then the i9100 you need to find a phone with compatible hardware or just the phone
Thanks for the guide.
Going to try this out in a few hours, installing Linux in vmware workstation 10 currently
Sent from my GT-I9100 using Tapatalk 4
Need help..
i want to port miui to my mtk phone what are the required files for mtk.......
MTK 6575 - acer z2 JB4.1.1 dual sim
which branch do i used to patching MTK6575 JB4.1.1, JB4.2-MTK or JB4.1-non MTK?
[edit]
basicly as i know, that we have doing is:
- merged Miui framework(smali) to stock framework (smali), right?
- copy lib/etc/xbin ...
- edit bootclasspath if need.
- edit updater-script.
- repack all.
alfan.y said:
which branch do i used to patching MTK6575 JB4.1.1, JB4.2-MTK or JB4.1-non MTK?
[edit]
basicly as i know, that we have doing is:
- merged Miui framework(smali) to stock framework (smali), right?
- copy lib/etc/xbin ...
- edit bootclasspath if need.
- edit updater-script.
- repack all.
Click to expand...
Click to collapse
These pages are a great help. There are many others but start here.
Porting miui to other devices http://en.miui.com/thread-4569-1-1.html
Porting miui cm10.1 based devices http://en.miui.com/thread-6395-1-1.html
Porting miui patchrom guide http://en.miui.com/thread-9630-1-1.html

[Q] How to change default.prop (not build.prop!!!)

I want to change some proprieties of the default.prop(yeah, not build.prop )
(ro.secure=0==>1
ro.debuggable=1==>0
persist.service.adb.enable=1==>0)
But I don't know to change that in Rom 4.2 onwards (I could change it in Kayant's 4.1.1 AOKP Rom by changing /system/bootmenu/config/default.prop but this method don't work on another CM android 4.2 Rom, because of 2ndboot?)
How to change the default.prop (or the corresponding values)?
(Coz the app I want to use is checking those values, and refuses to start if it detects ro.secure=0 or ro.debuggable=1 or persist.service.adb.enable=1)
(I want to move to a new Rom but I have to solve this problem first)

[Q] plz help! How to change default.prop?

I want to change some proprieties of the default.prop(yeah, not build.prop )
(ro.secure=0==>1
ro.debuggable=1==>0
persist.service.adb.enable=1==>0)
But I don't know to change that in Rom 4.2 onwards (I could change it in Kayant's 4.1.1 AOKP Rom by changing /system/bootmenu/config/default.prop but this method don't work on another CM android 4.2 Rom, because of 2ndboot?)
How to change the default.prop (or the corresponding values)?
(Coz the app I want to use is checking those values, and refuses to start if it detects ro.secure=0 or ro.debuggable=1 or persist.service.adb.enable=1)
(I want to move to a new Rom but I have to solve this problem first)
default.prop is in the boot.img
You will need to unpack the boot.img, edit default.prop and then repack it.
This should help.
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
This is something I wouldn't do until its very crucial.
DROID RAZR with Tapatalk 4
Where
neo.ank said:
default.prop is in the boot.img
You will need to unpack the boot.img, edit default.prop and then repack it.
This should help.
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
This is something I wouldn't do until its very crucial.
DROID RAZR with Tapatalk 4
Click to expand...
Click to collapse
I know, but where is boot.omg, I can't find in the zip

build.prop missing in OPR1.170623.026.8.1.10 (Android O)?

Hi,
I recently got my M1 A1 from Elisa, in Estonia(packages says Global Version). I've been looking for a guide to enable camera2 API, and since I'm not interested in root or other functionalities, I figured I could only edit build.prop file in /system with the relevant
Code:
persist.camera.HAL3.enabled=1
line.
My steps so far:
1. Unlock the bootloader.
2.Temporarily boot into TWRP:
Code:
PS C:\platform-tools> .\adb reboot bootloader
PS C:\platform-tools> .\fastboot devices
28833e59 fastboot
PS C:\platform-tools> .\fastboot boot recovery-tissot.img
downloading 'boot.img'...
OKAY [ 0.755s]
booting...
OKAY [ 0.592s]
finished. total time: 1.353s
3. Mount /system from TWRP
4. Try to pull out build.prop:
Code:
PS C:\platform-tools> .\adb pull /system/build.prop c:\platform-tools
adb: error: failed to stat remote object '/system/build.prop': No such file or directory
At this point, I was starting to worry: wrong TWRP, /system was not mounted properly, etc.. But then I tried:
Code:
PS C:\platform-tools> .\adb pull /system/default.prop
/system/default.prop: 1 file pulled. 0.0 MB/s (893 bytes in 0.052s)
...and it worked perfectly:
Code:
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=1
security.perf_harden=1
ro.adb.secure=1
ro.allow.mock.location=0
ro.debuggable=0
ro.oem_unlock_supported=true
ro.zygote=zygote64_32
dalvik.vm.image-dex2oat-Xms=64m
dalvik.vm.image-dex2oat-Xmx=64m
dalvik.vm.dex2oat-Xms=64m
dalvik.vm.dex2oat-Xmx=512m
ro.dalvik.vm.native.bridge=0
dalvik.vm.usejit=true
dalvik.vm.usejitprofiles=true
dalvik.vm.dexopt.secondary=true
dalvik.vm.appimageformat=lz4
pm.dexopt.first-boot=quicken
pm.dexopt.boot=verify
pm.dexopt.install=quicken
pm.dexopt.bg-dexopt=speed-profile
pm.dexopt.ab-ota=speed-profile
debug.atrace.tags.enableflags=0
ro.logdumpd.enabled=0
#
# BOOTIMAGE_BUILD_PROPERTIES
#
ro.bootimage.build.date=Wed Jan 10 14:39:53 WIB 2018
ro.bootimage.build.date.utc=1515569993
ro.bootimage.build.fingerprint=xiaomi/tissot/tissot_sprout:8.0.0/OPR1.170623.026/8.1.10:user/release-keys
persist.sys.usb.config=mtp
So, my question: where does that build.prop live or hides? And can default.prop be used instead for the same purposes as build.prop?
What other steps I've tried so far:
- factory reset(twice);
- full firmware flash with MiFlash(and factory reset after);
- different versions of TWRP(best one from here:https://forum.xda-developers.com/showpost.php?p=75357241&postcount=817 )
Oh, and what I've noticed weird is this message, when invoking adb shell:
Code:
PS C:\platform-tools> .\adb shell
linker: error reading config file "/system/etc/ld.config.txt" for "/sbin/busybox" (will use default configuration): error reading file "/system/etc/ld.config.txt": Too many symbolic links encountered
WARNING: linker: error reading config file "/system/etc/ld.config.txt" for "/sbin/busybox" (will use default configuration): error reading file "/system/etc/ld.config.txt": Too many symbolic links encountered
/system/system/build.prop
You should be interested in root in this case, because whenever you mount the system with write privileges which you do, you loose OTAs. Magisk let you to modify the system systemlessly and whenever you receive OTA, you can install it.
sorry but which is the utility of OPR..?
maross said:
You should be interested in root in this case, because whenever you mount the system with write privileges which you do, you loose OTAs. Magisk let you to modify the system systemlessly and whenever you receive OTA, you can install it.
Click to expand...
Click to collapse
I guess I'll just dirty flash new firmwares with MiFlash . Maybe even restore original build.prop, MiFlash, then modify build.prop again. Rooting sometimes affects some apps, i.e. some banking apps won't install, Neflix won't let you download content, and so on.
sidbyron said:
sorry but which is the utility of OPR..?
Click to expand...
Click to collapse
It's just a naming convension for the firmware filename that Xiaomi uses.
quad_bx said:
I guess I'll just dirty flash new firmwares with MiFlash . Maybe even restore original build.prop, MiFlash, then modify build.prop again. Rooting sometimes affects some apps, i.e. some banking apps won't install, Neflix won't let you download content, and so on.
Click to expand...
Click to collapse
Just use Magisk with Magisk hide feature. You will achieve the same with less effort. Btw. direct modification of system will break Safetynet as far as I know, so you won't be able to install Netflix anyway [emoji846]
_mysiak_ said:
Just use Magisk with Magisk hide feature. You will achieve the same with less effort. Btw. direct modification of system will break Safetynet as far as I know, so you won't be able to install Netflix anyway [emoji846]
Click to expand...
Click to collapse
Well, let's take for example TWRP installation.... The official variant does not work on the last Oreo build(internal storage size is seen as 0, can't install). And for Magisk, I could not find a detailed tutorial to follow.
Anyway, let me see if I can find the hidden build.prop and what happens.
quad_bx said:
Anyway, let me see if I can find the hidden build.prop and what happens.
Click to expand...
Click to collapse
So, I've found it. On the plus side, editing it and re-uploading it did not trip SafetyNet. But... camera2 API is not enabled
I've even managed to edit it twice, in system_a and system_b, same result. Rebooting, clearing the app cache for the apps where I wanted to get RAW shooting did not help either.
I confirm build.prop is in /system/system after mounting it with TWRP.
I can pull it, change it, and push it, but nothing actually changes in the phone.
I confirm that going into "adb shell" generates that error.
Issue is: I DON'T WANT to install Magisk, I DON'T WANT to root.
I want auxiliary tele lens exposed to OpenCamera and gCam porting, and I want Whatsapp forced to use HAL1 specifics (as inner Whatsapp camera brakes after enabling Camera2api).
It means to convert this line:
camera.hal1.packagelist=com.skype.raider,com.google.android.talk
To this
camera.hal1.packagelist=com.skype.raider,com.google.android.talk,com.whatsapp
... and nothing more.
To me it sounds stupid to root, installa Magisk and leave the phone unlocked just to tell Whatsapp to use HAL1.
Also for exposing aux camera, it means to turn:
#Expose aux camera for below packages
vendor.camera.aux.packagelist=org.codeaurora.snapcam,com.android.camera,com.huaqin.factory,com.mi.AutoTest
#add by yaoshaorong for Expose aux camera for D2AO-892 for packagelist can't more than 91 byte
vendor.camera.aux.packagelist2=com.android.systemui
to
#Expose aux camera for below packages
vendor.camera.aux.packagelist=org.codeaurora.snapcam,com.android.camera,com.huaqin.factory,com.mi.AutoTest
#add by yaoshaorong for Expose aux camera for D2AO-892 for packagelist can't more than 91 byte
vendor.camera.aux.packagelist2=com.android.systemui,net.sourceforge.opencamera
But it simply doesn't work.
Is this the right file, or do we need to modify something else?
Dm verity and the related error correction changes your modifications back to the stock build.prop

Categories

Resources