[guide][root] Tweaks Redmi 4x stock ROM - Xiaomi Redmi 4X Guides, News, & Discussion

Hello xda world,
EDIT 24 may 2018: using Luis kernel now on RR 5.8.4. Best I have tried so far!!
Link: http://luis-builds.de/downloads/lineageos/rr/Xiaomi_Redmi_4X_(santoni)/
EDIT 10-feb-2018: battery drain due to *alarm* and *launcher* system wakelocks solved with firmware V32.
Grab it here and flash with TWRP: https://forum.xda-developers.com/xiaomi-redmi-4x/how-to/firmwares-t3682965
Here I hope to collect some tweaks and mods that work in rooted Redmi 4x stock rom. (8.2.10.0 Global)
EDIT: since I use Resurrection Remix now I also added some RR tweaks
Since I just own the device it will be work in progress for a while. I search the forums for solutions for problems I encounter.
My Redmi 4x is OEM unlocked via Xiaomi, has twrp and Magisk root. (you need root for tweaks)
For OEM unlock you need account and register at miui.com, ask for unlock, wait 30+ hours and then use the miui unlock tool that checks if you are granted bij Xiaomi for unlock.
Some Redmi 4x facts:
- Xiaomi Redmi 4x has codename Santoni
- The Soc is Qualcomm 435 (msm8940 socid 313, msm8937 for the firmware), 4 cpu cores perf and 4 cpu cores power
- The gpu is Adreno 505
- main camera is Samsung S5K3L8, front camera is Omnivision ov5675
- notification LED has RGB!
- 5 GHz (11ac) only supported for wifi hotspot (wlan.ko issue)
- MIUI features are setup in the /etc/device_features/santoni.xml file
- CPU/kernel features are mostly setup in the /etc/init.qcom.post_boot.sh file
- fastboot: hold vol- and power, release power after vibrate
- recovery: hold vol+ and vol- and power, release power after vibrate
Redmi 4x related sites:
- Official miui.com for Redmi 4x http://en.miui.com/forum-123-1.html
- Resurrection Remix ROM for Redmi 4x https://sourceforge.net/projects/resurrectionremix/files/santoni/ (Antutu score 43000+)
- Miui EU ROM https://xiaomi.eu/community/forums/miui-weekly-rom-releases.103/
- Mi-Globe ROM (like EU ROM but with options) Mi-Globe
- Miui Belarus (MiuiPro) ROM https://miuipro.by/roms/
- Redmi 4x Global Edition on Bangood
- AOSP Extended (AEX) ROM Redmi 4X http://downloads.aospextended.com/santoni/
Note: If you change any file always make a copy of it first. I always copy the file in the same folder and give it extension .ORG. So build.prop becomes build.prop.ORG with adb shell: cp -p build.prop build.prop.ORG
Be sure the permissions of the files are set to rw-r--r-- (644)!!!!!!
Example adb/linux commands
From pc:
adb push "afile" /sdcard
adb shell
On device:
su
stop
mount -o remount,rw /system
cd "/afolder"
cp -p "afile" "afile.ORG"
cp /sdcard/"afile" .
ls -l "afile*"
chmod 644 "afile"
reboot
Ofcourse afile and afolder are just example names.
If you are not familiar with linux shell or adb then you can find zip files to flash in TWRP mode.
You need to REBOOT after changing any of these files.
Note 2: I am not responsible for any damage to your device. Use this at your own risk!
Audio recording mod (mixer mod)
Recording audio on stock rom is terrible. On the internet I found a solution. You need to change 2 mixer files.
If you also want louder speaker you need to copy /etc/mixer_paths.xml too.
/etc/mixer_paths_qrd_sku1.xml
mic volume for voice call
Code:
<path name="voice-call">
<!-- tweakradje add 2 lines -->
<ctl name="DEC1 Volume" value="88" />
<ctl name="DEC2 Volume" value="88" />
<ctl name="PRI_MI2S_RX_Voice Mixer CSVoice" value="1" />
<ctl name="Voice_Tx Mixer TERT_MI2S_TX_Voice" value="1" />
</path>
mic volume for audio rec like movie, try between 100-124, use 100 for very loud env
Code:
<path name="handset-mic">
<path name="adc1" />
<!-- tweakradje add 2 lines -->
<ctl name="DEC1 Volume" value="110" />
<ctl name="DEC2 Volume" value="110" />
<ctl name="IIR1 INP1 MUX" value="DEC1" />
</path>
mic volume for audio rec like movie, try between 100-124, use 100 for very loud env
Code:
<path name="handset-stereo-dmic-ef">
<!-- tweakradje add 2 lines -->
<ctl name="DEC1 Volume" value="110" />
<ctl name="DEC2 Volume" value="110" />
<path name="speaker-dmic-endfire" />
</path>
/etc/audio_platform_info.xml
Code:
<acdb_ids>
<!-- tweakradje add 2 lines, but no more auto rec mic volume -->
<device name="SND_DEVICE_IN_HANDSET_MIC" acdb_id="1"/>
<device name="SND_DEVICE_IN_HANDSET_STEREO_DMIC" acdb_id="1"/>
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED" acdb_id="136"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED" acdb_id="136"/>
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT" acdb_id="136"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED_VBAT" acdb_id="136"/>
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK" acdb_id="137"/>
</acdb_ids>
Now audio is fine when recording video and sounds even great!
You can download the 2 files below. Check if you need to insert these lines in your file or that you can use mine.
For recording stereo audio only I use Sony Audio Recorder which is free and perfect.
EDIT 18 dec 2017: Found that acdb_id="4" works well, which is the default mic profile in ACDB. However you need to lower the "DEC1 Volume" and "DEC2 Volume" to 94.
EDIT 23 dec 2017: About Audio Calibration (ACDB) files
You might have noticed that there are more than one set of acdb file in /etc/acdbdata folder. There are MTP end QRD sets. QRD stands for Qualcomm Reference Design. You can play with these Calibration Profiles for speakers and microphone.
Easiest is to create a new build.prop (644) in the /vendor folder.
Then play with these values. You can also mix MTP and QRD for devices. Like using all MTP but for General and Handset use the QRD version.
Code:
persist.audio.calfile0=/etc/acdbdata/QRD/QRD_Bluetooth_cal.acdb
persist.audio.calfile1=/etc/acdbdata/QRD/QRD_General_cal.acdb
persist.audio.calfile2=/etc/acdbdata/QRD/QRD_Global_cal.acdb
persist.audio.calfile3=/etc/acdbdata/QRD/QRD_Handset_cal.acdb
persist.audio.calfile4=/etc/acdbdata/QRD/QRD_Hdmi_cal.acdb
persist.audio.calfile5=/etc/acdbdata/QRD/QRD_Headset_cal.acdb
persist.audio.calfile6=/etc/acdbdata/QRD/QRD_Speaker_cal.acdb
#persist.audio.calfile0=/etc/acdbdata/MTP/MTP_Bluetooth_cal.acdb
#persist.audio.calfile1=/etc/acdbdata/MTP/MTP_General_cal.acdb
#persist.audio.calfile2=/etc/acdbdata/MTP/MTP_Global_cal.acdb
#persist.audio.calfile3=/etc/acdbdata/MTP/MTP_Handset_cal.acdb
#persist.audio.calfile4=/etc/acdbdata/MTP/MTP_Hdmi_cal.acdb
#persist.audio.calfile5=/etc/acdbdata/MTP/MTP_Headset_cal.acdb
#persist.audio.calfile6=/etc/acdbdata/MTP/MTP_Speaker_cal.acdb
MIUI Camera mod (features unlock)
This is how you unlock those high end features you find on higher end models. To enable the features you need to edit the /etc/device_features/santoni.xml (or /sdcard/device_features/santoni.xml) file. Mostly change false into true to enable them.
Some are also added from other Xiaomi devices.
Download from below.
Camera parameters found:
Code:
support_camera_4k_quality
support_camera_age_detection
support_camera_aohdr
support_camera_audio_focus
support_camera_boost_brightness
support_camera_burst_shoot
support_camera_gradienter
support_camera_hfr
support_camera_manual_function
support_camera_movie_solid
support_camera_peaking_mf
!support_camera_press_down_capture
support_camera_quick_snap
support_camera_record_location
support_camera_shader_effect
support_camera_skin_beauty
support_camera_tilt_shift
support_camera_torch_capture
support_camera_ubifocus
support_camera_video_pause
support_camera_water_mark
Camera 2 API
You can enable Camera 2 API for 3rd party camera apps. Think about manual focus etc.
Add this line to your build.prop:
persist.camera.HAL3.enabled=1
More interesting Camera's: https://forum.xda-developers.com/mi-5/themes/app-collection-camera-modded-t3591177
Better (modded) MIUI Camera
From my friends at 4pda. Much better camera at low light. Also JPEG quality set to 98.
http://4pda.ru/forum/index.php?showtopic=793497&view=findpost&p=57013739
Flash zip in twrp (backup of original camera is made by script)
If you want to do it manualy:
- take the MiuiCamera.apk from the zip
- adb push MiuiCamera.apk /sdcard/
- adb shell
- su
- mount -o remount,rw /system
- cd /system/priv-app/MiuiCamera
- mv MiuiCamera.apk MiuiCamera.apk.ORG
- mv oat oat.ORG
- cp /sdcard/MiuiCamera.apk .
- chmod 644 MiuiCamera.apk
- ls -l
- stop
- sync
- reboot
Enable Dalvik JIT (Android 6)
Add this line to your build.prop file:
debug.usejit=true
When cleaning the dalvik cache your phone will boot much faster. Don't have to wait for 5 or 10 minutes anymore
Test Color Notification Led
See here: http://en.miui.com/thread-605570-1-1.html
EDIT 15 sep 2017:
Color Notification led support: http://en.miui.com/thread-850569-1-1.html
or at the source: http://4pda.ru/forum/index.php?showtopic=841683&st=0#entry64978644
Change MIUI theme and launcher
You can change variables of the package (apk) using MIUI themes. But you can also change the default theme.
The default theme is located at /system/media/theme/default
Changes to the MIUI Launcher (home screen) can easily made. It is a zip file (com.miui.home.zip) with a theme_values.xml in it. Change or add values to the xml file, copy it to /system/media/theme/default/com.miui.home and reboot.
Note that the zip has no extension when you copy it to the folder!!! It must have the name of the package.
Below you find an example of a 5x6 launcher grid. If you want to know more better search google with MIUI_Theme_Values
You can do this for example also with MiuiSystemUI.apk (com.android.systemui) and many more
Alternative CPU core control
There are 4 performance cpu's (cpu 0123) and 4 powersave cpu's (cpu 4567). Depending on the task load they increase or decrease their cpu frequency. But they can also switch on or off. Default 2 perf cores and all 4 power cores stay on.
I modified the /etc/init.qcom.post_boot.sh script for the purpose that only 1 perf and 1 power core stay on with no task load. This consumes less power and increases battery life.
Copy init.qcom.post_boot.sh.txt to /etc/init.qcom.post_boot.sh and reboot. Don't forget to make a copy.
Code:
echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus
### power cluster min 1 cpu max 4, busy up/down from 0000 to 68 and 40, perf cluster up like 80+
### prefer (low-)power cores cpu4567 up before perf cores cpu0123 (high power consumtion)
echo "80 85 90 95" > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres #68, only looks at 1st value
echo 68 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres
echo 40 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres
### Wait x ms before switching core off, you might need it again
echo 500 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms #100 (test .5 sec)
echo 500 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms #100 (test .5 sec)
Resurrection Remix strange adb shell prompt
Change /etc/mkshrc, comment last 3 lines
Code:
}$HOSTNAME:${PWD:-?} '"$PS1 "
#if [ "z$ANDROID_SOCKET_adbd" != "z" ]; then
# resize
#fi
Force battery charge to 90%
Code:
# Charge only up to 89% instead of 100% for longer battery life? cat /sys/class/power_supply/battery/voltage_now
echo 4260 > /sys/class/power_supply/battery/voltage_max # 4400 (nominal 3.85V)
My additions to build.prop (/vendor/build.prop)
This is my current /vendor/build.prop and the big advantage is that you can leave your ROM's /system/build.prop as it is. The /vendor/build.prop will overwrite settings from /system/build.prop!
High wakelock with low signal data connection? Try this in build.prop
ro.ril.wake_lock_timeout=2000
Ps: Check for property errors direct after reboot with: dmesg | grep prop
Code:
### always check values with "dmesg | grep prop"
### /default.prop
### /system/build.prop
### /vendor/build.prop (*)
### /factory/factory.prop
### /data/local.prop
### tweakradje RR 5.8.4/5
lockscreen.rot_override=true
#ro.radio.noril=true
# dumpsys SurfaceFlinger will give 1920x1200 density of 295 dpi
#ro.sf.lcd_density=295
#30% faster app loading?
sys.use_fifo_ui=1
# pm multitask def = 6
persist.pm.multitask=8
#ro.recents.grid=true
ro.cutoff_voltage_mv=3200
ro.config.swap=false
ro.config.zram=false
ro.sys.sdcardfs=true
ro.ril.wake_lock_timeout=2000
persist.radio.aosp_usr_pref_sel=true
#ro.audio.offload_wakelock=true (default)
#audio.offload.ignore_setawake=false (default)
#opengl 3d hw accel
debug.egl.hw=1
# hw compositing, if 0 then always software
debug.sf.hw=1
#sys.hwc.gpu_perf_mode=1
### composition valid if debug.sf.hw=0 (and sys.hwc.gpu_perf_mode=0)
#debug.composition.type=c2d
debug.composition.type=mdp
ro.sf.compbypass.enable=0
# use development settings for force gpu
#persist.sys.ui.hw=true
debug.gr.numframebuffers=3
#no debug messages
debug.hwui.level=0
#debug.egl.swapinterval=-1 (def)
#debug.egl.swapinterval=0
#HWUI properties
#ro.hwui.texture_cache_size=72
#ro.hwui.layer_cache_size=48
#ro.hwui.r_buffer_cache_size=8
#ro.hwui.path_cache_size=32
#ro.hwui.gradient_cache_size=1
#ro.hwui.drop_shadow_cache_size=6
###ro.hwui.texture_cache_flushrate=0.4
#ro.hwui.text_small_cache_width=1024
#ro.hwui.text_small_cache_height=1024
#ro.hwui.text_large_cache_width=2048
#ro.hwui.text_large_cache_height=2048
###ro.hwui.fbo_cache_size=32
#debug.hwui.skip_empty_damage=true
#debug.hwui.use_buffer_age=true
#debug.hwui.enable_partial_updates=true
#debug.hwui.render_dirty_regions=true
#debug.hwui.disable_draw_defer=false
#debug.hwui.disable_draw_reorder=true
#debug.choreographer.vsync=false
#debug.choreographer.frametime=false
#debug.choreographer.skipwarning=20
# Use UBWC
###debug.gralloc.map_fb_memory=0
###debug.gralloc.enable_fb_ubwc=1
# 0 = force to enable scrollingCacheEnabled regardless of app setting
# 1 = default is to enable scrollingCacheEnabled unless app specifies
# 2 = default is to disable scrollingCacheEnabled unless app specifies
# 3 = force to disable scrollingCacheEnabled regardless of app setting
persist.sys.scrollingcache=3
ro.config.max_starting_bg=12
#ro.sys.fw.bg_apps_limit=20
ro.config.vc_call_vol_steps=14
ro.config.media_vol_steps=30
#ro.hardware.egl=adreno
#perstist.power.usetwilightadj=true
# JIT Android 6
debug.usejit=true
# JIT Android 7
#dalvik.vm.usejit=true
#dalvik.vm.usejitprofiles=true
#ro.core_ctl_min_cpu=0
#ro.min_freq_0=200000
#ro.min_freq_0=384000
#ro.min_freq_4=384000
### EXTRA CAMERA ###
###https://android.googlesource.com/platform/hardware/qcom/camera/+/9fc7225504a6f969bd7277c1070f0b91b0ce4874/msmcobalt/QCamera2/HAL/QCameraParameters.cpp
###https://android.googlesource.com/platform/hardware/qcom/camera/+/nougat-dev/QCamera2/HAL/QCameraParameters.cpp
persist.sys.camera-sound=0
persist.camera.HAL3.enabled=1
###https://android.googlesource.com/platform/hardware/qcom/camera/+/f9a41d251fab1320345588e7654a1b0f4c70ae1c/QCamera2/stack/common/cam_types.h
#-persist.camera.hal3.feature=32
### HAL3 High Frame Rate
#-persist.camera.hal3hfr.enable=1
#-persist.camera.hal3.force.hdr=0
#persist.camera.perflock.enable=1
# fps def is 60
persist.camera.disp.fps=30
persist.camera.max.previewfps=30
#persist.camera.pdaf.enable=1
# focus call back (def 1)
#-persist.camera.depth.focus.cb=0
#persist.camera.disp.num_vsync=4
#persist.camera.disp.ms_to_vsync=2
#persist.camera.disp.filter_max=2
#persist.camera.disp.filter_min=4
# thumbnail needed
#-persist.camera.tn.disable=0
# anti banding 0 1=auto 2=50Hz 1=60Hz
#persist.camera.set.afd=2
# 0=disable 1=with aggressive AEC 2=with fast AEC
#-persist.camera.instant.capture=2
#-persist.camera.instant.aec=2
#persist.camera.dt=0
#persist.camera.vc=0
### adb shell setprop persist.camera.effect <effect>
### none,mono,negative,solarize,sepia,posterize,whiteboard,blackboard,aqua,emboss,sketch,neon,beauty
#persist.camera.effect=none
### check for raw images /data/misc/camera folder!
#persist.camera.raw.dump=0
#persist.camera.raw.debug.dump=0
# raw format 16(yuv?) 17 or 18
#persist.camera.raw.format=17
#persist.camera.raw.subformat=
#persist.camera.raw_yuv=0
#persist.camera.zsl_raw=0
#persist.camera.snapshot_raw=20
# nr buffers, adb shell setprop persist.camera.preview_yuv 20 <20 preview buffers>
#persist.camera.preview_yuv=0
#persist.camera.preview_raw=0
#persist.camera.video_raw=0
# raw data i? mode
#persist.camera.rdi.mode=disable
#persist.camera.offlineraw=0
### manual exposure, enables persist.camera.exposure.time
#persist.camera.manual.capture=1
### adb shell setprop persist.camera.exposure.time "exposure time" (in millisec) 10 = 1/100
#persist.camera.exposure.time=10
#persist.camera.initial.exp.val=10
# 1=CAM_ISO_MODE_DEBLUR 100 200 ...
#persist.camera.iso=1
#persist.camera.continuous.iso=100
#correlated double sampling mode on off auto(def) (noise reduction)
#persist.camera.CDS=on
#persist.camera.video.CDS=auto
# TemporalDenoise (Supported at all?)
#persist.camera.tnr_cds=1
#persist.camera.tnr.snapshot=on
#persist.camera.tnr.video=on
#persist.camera.tnr.preview=on
# Low light noise feature is to avoid noise seen at the snapshot frame edges due to WNR processing
#persist.camera.llnoise=0
# low light capture
#persist.camera.llc=1
# 0=CAM_WAVELET_DENOISE_YCBCR_PLANE
# 1=CAM_WAVELET_DENOISE_CBCR_ONLY
# 2=CAM_WAVELET_DENOISE_STREAMLINE_YCBCR
# 3=CAM_WAVELET_DENOISE_STREAMLINED_CBCR
#persist.denoise.process.plates=2
#persist.tnr.process.plates=2
#persist.camera.tintless=enable
# Burst LED on period 1-799 def 300
#persist.camera.led.on.period=150
#persist.camera.secure.mode=disable
#camera.lowpower.record.enable=1
#cpp or vfe scaling
#persist.camera.pp_scaling=0
#persist.camera.ltmforseemore=1
#persist.camera.preview.seemore=1
#persist.camera.liveshot.size=1280x720
#persist.camera.stats.af.paaf=1
#persist.camera.preview.ubwc=1
# high temp? then lower fps (or frameskip)
persist.camera.thermal.mode=fps
#persist.camera.batchcount=0
#persist.camera.video.batchsize=6
#persist.camera.opt.livepic=1
# Chromatic Aberation enabled? Check logcat grep -i chroma
# E mm-camera: <IMGLIB><ERROR> 695: module_cac_handle_aec_update: module_cac_handle_aec_update 695: Invalid chromatix ptr
#persist.camera.feature.cac=1
persist.camera.eis.enable=1
# preferred IS type for 8937 is IS_TYPE_DIS i.e, 1
# IS_TYPE_NONE=0, IS_TYPE_DIS=1, IS_TYPE_GA_DIS=2, IS_TYPE_EIS_1_0=3, IS_TYPE_EIS_2_0=4 IS_TYPE_MAX=5
persist.camera.is_type=4
persist.camera.is_type_preview=4
#CAMERA_LONGSHOT_STAGES=4
#persist.camera.longshot.stages=1
#persist.camera.longshot.max=5
#persist.camera.longshot.shotnum=5
#persist.camera.longshot.save=0
# use jpeg burst if persist.camera.longshot.save=0
#persist.camera.jpeg_burst=1
### Check whether shutter should be triggered immediately after capture
persist.camera.feature.shutter=1
#persist.camera.facedetect=1
#persist.camera.snapshot.fd=1
# face detect in video 0 1 2(only for focus)
#persist.camera.fdvideo=1
#persist.camera.mem.usepool=1
# video shooting ION cache, disable for faster shooting
persist.camera.mem.usecache=0
persist.sys.exif.make=Xiaomi
persist.sys.exif.model=Redmi 4X Tweakradje
#persist.camera.auto.hdr.enable=enable
### dual camera range finding
persist.camera.dcrf.enable=0
### multi_pass cause 3/4 green effect when zoomin
persist.camera.multi_pass=0
#persist.camera.zsl.mode=1
#persist.camera.zsl.interval=1
#persist.camera.zsl.backlookcnt=2
#persist.camera.zsl.queuedepth=2
#persist.camera.zsl.buffer.size=
# zigzag hdr
#persist.camera.hdr.outcrop=enable
persist.camera.zzhdr.enable=1
persist.camera.zzhdr.video=1
# disable UBWC (universal bandwidth compression) if enable eztune
#debug.gralloc.gfx_ubwc_disable=0
#persist.camera.eztune.enable=0
#persist.camera.perf.memlimit=0x800
#persist.camera.capture.animate=1
camera.qcom.misc.disable=0
persist.ts.rtmakeup=0
#persist.camcorder.4k.nolimit=1
#persist.camcorder.eis.maxfps=30
#debug.camera.yv12=true
#debug.camera.preview.flip=90
#debug.camera.video.flip=90
#debug.camera.picture.flip=90
#ClearSight? settings
#persist.camera.cs.threshold=0xf4240 clearsight threshold (long)
#persist.camera.cs.burstcount=4
#persist.camera.cs.dumpframes=0
#persist.camera.cs.timeout=0x12c
#ro.miui.screen_layout_size=3
#ro.sys.oosenhance.enable=true
#ro.sys.oosenhance.timer=2000
#debug.oosenhance.turnon=true
### EXTRA AUDIO ###
# resampler DEFAULT=0
# OLD values LOW_QUALITY=1(1st order) MED_QUALITY=2(3rd order) HIGH_QUALITY=3(fixed multi-tap FIR) 4 VERY_HIGH_QUALITY
# 1-3 AudioResampler: Assertion failed: format != AUDIO_FORMAT_PCM_16_BIT /system/lib/libaudioresampler.so (_ZN7android14AudioResampler6createE14audio_format_tiiNS0_11src_qualityE+1024)
# Using the new DYN_*_QUALITY resamplers (modes 5-7) allows floating point audio to work. 8 works too
af.resampler.quality=7
# cat /proc/asound/card0/id -> msm8920sku7sndc -> /etc/acdbdata/QRD/msm8920-sku7-snd-card
### QRD (Qualcomm Reference Design) or MTP Audio Calibration files?
#persist.audio.calfile0=/etc/acdbdata/MTP/MTP_Bluetooth_cal.acdb
#persist.audio.calfile1=/etc/acdbdata/MTP/MTP_General_cal.acdb
#persist.audio.calfile2=/etc/acdbdata/MTP/MTP_Global_cal.acdb
#persist.audio.calfile3=/etc/acdbdata/MTP/MTP_Handset_cal.acdb
#persist.audio.calfile4=/etc/acdbdata/MTP/MTP_Hdmi_cal.acdb
#persist.audio.calfile5=/etc/acdbdata/MTP/MTP_Headset_cal.acdb
#persist.audio.calfile6=/etc/acdbdata/MTP/MTP_Speaker_cal.acdb
# calibrate speaker duration (0) if spk prot true
persist.speaker.prot.enable=false
#persist.spkr.cal.duration=50
# audio, offload to audio hardware
audio.offload.disable=false
audio.offload.buffer.size.kb=256
av.streaming.offload.enable=true
audio.offload.multiple.enabled=true
ro.audio.max_fast_tracks=8
ro.audio.flinger_standbytime_ms=500
audio_hal.period_multiplier=2
#audio_hal.period_size=192
audio_hal.in_period_size=50
#Qualcomm Immersive Audio Noise Cancellation (Fluence), Pro is quadmic
#ro.qc.sdk.audio.fluencetype=fluencepro
#ro.qc.sdk.audio.fluencetype=fluence
#ro.qc.sdk.audio.fluencetype=none
#persist.audio.fluence.voicecall=true
#persist.audio.fluence.audiorec=false
persist.audio.fluence.mode=endfire
#persist.audio.fluence.mode=broadside
#rec.playback.conc.disabled=false
#surround recording
ro.qc.sdk.audio.ssr=false
# dump recording /data/misc/audio/ssr_input_3ch.pcm
#ssr.pcmdump=true
# acdb full freq spectrum on speakers ACDB 131
# persist.audio.FFSP.enable=true -> gives acdb error in logcat!!!
# native audio?
audio.nat.codec.enabled=true
persist.audio.hifi.int_codec=true
# active noise cancelation
#persist.aanc.enable=1
#persist.headset.anc.type=
#persist.audio.vbat.enabled=true
#libdirac.so also /vendor/etc/diracmobile.config
audio.dirac.logging=0
#persist.audio.dirac.headset=5
#persist.audio.dirac.eq=
#persist.audio.dirac.music.state=0
# not complete lib files to enable dirac in RR
persist.audio.dirac.speaker=false
#
use.dts_eagle=false
persist.bt.max.hs.connections=4
persist.bt.max.a2dp.connections=4
persist.bt.enableAptXHD=true
persist.service.bt.a2dp.sink=false
#ro.bluetooth.hfp.ver=1.5
#ro.bluetooth.hfp.ver=1.6
ro.bluetooth.hfp.ver=1.7
#persist.bluetooth.disableabsvol=true
#wc_transport.force_special_byte=true
#bt.pts.certification=true
audio.dolby.ds2.enabled=false
audio.dolby.ds2.hardbypass=true
### EXTRA NETWORK ###
ro.net.dns_cache_size=1500
net.dns.cache_size=1500
net.dns.cache_ttl=1800
net.http.threads=20
net.dns2=8.8.8.8
### EXTRA SQLITE ###
# find /data/data \( -name *-journal -o -name *-wal -o -name *-shm \) -exec rm {} \;
#debug.sqlite.journalmode=DELETE
#debug.sqlite.syncmode=FULL
#debug.sqlite.pagesize=
#sqlite Write Ahead Logging on? creates big WAL files and shm (shared mem) files, log 512KB
debug.sqlite.journalmode=WAL
debug.sqlite.wal.autocheckpoint=0
debug.sqlite.wal.syncmode=FULL
debug.sqlite.journalsizelimit=524288
#debug.sqlite.wal.poolsize=
If you have more interesting mods don't hesitate to post them and I will add them to the OP.
EDIT 5 sep 2017: added new RR init script (v2), better CPU cores and audio !!! v2 might cause battery drain, then v3
EDIT 8 sep 2017: added /etc/wifi/WCNSS_qcom_cfg.ini for 40 Mhz channel on 2.4Ghz
added new RR init script (v3) for better battery life
EDIT 15 oct 2017: removed mixer_paths.xml, use stock. Changes applied to new mixer_paths_qrd_sku1.xml
EDIT 21 oct 2017: added V4 for RR, better target_loads for big/little CPU's
EDIT 31 oct 2017: added V5 for RR, better big perf/little lowpower cpu switching. Perf cpu minimal is 0. Most tasks done with lowpower cpu's. Can run youtube for almost 11 hours now!
EDIT 4 nov 2017: Noticed one little error in V5 RR script.
Echo Y > /sys/module/workqueue/parameters/power_efficient
should be
echo Y > /sys/module/workqueue/parameters/power_efficient
EDIT 16 nov 2017: V6 RR script. Optimal use of RAM. Tested for 3 GB only. All apps stay in ram. Almost no swapping. Example, Chrome keep tabs without reloading. Antutu score now 46350!
EDIT 20 nov 2017: V7 RR script. Create 512 MB ZRAM swap if RAM < 2GB and don't lower swappiness (only for 3 GB)
Little change for V7 script:
### tweakradje use small cores to the max before switch to big cores (antutu only 35000 instead of 46000)
echo 0 > /dev/cpuctl/cpu.upmigrate_discourage
EDIT 23 nov 2017: added stereo recording in AAC with Redmi 4X (speakers cyburg needles with Tangband w3-881sjf https://www.youtube.com/watch?v=MsgAFoTghvw )
EDIT 2 dec 2017: little corrections in V7 RR script and changed to flashable zip.
EDIT 6 jan 2018: change emmc max freq from 200 to 300 MHz. Increase the read speed from 80Mb/s to 120 Mb/s (note: you can try 400 or 500 Mhz. Might cause reboot, please report back) Test with busybox hdparm -tT /dev/block/mmcblk0p49
EDIT 13 feb 2018: V9 of the script. Added tweaked deviceidle (doze) settings. Device looses 0-1% overnight!
EDIT 15 feb 2018: V10 of the script. Improved Light/Deep Doze settings with documentation in the script. Put your email app in the whitelist too!!!
EDIT 18 feb 2018: V11 ready. Won battle with Google Play Services that reset the device_idle_constants to "null" every few hours. Solution: pm disable --user 0 com.google.android.gms/.phenotype.service.sync.PhenotypeConfigurator
Doze settings and explanation are in the script for those who want to change some timings. The script sets it to this scheme:
- Enter light doze after screen off
- Light maintenance windows every 5 minutes
- Enter Deep doze after 15 minutes (enter deep if there is no alarm within 5 minutes from now, was 1 hour)
- Deep maintenance windows every hour
- Whatsapp and Gmail white listed (can do their thing regardless of doze state)
- No delays for phone motion or whatever
EDIT 8 mar 2018: updated some audio related files with comments in it. Change to your liking , now awesome high quality good calibrated stereo sound recording!!
EDIT 6 apr 2018: V13 of the init script. Changed things like min/max cpu speed for custom kernel
EDIT 9 apr 2018: flashable scripts now create backup of replaced files if not exist. (*.ORG)
EDIT 25 may 2018: V15 of the init script for 7.x Nougat ROMs.
EDIT 16 jun 2018: V16 of the init script for 7.x Nougat ROMs (LAST AND FINAL!)
Cheers

PLEASE don't quote first post. Waste of space and it will change anyway. THANKS
Data partition is encrypted
I found that the data partition is encrypted when coming from Miui ROM to RR. Fingerprint is not working with encrypted data partition.
Data is encrypted if TWRP asks for unlock code.
These steps decrypts it and preserves data.
Code:
- Boot into TWRP
- Backup /data to "internal sd" (or to "ext sd card") with TWRP
- On PC: adb pull /data/media/0
- Wipe -> Format /data in TWRP
- Reboot to TWRP again
- On PC: adb push . /data/media/0
- On PC: adb shell chown -R media_rw.media_rw /data/media/0
- Reboot to TWRP again
- Restore the previous backup with TWRP
- On PC: adb shell rm /data/system/locksettings* /data/system/*.key
- On PC: adb shell rm -r /data/dalvik*
- Reboot
Change Doze (deviceidle) settings
On the device you can change the Doze settings very easy. First list the Doze settings to get all current parameters:
Code:
dumpsys deviceidle
Then change parameters by setting some variables in the Android Global Settings db:
Code:
settings put global Phenotype_flags device_idle_constants
settings put global device_idle_constants inactive_to=300000,idle_after_inactive_to=300000
Enable light doze too (mLightEnabled=true mDeepEnabled=true)
Code:
dumpsys deviceidle enable all
Add whatsapp and gmail to the whitelist
Code:
dumpsys deviceidle whitelist +com.whatsapp +com.google.android.gm
Note: Google Play Services reset the device_idle_constants to "null" every few hours. Solution: pm disable --user 0 com.google.android.gms/.phenotype.service.sync.PhenotypeConfigurator
See more info in post above
Use Fingerprint sensor as button
As you might know hardware keys have keycodes. These keycodes can be found using an app like KeyEvent Dipslay
The mapping between Keycode and Function is done in the kl files in the folder /system/usr/keylayout
To map the Fingerprint key (Keycode 353) you use the gf3208.kl file.
Code:
#key 353 ENTER
#key 353 CAMERA
#key 353 MENU
key 353 SLEEP
Reboot for effect. This will not effect the Fingerprint function.
Super audio for Resurrection Remix
To enable HD audio for headphones and other audio tweaks for RR (maybe for Miui too)
Add these lines to the end of your build.prop
Code:
audio.offload.disable=false
audio.offload.buffer.size.kb=1024
persist.audio.FFSP.enable=true
audio.nat.codec.enabled=true
persist.audio.hifi.int_codec=true
persist.audio.dirac.speaker=false
use.dts_eagle=true
Some tweaks for camera driver
To enable some extra features to play with. You can add these to the end of your build.prop
For the stock camera on RR ROM make sure you disable Color Denoise setting.
Code:
#persist.camera.liveshot.size=1280x720
persist.camera.HAL3.enabled=1
persist.camera.hal3hfr.enable=1
persist.camera.ltmforseemore=1
persist.camera.led.on.period=500
persist.camera.stats.af.paaf=1
persist.camera.manual.capture=1
# high temp? then lower fps (or frameskip)
persist.camera.thermal.mode=fps
persist.camera.opt.livepic=1
# Chromatic Aberation enabled? Check logcat grep -i chroma
# E mm-camera: <IMGLIB><ERROR> 695: module_cac_handle_aec_update: module_cac_handle_aec_update 695: Invalid chromatix ptr
persist.camera.feature.cac=1
persist.camera.eis.enable=1
persist.denoise.process.plates=2
persist.camera.longshot.stages=1
persist.camera.facedetect=1
persist.camera.snapshot.fd=1
# face detect in video 0 1 2(only for focus)
persist.camera.fdvideo=1
persist.camera.mem.usepool=1
persist.camera.mem.usecache=5000000
persist.sys.exif.make=Xiaomi
persist.sys.exif.model=Redmi 4X
persist.camera.feature.shutter=1
persist.camera.auto.hdr.enable=1
persist.camera.tintless=1
#persist.camera.continuous.iso=200
#persist.camera.exposure.time=
# dual camera range finding
persist.camera.dcrf.enable=0
persist.camera.multi_pass=1
persist.camera.zsl.mode=1
persist.camera.zsl.interval=1
persist.camera.zsl.backlookcnt=2
persist.camera.zsl.queuedepth=2
# zigzag hdr
persist.camera.zzhdr.enable=1
persist.camera.zzhdr.video=1
persist.camera.eztune.enable=0
# TemporalDenoise (Supported at all?)
persist.camera.tnr_cds=1
persist.camera.tnr.snapshot=1
persist.camera.tnr.video=1
persist.camera.tnr.preview=1
# low light noise enabled?
persist.camera.llnoise=1
More will follow

oke thanks
Sipppp

Mine has rgb led. See led test script in OP. But even in RR rom it is not suported. Pitty. Perhaps support will come later. I've seen users with tasker scripts to make it work.

Very thanks for the cpu control you have created, my backup is now nearly +30% thanks again and also for camera mod keep up the good work:good:

Abugk said:
Does this redmi 4x has RGB LED . Can you please confirm it ?
From these screenshots I'm assuming that it has a RGB LED . How can I enable it ?
Click to expand...
Click to collapse
Easiest way to get it is install camera mod.
For just led colors, change the line on /system/etc/device_features/santoni.xml
Code:
<bool name="support_led_color">[B]true[/B]</bool>

Wow. Great work... cant wait to try these one too. Thanks

Hi, how can I use your CPU cores tweak in MIUI 9?
Thanks!

You can take the RR version. Make copy of your original file first!
Cheers

Anyone running RR with my V2 script having battery drain issues? I have since yesterday.
I am now running new script to test battery drain. The change is to disable all these
low power modes again. Lets see tomorrow.
Oh and if you see the notification led blinking purple after reboot? The V3 script switches it
off again after 3 sec.

Can everything here useful for any rom with nougat or just RR?

Not everything. A lot is MIUI related.
Except the things that are qualcomm related like xml files and init files.
RR files are for nougat in general.
But always make a copy of your original file first!!!

can u make text percentage only mod for miui9 global. this option is present in miuipro

tweakradje said:
Not everything. A lot is MIUI related.
Except the things that are qualcomm related like xml files and init files.
RR files are for nougat in general.
But always make a copy of your original file first!!!
Click to expand...
Click to collapse
So , that means ,these tweaks can be used in miui9???

Sure. Make copy first so that you can always go back to original.

tweakradje said:
Anyone running RR with my V2 script having battery drain issues? I have since yesterday.
I am now running new script to test battery drain. The change is to disable all these
low power modes again. Lets see tomorrow.
Oh and if you see the notification led blinking purple after reboot? The V3 script switches it
off again after 3 sec.
Click to expand...
Click to collapse
Me too, mine dropped 10% after a night with wifi and data off.
I'm on RR build 170815.

Thanks for the feedback. I use v3 of the script now for 2 days and battery is perfect. Try it. After install switch off the phone completely ( no reboot ) and then switch it on again. It worked for me.

tweakradje said:
Thanks for the feedback. I use v3 of the script now for 2 days and battery is perfect. Try it. After install switch off the phone completely ( no reboot ) and then switch it on again. It worked for me.
Click to expand...
Click to collapse
How to install it? your cpu Config, Iam using 8.2..10 and have copied the txt to my sh file, i already save it and set to rwrr too, but cpu config still default, even after i restart my phone.. still default config cpu running helpppp

You have to remove the txt extension. Then copy it over existing file. Check permissions and then reboot.
Don't edit file. It has unix EOL in it.

thanks for your advice, i have tried it.. is RRV3 version have same config as default? 2 perf 4 power cpu on?

Related

Boot-Time Auto-SuperLog! [12 Apr 2013]

Boot-Time Auto-Superlog! [12 Apr 2013]
USERS --- TESTERS --- DEVS​Plumb the depths of Middle Droid with Auto-Superlog!​
So…
Your device doesn't finish booting
It reboots on its own (and you may not know it)
An application or feature crashes (and you may not know it)
Generally speaking, any manually-launched app or tool could miss key events leading to random reboot or application crash.
Problem addressed with Auto-Superlog!​
cm10-auto-superlog-v1.0.zip (3MB): http://www.mediafire.com/?cf5f9rq4z7p6gep
This flashable zip is tested working on my Atrix running CWM Recovery 5.0.2.0 and CM10 SuperLite. It should also work on epinter’s CM10 4.1.x builds and on close relatives. Not sure about 4.2.x yet.
In this exciting age of alpha-beta ROM testing, my lightweight Auto-Superlog, presently built on epinter’s versatile CM10 boot image (for demo purposes), can help just about anyone, whether end-user, tester or developer!
In fact it is already helping me track down abnormal battery drain and shutdown problems!
Alternatively instead of flashing the boot-time version, you can extract “auto-superlog.sh” from the flashable zip and manually execute it at run time.
Features
Automatically launches at boot-time under “class_start core” --- just after ROM filesystems are mounted, thus maximizing the likelihood of capturing key events, even if phone does not finish booting
Comprehensive log set includes: system build properties (getprop), kernel configuration file (from /proc/config.gz), kernel dmesg and system logcat --- all in sync, all in ASCII text format, and all stored in a single gzipped, time-stamped tar file on $EXTERNAL_STORAGE/auto-superlog for easy access and analysis.
Android events are quietly, nimbly and continuously streamed via kernel “dmesg” and system “logcat” commands. The dmesg log is pushed at 2-second intervals (default) with a 1MB ring buffer which is cleared on each pass. Logcat is configured to log “main” and “system” events with a generous 10MB buffer to help in discerning error trends.
Access real-time dmesg and logcat output right on your device by tapping the /data/auto-superlog directory using a (root) file explorer.
Log file contents are time stamped using absolute time ([YYYY-]MM-DD HH:MM:SS), enabling users to correlate Android events with the outside world
Filename timestamps show when your system was rebooted
Self-cleaning feature: On reboot, your most recent superlog is gzipped and archived to $EXTERNAL_STORAGE and then is removed from /data/auto-superlog so only your most recent superlog remains on the /data partition.
Shell script: auto-superlog.sh is stored under /system/bin, enabling users to extract and execute it at run-time and/or customize.
How to kill dmesg and logcat? Use the ps and grep commands: http://stackoverflow.com/questions/3117095/stopping-an-android-app-from-console (It’s a sheepish way of saying “mechanization of this feature is still in work” lol)
Instructions
Nandroid Backup current ROM (security blanket)
Flash zip if running epinter CM10 4.1.x or close relative (e.g. SuperLite)
Reboot and relax.
…OR, if you don’t want to flash the zip, but still want the run-time features of auto-superlog, simply extract /system/bin/auto-superlog.sh from zip and do this…
copy auto-superlog.sh to /system/bin (Tip: mount /system/bin as read-write (rw), then revert to ro when done)
chmod 0755 /system/bin/auto-superlog.sh
sh /system/bin/auto-superlog.sh (using Script Manager or other tool, as root)
Click to expand...
Click to collapse
After launching the script, just tap the Home button to resume other activity as the loggers are now running in background. Then you will have real-time streaming dmesg and logcat (as well as getprop and kernel config) at your fingertips --- literally.
The advantage of flashing the zip (if it’s compatible with your ROM) is that you are more likely to capture key events leading to a failed boot, random reboot or application crash.
Screenshots
​
Boot Image Source Code
This is the only change I made to CM10 boot.img...
Code:
ramdisk/init.olympus.rc ...
# sendust7 (12 Apr 2013)
service auto-superlog /system/bin/sh /system/bin/auto-superlog.sh
class core
# class main
# class late_start
user root
group system
# disabled
oneshot
# sendust7 (12 Apr 2013)
Documentation
dmesg: http://unixhelp.ed.ac.uk/CGI/man-cgi?dmesg+8
logcat: http://developer.android.com/tools/debugging/debugging-log.html#outputFormat
Android Encryption: http://source.android.com/tech/encryption/android_crypto_implementation.html
from Android Encryption…"This magic was accomplished by requiring all services to be in 1 of 3 groups: core, main and late_start. Core services are never shut down after starting. main services are shutdown and then restarted after the disk password is entered. late_start services are not started until after /data has been decrypted and mounted.”
Click to expand...
Click to collapse
Thoughts and Ideas: This has been a fun project so far. Time permitting, I may be able to service bug fixes and add more goodies like event filtering.
Disclaimer: Standard disclaimers apply.
Credits:Emerson Pinter (CM10 for Atrix 4g), Cyanogenmod Team
Very nice!
The OS considers the internal SD as EXTERNAL_STORAGE in assigning the env variable which is perhaps the reason you should too:
Booted without external sd mounted:
Code:
[email protected]:/ $ echo $EXTERNAL_STORAGE
/storage/sdcard0
Booted with external sd mounted:
Code:
[email protected]:/ $ echo $EXTERNAL_STORAGE
/storage/sdcard0
Possibly just tweak this part of your script:
Before
Code:
/system/bin/mount -t vfat /dev/block/mmcblk1p1 $EXTERNAL_STORAGE
After
Code:
/system/bin/mount -t vfat /dev/block/mmcblk0p18 $EXTERNAL_STORAGE
This then sends the archive to a location that will always exist (sdcard0).
I mention as I don't always have external SD mounted.
Sent from my MB860 using Tapatalk 2
Thanks sendust7
Good job !

[TWEAKS][build.prop]*[init.d] Performance/Battery for LG's

List of build.prop tweaks for boost performance and for battery life​
Checkout app ^^
Here!​
~~~you can edit build.prop with File explorer that supports ROOT- you can start with File Manager
~~~Find build.prop file in /system
~~~if you have existing line,dont duplicate it (dont duplicate it)
~After you finish edit, save changes, CHECK PERMISSIONS must be -rw-r--r--, rebot to recovery and wipe cache and dalvik-cache ,rebot device
Click to expand...
Click to collapse
Thanks to @F4uzan
I read @LaraCraft304 thread HERE This help me too much
#disable the zygote loader for performance --- Crash, mostly
ro.wmt.blcr.enable=0
#help to free up unused ram --- this dont work on stock,you cant add this if kernel doesn't support purgeable of assets :/
persist.sys.purgeable_assets=1
# Video Acceleration
video.accelerate.hw=1
debug.performance.tuning=1
# Low Power Audio
lpa.decode=false
audio.decoder_override_check=true
use.non-omx.mp3.decoder=false
use.non-omx.aac.decoder=false
# Lock App In Memory
sys.keep_app_1=put-process-name-of-app-here --- Process name can find in /data/data, and put full name here
#battery savers
ro.ril.disable.power.collapse=0
ro.config.hw_power_saving=true
wifi.supplicant_scan_interval=180
power_supply.wakeup=enable
ro.ril.sensor.sleep.control=1
proximity_incall=enable
# Fast Reboot
persist.sys.shutdown.mode=hibernate
ro.config.hw_quickpoweron=true
#Enable Low Ram Device flag
ro.config.low_ram=true --- KITKAT ROMs ALREADY HAVE THIS LINE
#better scrolling
ro.max.fling_velocity=12000 --- this firs line already exist in KITKAT ROMs, I dont know to others (change it from 4000 to 12000)
ro.min.fling_velocity=8000
____but____
ro.maxfling_velocity=4000
ro.max.fling_velocity=4000
(4000 allows for a little more ram)
touch.presure.scale=0.001
windowsmgr.max_events_per_sec= max 90,every value over 90 decreas scroll
ro.min_pointer_dur=8
# Composition type
debug.composition.type=mdp
debug.composition.type=gpu -----choose------best-----you
debug.composition.type=cpu ----------------the--------for
debug.composition.type=dyn
#Dalvik tweaks --- @F4uzan said me: "It doesn't matter if it doesn't exist. Dalvik will set up default value. If you set it, Dalvik will prefer value in build.prop"
because I dont know this ​dalvik.vm.jmiopts=forcecopy --- I dont know what is that.. (someone say me?)
dalvik.vm.dexopt-flags=
Now you can set
~option 1- disable dalvik checking, increases free ram but less optimized dalvik cache
dalvik.vm.verify-bytecode=false
dalvik.vm.dexopt-flags=v=n,u=n,o=v
~option 2 (preferred)- enable more checking for a better performing dalvik cache but may use a little more ram
dalvik.vm.verify-bytecode=true
dalvik.vm.dexopt-flags=v=f,u=n,o=v
dalvik.vm.jit.codecachesize=0 --- this Disable JIT
# Enable Surface Dithering Which Will Raise Image Quality At The Cost Of Performances - 1=ON;0=OFF
persist.sys.use_dithering=0
#disable send data to google
ro.config.nocheckin=1
#Disable Kernel Error Checking
persist.adb.notify=0
vm.stat_interval=1
ro.kernel.android.checkjni=0
I add this to my build.prop, dont need but i prefer
#Enable Adaptive Multi-Rate Wideband
ro.ril.enable.amr.wideband=1
#More volume steps in call
ro.config.vc_call_steps= --- you can set as long as you want |||7 is default||| just put the number after the equal sign
#Better signal.
persist.cust.tel.eons=1
# Signal Tweaks
ro.ril.enable.amr.wideband=1
persist.cust.tel.eons=1
ro.config.hw_fast_dormancy=1 --- dont use this if your carrier dont support
ro.ril.hsxpa=2
ro.ril.gprsclass=12
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=8
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=6
#Phone rings immediately.
ro.telephony.call_ring.delay=0
ring.delay=0
# Net Speed Tweaks
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.hspa=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.lte=524288,1048576,2097152,524288,1048576,2097152
net.tcp.buffersize.hspda=4096,87380,256960,4096,16 384,256960
net.tcp.buffersize.evdo_b=6144,87380,1048576,6144,87380,1048576
# Google DNS
net.ppp0.dns1=8.8.8.8
net.ppp0.dns2=8.8.4.4
net.dns1=8.8.8.8
net.dns2=8.8.4.4
#Makes streaming videos stream faster
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
media.stagefright.enable-record=true
#Increase photo and video recording quality
ro.media.enc.hprof.vid.bps=8000000
ro.media.capture.maxres=8m
ro.media.panorama.defres=3264x1840
ro.media.panorama.frameres=1280x720
ro.camcorder.videoModes=true
ro.media.enc.hprof.vid.fps=65
# I dont know for what is it, but if your camera dont work on CM10 (I dont know for others) remove this line.
debug.camcorder.disablemeta=1
# Enables 270 Degree Rotation --- In Custom ROMs already have this
windowsmgr.support_rotation_270=true
#Increase jpg quality to 100%
ro.media.enc.jpeg.quality=100
#Better Flashlight intensity & camera-flash quality
ro.media.capture.flash=led
ro.media.capture.flashMinV=3300000
ro.media.capture.torchIntensity=65
ro.media.capture.flashIntensity=70
#Phone rings immediately.
ro.telephony.call_ring.delay=0
ring.delay=0
This tweaks dont work on LG devices, thanks to @F4uzan
pm.sleep_mode won't work
The sleep mode itself is hardcoded to kernel since ICS (or GB, I forgot), so changing it from build.prop won't work.
ro.mot.eri.losalert.delay is for Motorola device
Explained above
ro.config.nocheckin is actually ro.htc.config.nocheckin, so ro.config.nocheckin doesn't exist
Again, explained above
dalvik.vm.execution-mode is JIT, so no need to enable it via build.prop
Uh... explained again
profiler.force_disable_ulog is HTC specific properties
Found in services.jar of HTC ROMs but not on AOSP or LG ROMs
ro.mot.buttonlight.timeout, another properties for Motorola
Everything that starts 'ro.mot', 'ro.htc' won't work with LG phone, something that LG specific is 'lge.' or 'ro.lge'
windowsmgr.max_events_per_sec is a performance degrading thing
As quoted from Google, Android maxes 60fps which is windowsmgr.max_events_per_sec=90 setting it to higher value decreases scroll and touch speed, increase memory usages for UI events and such.
ro.kernel.checkjni, doesn't exist. Not in kernel or even frameworks.
Explained above.
dalvik.vm.checkjni and ro.kernel.android.checkjni won't work.
Already set to false by Android itself
ro.media.dec.jpeg.memcap value is hardcoded
Explained above.
ALL EXPLAINED HERE:
http://www.jeffmixon.com/examining-b...-guide-part-1/
http://www.jeffmixon.com/examining-b...-guide-part-2/
Click to expand...
Click to collapse
init.d tweaks​This init.d tweaks edited by me
You already know the process:
1. Go to recovery
2. Install zip
3. Rebot device
### ATTENTION ###
after flashing this device need about 3 minutes to boot
you do not need to worry, I already have this on my device
Sqlite_optimization
Click to expand...
Click to collapse
Downloads:
zipalign tweak zipalign all apps every 24 hours.
In:
all apps zipaligned
and now usage of this apps in RAM are lesser
Downloads:
View attachment 3133760
Zipalign_24_hours --- thanks to @kien_vip
Click to expand...
Click to collapse
RW_full_speed
Boost Read and Write speed
Downloads:
RW_full_speed
Click to expand...
Click to collapse
Apps for better battery life and performance​
I use apps from playstore
Mediaserver Killer --- This app kills media server to save battery,and expand their life
Battery Doctor --- Also use this to expand your battery life
JuiceDefender - battery saver --- Battery saver app
Greenify --- Use this to hibernate apps
CPU Adjuster --- You can set CPU profiles, overclock device if you have overclock kernel
No-frills CPU Control --- I dont know, but I love this app more
[ROOT] Kernel Tweaker --- GPU, CPU tweaks, LMK
Voltage Control --- Undervolt processor to use less power
Android Tweaker 2 --- Tweak everything
This is cool brother, but I think some lines don't apply with stock roms, like purgeable assets. I will post the source.
chrisdlc119 said:
This is cool brother, but I think some lines don't apply with stock roms, like purgeable assets. I will post the source.
Click to expand...
Click to collapse
If kernel doesnt support this, you cannot add :/
Paget96 said:
If kernel dont suport this, you cannot add :/
Click to expand...
Click to collapse
Yes, that's more specific ?
chrisdlc119 said:
Yes, that's more specific ?
Click to expand...
Click to collapse
If you find something else, tell me
When i try to save the edition, its appear a litle box saying that i dont have root acess...but i have x)
What could be ?
jonnybigodesPT said:
When i try to save the edition, its appear a litle box saying that i dont have root acess...but i have x)
What could be ?
Click to expand...
Click to collapse
You have to mount the /system partition using an explorer that supports that function, for example, ES File Manager.
You also can download an app to edit Build.Prop from itself, it's very easy if you already have root access.
chrisdlc119 said:
You have to mount the /system partition using an explorer that supports that function, for example, ES File Manager.
You also can download an app to edit Build.Prop from itself, it's very easy if you already have root access.
Click to expand...
Click to collapse
The problem is solved. I thought I had edited the previous post x)
Thanks mate.
Thx bro i'll use these for my new rom!!!!
Sent from my LG-E400 using XDA Free mobile app
giaki3003 said:
Thx bro i'll use these for my new rom!!!!
Sent from my LG-E400 using XDA Free mobile app
Click to expand...
Click to collapse
now I edit sqlite and zipalign init.d tweak for kitkat
ahh, make for all roms check
Paget96 said:
ahh, make for all roms check
Click to expand...
Click to collapse
Flashed your scripts, device started but after a few hours I noticed that my phone was closed and when I tried to open it, it ended in bootloop. Restored my system backup, everything's fine. So must be your scripts. I think something is wrong with your flash zips. I checked with root explorer and extract the script but Root Explorer shows double file (f.e. 2 METADATA folders, 2 system folders etc.). I checked now in PC but zips seems OK.
I might put some note on build.prop tweaks here :
pm.sleep_mode won't work
The sleep mode itself is hardcoded to kernel since ICS (or GB, I forgot), so changing it from build.prop won't work.
ro.mot.eri.losalert.delay is for Motorola device
Explained above
ro.config.nocheckin is actually ro.htc.config.nocheckin, so ro.config.nocheckin doesn't exist
Again, explained above
dalvik.vm.execution-mode is JIT, so no need to enable it via build.prop
Uh... explained again
profiler.force_disable_ulog is HTC specific properties
Found in services.jar of HTC ROMs but not on AOSP or LG ROMs
ro.mot.buttonlight.timeout, another properties for Motorola
Everything that starts 'ro.mot', 'ro.htc' won't work with LG phone, something that LG specific is 'lge.' or 'ro.lge'
windowsmgr.max_events_per_sec is a performance degrading thing
As quoted from Google, Android maxes 60fps which is windowsmgr.max_events_per_sec=90 setting it to higher value decreases scroll and touch speed, increase memory usages for UI events and such.
ro.kernel.checkjni, doesn't exist. Not in kernel or even frameworks.
Explained above.
dalvik.vm.checkjni and ro.kernel.android.checkjni won't work.
Already set to false by Android itself
ro.media.dec.jpeg.memcap value is hardcoded
Explained above.
References :
http://www.jeffmixon.com/examining-build-prop-tweaks-for-android-ics-a-comprehensive-guide-part-1/
http://www.jeffmixon.com/examining-build-prop-tweaks-android-ics-comprehensive-guide-part-2/
Thanks to Jeff Mixon site.
pkatsaras said:
Flashed your scripts, device started but after a few hours I noticed that my phone was closed and when I tried to open it, it ended in bootloop. Restored my system backup, everything's fine. So must be your scripts. I think something is wrong with your flash zips. I checked with root explorer and extract the script but Root Explorer shows double file (f.e. 2 METADATA folders, 2 system folders etc.). I checked now in PC but zips seems OK.
Click to expand...
Click to collapse
hm, I'll try to fix, thanks for test
sorry for bootloop
F4uzan said:
I might put some note on build.prop tweaks here :
pm.sleep_mode won't work
The sleep mode itself is hardcoded to kernel since ICS (or GB, I forgot), so changing it from build.prop won't work.
ro.mot.eri.losalert.delay is for Motorola device
Explained above
ro.config.nocheckin is actually ro.htc.config.nocheckin, so ro.config.nocheckin doesn't exist
Again, explained above
dalvik.vm.execution-mode is JIT, so no need to enable it via build.prop
Uh... explained again
profiler.force_disable_ulog is HTC specific properties
Found in services.jar of HTC ROMs but not on AOSP or LG ROMs
ro.mot.buttonlight.timeout, another properties for Motorola
Everything that starts 'ro.mot', 'ro.htc' won't work with LG phone, something that LG specific is 'lge.' or 'ro.lge'
windowsmgr.max_events_per_sec is a performance degrading thing
As quoted from Google, Android maxes 60fps which is windowsmgr.max_events_per_sec=90 setting it to higher value decreases scroll and touch speed, increase memory usages for UI events and such.
ro.kernel.checkjni, doesn't exist. Not in kernel or even frameworks.
Explained above.
dalvik.vm.checkjni and ro.kernel.android.checkjni won't work.
Already set to false by Android itself
ro.media.dec.jpeg.memcap value is hardcoded
Explained above.
References :
http://www.jeffmixon.com/examining-build-prop-tweaks-for-android-ics-a-comprehensive-guide-part-1/
http://www.jeffmixon.com/examining-build-prop-tweaks-android-ics-comprehensive-guide-part-2/
Thanks to Jeff Mixon site.
Click to expand...
Click to collapse
i deleted
]windowsmgr.max_events_per_sec when is value over 90 scrolls decreases??
can you help me to add more build.prop tweaks for LGs ??
Yes, decreases. I set this value to 60.
And
ro.min.fling_velocity=16000
ro.max.fling_velocity=20000
mikesa said:
Yes, decreases. I set this value to 60.
Click to expand...
Click to collapse
"Many build.prop tweaks set this value to 300, but it seems this is a bad idea. As Google points out, Android maxes out at 60fps. The default value is already allow for a possible max_events_per_sec of 90. Even if you allow for 300 max_events_per_sec, you’ll only ever see 60 of these events in any given second. Therefore, any value much higher than 90 is unlikely to have any noticeable impact on your experience in general. Additionally, setting this value too high can starve other UI events that need to get processed, viz. touch inputs. You’re not likely to feel like your device is running very smoothly when it is busy processing thousands of scroll events instead of responding immediately to you clicking to try and open a link or an app. There may be some specific scenarios where increasing this value does appear to improve system feedback, but changing this value for all UI events across the board will likely cause more problems than it will solve."
copied from: http://www.jeffmixon.com/examining-build-prop-tweaks-for-android-ics-a-comprehensive-guide-part-1/[/URL
you can go to 90 ]
I tired to 90, but I seems, my phone (Huawei p7) better the 60.
mikesa said:
I tired to 90, but I seems, my phone (Huawei p7) better the 60.
Click to expand...
Click to collapse
yes all mobiles are different
your scripts port from Fly on mod? your zipalign script will run on every boot, not every 30 hours. here is my zipalign script will run every 24 hours and correct permission 644 after zipaligning to avoid bootloop. may be some one like it:
Code:
#!/system/bin/sh
LOG_FILE=/data/zipalign.log;
ZIPALIGNDB=/data/zipalign.db;
# Interval between ZipAlign runs, in seconds, 86400=24 hours
RUN_EVERY=86400
# Get the last modify date of the Log file, if the file does not exist, set value to 0
if [ -e $LOG_FILE ]; then
LASTRUN=`stat -t $LOG_FILE | awk '{print $14}'`
else
LASTRUN=0
fi;
# Get current date in epoch format
CURRDATE=`date +%s`
# Check the interval
INTERVAL=$(expr $CURRDATE - $LASTRUN)
# If interval is more than the set one, then run the main script
if [ $INTERVAL -gt $RUN_EVERY ];
then
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
if [ ! -f $ZIPALIGNDB ]; then
touch $ZIPALIGNDB;
fi;
echo "Starting ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for DIR in /system/app /data/app /system/framework; do
cd $DIR;
for APK in *.apk; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ]; then
echo "Already checked $DIR/$APK" | tee -a $LOG_FILE;
else
ZIPCHECK=`/system/xbin/zipalign -c -v 4 $APK | grep FAILED | wc -l`;
if [ $ZIPCHECK == "1" ]; then
echo "Now aligning $DIR/$APK" | tee -a $LOG_FILE;
/system/xbin/zipalign -v -f 4 $APK /data/local/$APK;
busybox mount -o rw,remount /system;
cp -f -p /data/local/$APK $APK;
chmod 644 $APK;
busybox rm -f /data/local/$APK;
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB;
else
echo "Already aligned $DIR/$APK" | tee -a $LOG_FILE;
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB;
fi;
fi;
done;
done;
busybox mount -o ro,remount /system;
touch $ZIPALIGNDB;
echo "ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
fi;

Tweak Klean & Speed

►Tweak Klean & Speed◄​
manual install​
2016, january 24th
Hi, after reading many forums and using the various resource I created a script to optimize all LG L Fino.
Before install check your phone is ROOT HERE.
Drag & Drop, and put a permission.
- Adaware (10 057 ko lite)
etc/ host > 644
- Activated init.d
etc/ install-recovery-2.sh > 755
- Tweaks
etc/ init.d/ *755
_00kleanup > full cleaning at launch - (as usefulness)
_01kernel_panic > disabled kernel panic
_02seeder > optimization
_03vm > tweak vm
_04ksm > configuring KSM
_05zram > activated Zram 256 mo
_06_IO_scheduler > best I/O scheduler line
_07lowmemorykiller > configuring lowmemorykiller
_08remount > remounted
_09zipalign > optimization application
_10sqlite3 > optimization database
_11fstrim > lag trim fix
_12networks > secure and optimize
_13wifi_sleeper > idle wait
_14kill_all > kill all process
- Mod better screen (perf)
lib/ egl/ egl.cfg
1 1 android
0 1 adreno
Click to expand...
Click to collapse
- Associated file
xbin/ 777
sqlite3
zipalign
- Disable MPDecision and use full multicore rename /bin/mpdecision to mpdecision-rm
- Mod your BUILD.PROP
Code:
[B]Modded Sound Tweak[/B]
# Fluencetype can be "fluence" or "fluencepro" or "none"
ro.qc.sdk.audio.fluencetype=fluence
persist.audio.fluence.mode=endfire
persist.audio.fluence.voicecall=true
persist.audio.fluence.voicerec=false
persist.audio.fluence.speaker=true
persist.audio.hp=true
persist.audio.handset.mic=digital
persist.audio.voicecall.mic=0
persist.audio.voice.clarity=none
[B]Added[/B]
# Best Scrolling
persist.sys.scrollingcache=3
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
ro.min_pointer_dur=8
windowsmgr.max_events_per_sec=90
# Disable Checking Data
logcat.live=disable
profiler.force_disable_err_rpt=1
profiler.force_disable_ulog=1
ro.config.nocheckin=1
ro.kernel.android.checkjni=0
ro.kernel.checkjni=0
# Photo & Flashlight Quality
ro.media.capture.flash=led
ro.media.capture.flashMinV=3300000
ro.media.capture.flashIntensity=70
ro.media.capture.torchIntensity=65
- Bootanimation GooGle : link here replace original file.
media / ..644
- Guide :
Delete manualy all Google files to app/*
- without : GoogleCalendarSyncAdapter.apk, GoogleContactSyncAdapter.apk
Delete manualy all Google files to priv-app/*
- without : GmsCore.apk, GoogleBackupTransport.apk, GoogleLoginService.apk, GoogleServicesFramework.apk, Phonesky.apk
Disable all LG services to system/application : xx xx
Enjoy Your ROM is Kustom...
____________________________________
Apps for escort
Root Browser - Sd Maid - Link2Sd (for export but don't extand)
Thank's many dev for the script.
Thanks for that tweak. Do you have experience in building custom roms ? Would be very thankful if u could build one for our device
Hi proudlytm
I'm just sharing work that help, the scripts come from the community work provided on xda. I changed a little, but I have more time to work the Rom. If I find some time I would write a script to flash via recovery.
Did you install, and what do you think the result?
mickael.webmaster said:
Hi proudlytm
I'm just sharing work that help, the scripts come from the community work provided on xda. I changed a little, but I have more time to work the Rom. If I find some time I would write a script to flash via recovery.
Did you install, and what do you think the result?
update 02/12/2015
Before use new script, erase all script.
Click to expand...
Click to collapse
Haven't installed it yet, I might, but my question was if you could make / port CyanogenMod 11 or CyanogenMod 12.1 for our LG L Fino D290N/D295 ?
proudlytm said:
Haven't installed it yet, I might, but my question was if you could make / port CyanogenMod 11 or CyanogenMod 12.1 for our LG L Fino D290N/D295 ?
Click to expand...
Click to collapse
Sorry my function is limited , I think I can without certainty but unfortunately I don't have time. If you test, report me. Thx.
Latest update :
networks tweak and all correctly.
- added bootanimation "GooGle"
Tested on game "Rayman Jungle Run" and "Berry Rush", crazy work.
mickael.webmaster said:
►Tweak Klean & Speed◄​
2015, december 19th
Hi, after reading many forums and using the various resource I created a script to only optimize LG L Fino.
Before install check your phone is ROOT and BUSYBOX either install, use to root browser for :
Drag & Drop, and put a permission.
- Adaware (46 342 ko use only for 1go+ ram)
etc/ host 644
- Activated init.d
etc/ install-recovery-2.sh 755
- Tweaks
etc/ init.d/ ..755
_01kleanup > full cleaning at launch
_02kernel_panic > disabled kernel panic
_03ksm > configuring KSM
_04lowmemorykiller > configuring lowmemorykiller
_05_IO_scheduler > best I/O scheduler line
_06remount > remounted
_07vm > tweak vm
_08zram > activated Zram 256 mo
_09fstrim > lag trim fix
_10zipalign > optimization application
_11sqlite3 > optimization database
_12wifi_sleeper > idle wait
_13networks > secure and optimize
_14kill_all > kill all process
_15seeder > optimization
- force GPU
lib/ egl/ ..644
egl.cfg
libGLES_android.so > rename to libGLES_android.bak
- Associated file
xbin/ 777
sqlite3
zipalign
Disable MPDecision and use full multicore rename /bin/mpdecision to mpdecision-rm
Mod your BUILD.PROP
Code:
[B]Modded[/B]
[I]# Fluencetype can be "fluence" or "fluencepro" or "none"[/I]
ro.qc.sdk.audio.fluencetype=fluence
persist.audio.fluence.mode=endfire
persist.audio.fluence.voicecall=true
persist.audio.fluence.voicerec=false
persist.audio.fluence.speaker=true
persist.audio.hp=true
persist.audio.handset.mic=digital
persist.audio.voicecall.mic=0
persist.audio.voice.clarity=none
[B]Deleted[/B]
[I]# Reduce Background apps limit[/I]
##"ro.sys.fw.bg_apps_limit=20
[B]Added[/B]
# App Home
ro.HOME_APP_ADJ=1
# App Optimization (low reboot)
ro.app.optimization=true
# Best Scrolling
persist.sys.scrollingcache 3
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
ro.min_pointer_dur=8
windowsmgr.max_events_per_sec=90
# Disable Checking Data
logcat.live=disable
persist.adb.notify=0
profiler.force_disable_err_rpt=1
profiler.force_disable_ulog=1
ro.config.nocheckin=1
ro.kernel.android.checkjni=0
ro.kernel.checkjni=0
# Enable JIT
dalvik.vm.jit.codecachesize=1
# Enable Bytecode
dalvik.vm.verify-bytecode=true
dalvik.vm.dexopt-flags=v=f,u=n,o=v
# Enable Hardware Acceleration
ro.config.disable_hw_accel=false
# Enable OpenGL
ro.opengl.off=0
# Enable Surface Dithering (blur effect)
persist.sys.use_dithering=2
# Enable 4x_MSAA
MSAASmoothing=High
MSAABufferAllocation=always
forceMSAAMode=1
MSAAMode=2
# Game tweaks
# unlock fps
persist.tegra.NV_FPSLIMIT=0
#
#
persist.sys.NV_FPSLIMIT=60
persist.sys.NV_POWERMODE=1
persist.sys.NV_PROFVER=15
persist.sys.NV_STEREOCTRL=0
persist.sys.NV_STEREOSEPCHG=0
persist.sys.NV_STEREOSEP=20
# More RAM
persist.service.pcsync.enable=0
persist.service.lgospd.enable=0
# Photo & Flashlight Quality
ro.media.capture.flash=led
ro.media.capture.flashMinV=3300000
ro.media.capture.flashIntensity=70
ro.media.capture.torchIntensity=65
# Quality Of Media Streaming
media.stagefright.enable-meta=true
media.stagefright.enable-rtsp=true
# Storage USB
ro.usbstorage.cpumode=performance
bootanimation GooGle : link here replace original file.
media / ..644
____________________________________
Apps for escort
Root Browser - Sd Maid - Link2Sd (for export but don't extand)
Thank's many dev for the script.
Click to expand...
Click to collapse
Doesn't work bro... soft bricks phone
and It's just the build.prop i changed
After installing this tweak and reboot my phone opens only recovery mode.
Sor92 said:
After installing this tweak and reboot my phone opens only recovery mode.
Click to expand...
Click to collapse
This tweak can't brick your smartphone, it's a customization of kernel event. It's practiced on rom stock D290n root + busybox tool installed, by manualy install.
After installation, check /data. If the log are there so the script works, otherwise check the file permission with root browser.
Sorry, report your model, I use d290n.
Run or not > don't brick :fingers-crossed:
Edit :
(don't move lib/egl, script unstable)
I have D290n with root and busybox.
mickael.webmaster said:
This tweak can't brick your smartphone, it's a customization of kernel event. It's practiced on rom stock D290n root + busybox tool installed, by manualy install.
After installation, check /data. If the log are there so the script works, otherwise check the file permission with root browser.
Sorry, report your model, I use d290n.
Run or not > don't brick :fingers-crossed:
Edit :
(don't move lib/egl, script unstable)
Click to expand...
Click to collapse
D295n
Which permissions should we set in the root browser?
Ky$h said:
D295n
Click to expand...
Click to collapse
D295 ?? Flash a stock rom or hard reset, build.prop it's not appropriate, it's the cause of bootloop.
http://lg-phone-firmware.com/firmware-LG+L+Fino-Tutti-103.html
Sorry guys, I correct the position.
________________________
RenegadeX44 said:
Which permissions should we set in the root browser?
Click to expand...
Click to collapse
With root browser
________________________
Update tweak : 2016, january 24th
_03lowmemorykiller > configuring lowmemorykiller
_04_IO_scheduler > best I/O scheduler line
________________________
Update tweak : 2016, january 26th
_Order tweak
_06_IO_scheduler > best I/O scheduler line - added LOOP
...
Thread update in the near future

[UNLOCKED][ROOTED]Android 11 system-as-root and privacy policy updates permission problem

Hi,
This is my first post here.
Yesterday I rooted a Samsung A51 SM-A515F/N with android 11 [A515FxxU4EUD7] stock rom with twrp recovery, unlocked bootloader, and magisk.
As far as I can tell zero functionality loss on OS. Got everything to work just right.
Pass SafetyNet Test.
systemized FGL Pro and GPS Joystick as priv-apps.
Both applications recognize system mode but they both crash when you start the location mocking.
I believe I found what is making them crash.
Need confirmation/Advise on how to proceed.
Assume full rooted SM-515F with fully working Magisk 23.0 and Terminal Systemizer module installed
Systemizer command:
a51:/ $ su
a51:/ # systemize
! Busybox not detected
Please install one (@osm0sis' busybox recommended)
df: Unknown option 'm' (see "df --help")
df: Unknown option 'm' (see "df --help")
==============================================
App Systemizer (Terminal Emulator) v17.3.1(70)
by veez21
==============================================
BusyBox not found!
==============================================
Enter logs to upload logs
==============================================
Set SELinux Enabled: false
SELinux Status: Enforcing
==============================================
1 - Systemize Installed Apps (Listed)
2 - Systemize Installed Apps (Enter label)
3 - Systemize given APK
s - Set SELinux
0 - Exit
[CHOICE]: 3
Enter APK Path
Example: /sdcard/launcher.apk
x - Back to Menu
> /sdcard/Download/com.ltp.pro.fakelocation.apk
Checking if file exists - OK
Checking if file is an APK - OK
Checking package name - com.ltp.pro.fakelocation
Where to install?
< 1 - /system/app | 2 - /system/priv-app | 0 - cancel > : 2
df: Unknown option 'm' (see "df --help")
df: Unknown option 'm' (see "df --help")
Checking APK size - 5M
Transfering com.ltp.pro.fakelocation.apk(com.ltp.pro.fakelocation) to '/system/priv-app'...
Granting Permissions
com.ltp.pro.fakelocation - Done
1|a51:/ # mount -o rw,remount /
a51:/ # rm /etc/permissions/privapp-permissions-platform.xml
a51:/ # cp /sdcard/Download/privapp-permissions-platform.xml /etc/permissions/
a51:/ # chown root:root /etc/permissions/privapp-permissions-platform.xml
a51:/ # chmod 644 /etc/permissions/privapp-permissions-platform.xml
a51:/ # mount -o ro,remount /
a51:/ # reboot
Snippet of /etc/permissions/privapp-permissions-platform.xml:
...
<!-- CUSTOM Permissions -->
<privapp-permissions package="com.ltp.pro.fakelocation">
<permission name="android.permission.READ_EXTERNAL_STORAGE" />
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" />
<permission name="android.permission.ACCESS_FOREGROUND_LOCATION" />
<permission name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<permission name="android.permission.ACCESS_FINE_LOCATION" />
<permission name="android.permission.ACCESS_COARSE_LOCATION" />
<permission name="android.permission.INSTALL_LOCATION_PROVIDER" />
<permission name="android.permission.ACCESS_MOCK_LOCATION" />
<permission name="android.permission.ACCESS_MEDIA_LOCATION" />
</privapp-permissions>
<!-- END -->>
...
snippet from cmd dumpsys package com.ltp.pro.fakelocation:
Packages:
Package [com.ltp.pro.fakelocation] (1e331cd):
userId=10264
pkg=Package{876da82 com.ltp.pro.fakelocation}
codePath=/system/app/com.ltp.pro.fakelocation
resourcePath=/system/app/com.ltp.pro.fakelocation
legacyNativeLibraryDir=/system/app/com.ltp.pro.fakelocation/lib
primaryCpuAbi=null
secondaryCpuAbi=null
versionCode=67 minSdk=15 targetSdk=28
versionName=3.4.9.3
splits=[base]
apkSigningVersion=2
applicationInfo=ApplicationInfo{876da82 com.ltp.pro.fakelocation}
flags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA LARGE_HEAP ]
privateFlags=[ PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION PRIVATE_FLAG_REQUEST_LEGACY_EXTERNAL_STORAGE PRIVATE_FLAG_ALLOW_NATIVE_HEAP_POINTER_TAGGING ]
forceQueryable=false
queriesPackages=[]
dataDir=/data/user/0/com.ltp.pro.fakelocation
supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]
usesLibraries:
android.test.base
android.hidl.manager-V1.0-java
android.hidl.base-V1.0-java
usesOptionalLibraries:
org.apache.http.legacy
usesLibraryFiles:
/system/framework/android.test.base.jar
/system/framework/android.hidl.manager-V1.0-java.jar
/system/framework/android.hidl.base-V1.0-java.jar
/system/framework/org.apache.http.legacy.jar
timeStamp=2021-05-30 19:29:31
firstInstallTime=2021-05-30 19:29:31
lastUpdateTime=2021-05-30 19:29:31
signatures=PackageSignatures{3bad593 version:2, signatures:[721026fa], past signatures:[]}
installPermissionsFixed=true
pkgFlags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA LARGE_HEAP ]
declared permissions:
com.ltp.pro.fakelocation.permission.MAPS_RECEIVE: prot=signature, INSTALLED
com.ltp.pro.fakelocation.permission.C2D_MESSAGE: prot=signature, INSTALLED
requested permissions:
android.permission.INTERNET
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_COARSE_LOCATION
android.permission.SYSTEM_ALERT_WINDOW
com.google.android.providers.gsf.permission.READ_GSERVICES
android.permission.READ_EXTERNAL_STORAGE: restricted=true
android.permission.WRITE_EXTERNAL_STORAGE: restricted=true
android.permission.FOREGROUND_SERVICE
com.android.vending.BILLING
com.android.vending.CHECK_LICENSE
android.permission.WRITE_SETTINGS
android.permission.INSTALL_LOCATION_PROVIDER
android.permission.WRITE_SECURE_SETTINGS
android.permission.ACCESS_MOCK_LOCATION
android.permission.WAKE_LOCK
com.google.android.c2dm.permission.RECEIVE
com.ltp.pro.fakelocation.permission.C2D_MESSAGE
android.permission.ACCESS_BACKGROUND_LOCATION: restricted=true
android.permission.ACCESS_MEDIA_LOCATION
install permissions:
com.ltp.pro.fakelocation.permission.C2D_MESSAGE: granted=true
android.permission.WRITE_SETTINGS: granted=true
com.google.android.c2dm.permission.RECEIVE: granted=true
com.google.android.providers.gsf.permission.READ_GSERVICES: granted=true
android.permission.SYSTEM_ALERT_WINDOW: granted=true
android.permission.FOREGROUND_SERVICE: granted=true
android.permission.INTERNET: granted=true
com.android.vending.CHECK_LICENSE: granted=true
com.android.vending.BILLING: granted=true
android.permission.ACCESS_NETWORK_STATE: granted=true
android.permission.WAKE_LOCK: granted=true
User 0: ceDataInode=46342 installed=true hidden=false suspended=false distractionFlags=0 stopped=false notLaunched=false enabled=0 instant=false virtual=false
overlay paths:
/product/overlay/NavigationBarMode3Button/NavigationBarMode3ButtonOverlay.apk
gids=[3003]
runtime permissions:
android.permission.ACCESS_FINE_LOCATION: granted=true, flags=[ USER_SET]
android.permission.READ_EXTERNAL_STORAGE: granted=false, flags=[ APPLY_RESTRICTION]
android.permission.ACCESS_COARSE_LOCATION: granted=true, flags=[ USER_SET]
android.permission.WRITE_EXTERNAL_STORAGE: granted=false, flags=[ APPLY_RESTRICTION]
android.permission.ACCESS_BACKGROUND_LOCATION: granted=false, flags=[ REVOKE_WHEN_REQUESTED|APPLY_RESTRICTION]
android.permission.ACCESS_MEDIA_LOCATION: granted=true, flags=[ USER_SET|REVOKE_WHEN_REQUESTED]
Please direct your attention to the second last line: "android.permission.ACCESS_BACKGROUND_LOCATION: granted=false, flags=[ REVOKE_WHEN_REQUESTED|APPLY_RESTRICTION]"
This permission is restricted even though permission has been explicitly set with the xml file.
I believe this is due to: https://developer.android.com/training/location/permissions this update of the privacy policy on Android 11.
Now this thread says that the permission for ACCESS_FOREGROUND_LOCATION needs to be requested in the application.manifest file before ACCESS_BACKGROUND_LOCATION is called. This allows the user to select the always allow option that allows background threads to handle location permissions. This is where I believe the app crashes - the thread gets aborted and then crashes the app because it can't get background location access.
I'm thinking the only solution is to get the devs of FGL/GPSJoystick to add these permissions to their minifest files. Am I correct or am I missing something big?
EDIT: interestingly - installing the app as userapp(not system app), gives the "Allow all the time" option under location (Settings->Apps->Permissions->Location). I think I'm missing something, aldo I might be a little sleep deprived, 36 hours straight with this A51
Please let me know if you need any more info from me
RESERVED
Were you able to solve this problem facing same with my custom system app
Hi,
I emailed the devs of the afore mentioned apps, asking for them to add the permission in their manifest files but never got any replies.
After that I just switched over to patching the framework so the OS can not detect when a location mock app is selected in developer settings (using Smali patcher).
I have run into this permission and location settings issue a couple times since then on other apps, some not written by me and others written by me. The only fix I have been able to find is to add the permissions in the app manifest file. Ever since Android 10 google made it much harder to enable the "Always Allow Location Access" in settings.
Hope this helps

How To Guide How to use the Hardware Test App from ASUS on a Zenfone running a CustomROM

How to use the Hardware Test App from ASUS on a Zenfone running a CustomROM
The Hardware Test App from ASUS for the Zenfone 8 can also be used on a ASUS Zenfone 8 running a CustomROM.
But to get the App working on a CustomROM some efforts are neccessary.
The ASUS Hardware Test App needs the permission to modify system settings. To get this permission the app must be signed with the platform certificate used for the running Android OS.
And because these certificates are not available for the public for all public available CustomROMs (for some very good reasons ...) you must compile your own CustomROM for using the ASUS Hardware Test App on a CustomROM.
So -- for those who still want to continue: Here are the steps neccessary to run the Hardware Test App from ASUS for the Zenfone 8 on a phone running a CustomROM :
First copy the apk with the ASUS Hardware Test App from a Zenfone 8 running the original Android 12 from ASUS to your PC.
This is the file
/system/apps/SMMI_TEST/SMMI_TEST.apk
on the phone running the ASUS Android OS.
Now it's neccessary to sign the App with the platform key from your CustomROM:
In the OmniROM (and I assume that's also true for other AOSP based CustomROMs) the neccessary files, platform.pk8 and platform.x509.pem, are in the directory
Code:
./build/make/target/product/security
in your build tree for the CustomROM, e.g.
Code:
[[email protected] /data/develop/android/OmniROM]$ ls -l ./build/make/target/product/security/platform.*
-rw-------. 1 xtrnaw7 xtrnaw7 1219 Jun 25 09:39 ./build/make/target/product/security/platform.pk8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1460 Jun 25 09:39 ./build/make/target/product/security/platform.x509.pem
[[email protected] /data/develop/android/OmniROM]$
Now re-sign the apk file using these commands:
Code:
# remove the current certificate files from the apk (probably not neccessary -- but shouldn't harm)
#
zip -d SMMI_TEST.apk META-INF/CERT.SF META-INF/CERT.RSA
# do a zip align for the apk and write the output to SMMI_TEST1.apk
#
# (zipalign is part of the OTA tools)
#
/data/develop/android/otatools/bin/zipalign 4 SMMI_TEST.apk SMMI_TEST1.apk
# test the result (there should be NO output from this command)
#
/data/develop/android/otatools/bin/zipalign -c 4 SMMI_TEST1.ap
# and now sign the apk with the platform key from the development tree for your self compiled CustomROM
# (apksigner.jar is part of the Sdk from Google for Android)
#
java -jar ./Android/Sdk/build-tools/33.0.0/lib/apksigner.jar sign --key platform.pk8 --cert platform.x509.pem SMMI_TEST1.apk
That's it . The re-signed apk file SMMI_TEST1.apk should work on your CustomROM
To test it:
To test the signed apk do:
Copy the signed apk to the phone running your self compiled CustomROM and issue
Code:
ls -l /sdcard/Download/SMMI_TEST1.apk
# 25733396 in the next command is the size of the file /sdcard/Download/SMMI_TEST1.apk in byte
#
cat /sdcard/Download/SMMI_TEST1.apk | pm install -S 25733396
If you get an error like this
Code:
130|ASUS_I006D:/ # ls -l /sdcard/Download/SMMI_TEST1.apk
-rw-rw---- 1 u0_a111 media_rw 25733396 2022-08-04 19:02 /sdcard/Download/SMMI_TEST1.apk
ASUS_I006D:/ #
ASUS_I006D:/ # cat /sdcard/Download/SMMI_TEST1.apk | pm install -S 25733396
Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Reconciliation failed...: Reconcile failed: Package com.asus.atd.smmitest has no signatures that match those in shared user android.uid.system; ignoring!]
1|ASUS_I006D:/ #
something went wrong signing the apk. Just do it again.
To install the apk do:
If not already done:
Compile your own CustomROM (using the certificates used to sign the ASUS Hardware Test App!) and install it on the ASUS Zenfone 8. (see How to compile the OmniROM for the ASUS Zenfone 8 for how to compile the OmniROM)
Install Magisk on your phone running the self compiled CustomROM
Simulate a Magisk Module using these commands:
Code:
adb shell su - -c mkdir -p /data/adb/modules/SMMI_TEST/system/app/SMMI_TEST
adb push SMMI_TEST1.apk /sdcard/Download/
adb shell su - -c cp /sdcard/Download/SMMI_TEST1.apk /data/adb/modules/SMMI_TEST/system/app/SMMI_TEST/SMMI_TEST1.apk
adb shell su - -c chmod o+r /data/adb/modules/SMMI_TEST/system/app/SMMI_TEST/SMMI_TEST1.apk
and reboot the phone
Code:
adb reboot
After the reboot the ASUS Hardware Test App should be visible in the directory /system/app, e.g.
Code:
130|ASUS_I006D:/ # find /system/app/SMMI_TEST/
/system/app/SMMI_TEST/
/system/app/SMMI_TEST/SMMI_TEST1.apk
ASUS_I006D:/ #
To execute the ASUS Hardware Test App do
Code:
# open a shell on the ASUS Zenfone 8 (either local or via "adb shell"), become root user
su -
and execute
Code:
# switch SELinux to permissive mode (I currently do not know the neccessary SELinux policies to avoid this step ...)
#
setenforce 0
# and start the ASUS Hardware Test App from within the shell
#
am start -n com.asus.atd.smmitest/com.asus.atd.smmitest.main.MAIN
Do not forget to enable SELinux enforcing mode after the tests are done (or reboot the phone ...)
Code:
# switch SELinux to permissive mode (I currenlty do not know the neccessary SELinux policies to avoid this step ...)
#
setenforce 1
Sample Script to start the ASUS Hardware Test App
Code:
# simple script to start the ASUS Hardware App
CUR_SELINUX_STATUS="$( getenforce )"
CUR_USERID=$( id -u -n )
RESTORE_SELINUX_STATE="false"
if [ "${CUR_SELINUX_STATUS}"x != "Permissive"x ] ; then
if [ "${CUR_USERID}"x != "root"x ] ; then
echo "Either start this script as user \"root\" or set the SELinux mode to \"permissive\" using the command \"setenforce 0\" before starting this script"
exit 1
fi
echo "Setting the SELinux mode to \"Permissive\" ..."
setenforce 0
RESTORE_SELINUX_STATE="true"
else
echo "The SELinux mode is already \"Permissive}\" "
fi
am start -n com.asus.atd.smmitest/com.asus.atd.smmitest.main.MAIN 2>&1 | tee /sdcard/Download/test.out
if [ ${RESTORE_SELINUX_STATE} = true ] ; then
echo "Press return when done with the tests .."
read USER_INPUT
echo "Setting the SElinux mode back to \"Enforcing\" ...."
setenforce 1
else
echo "Do not forget to set the SELinxu mode back to \"Enforcing\" using the command \"setenforce 1\" "
fi
Trouble Shooting
If the boot process of the phone hangs after adding the pseudo Magisk Module for the ASUS Hardware Test App do:
Code:
# connect to the phone via adb (that should work!)
#
adb shell
# become root user
#
su -
# delete the file with the AUS Hardware Test App
#
rm /data/adb/modules/SMMI_TEST/system/app/SMMI_TEST/SMMI_TEST1.apk
# and reboot the phone
#
reboot
Most probably something went wrong signing the app or you did not do the zip align (there should be some messages visible in logcat to find the reason for the boot loop; check the output of logcat before rebooting the phone)
A useful test to find reason for the boot loop is :
Code:
# try to install the apk as root user
#
su -
# and then
#
setenforce 0
pm install /sdcard/Download/SMMI_TEST.apk
If booting the phone works but the App does not start make sure that the SELinux status is permissive.
Update 26.06.2022
The adb commands to create the "simulated" Magisk Module must be executed by the user root - fixed.
Added a sample script to start the ASUS Hardware Test Tool
Update 04.08.2022
Added instructions to to test if signing the apk was successfull
Thank you so much for your guides! This is very detailled documentation with good explanations!

Categories

Resources