Echo using loudspeakers - Razer Phone Questions & Answers

Problem fixed by editing the Build.Prop with missing lines from the file.
@MikeChannon please close this thread with my thanks.

Related

[mod] [5/14/13] [tw] full time multi sample anti-aliasing

This mod is full time 4x and 2x MSAA for TW on the d2spr.
Download available in post 2.
Performance Edition in post 3
All development for this mod has been developed through the device on the device for the device.
If you need help with this mod feel free to ask. However, there are a few different mods listed. Please state which mod you are using so I can better help you!
First things first.
I want to thank...
"Kennyglass 123" for you patience in this forum.
"qwerty12"
"x714x"
If it weren't for you guys this would be an absolute fail! Your great knowledge is appreciated!
**If you include this in your rom please include me in your credits as a few haven't.**
If you are a rom developer and would like to include this mod in your next rom then go for it. No need to ask.
This mod is FULL TIME 4xMSAA and produced by a single text file in /data/local/temp/ called "yamato_panel.txt" Set your permissions for the device to read it and reboot. Any changes made to the file are not instantly applied and will need a reboot.
To verify the samples get the app "Basemark ES2 taiji"
It's optional but not necessary to...
- Remove the line "0 0 android from /system/lib/egl/egl.cfg
- Rename "libGLES_android.so" to "libGLES_android.bak" in /system/lib/egl.
This forces the system to use hardware rendering and speeds up the whole system. Even though we have this set in alot of build.props it will still use SW rendering at times. This completely eliminates SW.
The 1 in "0 1 adreno" defines HW.
What is Anti-Aliasing??
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
FT4xMSAA yamato_panel.txt
NOTES..
1. Do NOT attempt to set MSAASmoothing to "high" as it will cause your display to look like 8 bit graphics. (Anybody want to try to fix this be my guest)?
2. MSAAMode=1
Sets samples to 2x
MSAAMode=2
Sets samples to 4x
3. facenessCulling=on
This will drastically increase the picture quality but also put more strain on the system. This can be set to "default" for easier rendering.
ISSUES..
1. Since the recent updates to ASOP, this mod is no longer recommended for it. This is now for T.W. only.
2. The taskbar artifacts have been significantly reduced in 4x and non existent in 2x.
3. This is not a performance mod!
This mod will cause a higher strain on the system. Effects of this mod are slower performance but a far better visual experience.
The text file for 4x MSAA.
Use it at your own risk. Attempting to modify some settings may leave your device soft bricked! However, if this happens you can simply remove the file in TWRP and reboot.
#
Code:
performance=normal
disableExtraSwapBlit=0
ignoreGlFlush=0
binning=hw
forceGuardband=0
guardbandValue=0
forceGmemSize=0
gmemSize=0
veboSetting=0
numBins_weight=80
numGroups_weight=20
log.resolves=0
log.pm4=0
log.pm4mem=0
log.shaders=0
log.sc_dev=0
log.cffdump=0
log.cffdump_with_ifh=0
log.cffdump_no_memzero=0
log.dumpx=0
log.sc_dev_shader_name=sc_dev_dump.txt
log.primitives=0
waitForIdleAfterDraw=0
waitForIdleOnSubmit=0
disableSwapTsIdle=0
useUncachedVBOs=0
clockGating=off
useSafeMode=0
redirectDebugMessages=0
forceChipId=Default
convertTristrips=default
convertTrifans=default
convertLineloops=default
shader_sub.write=0
shader_sub.read=0
shader_sub.trivialfs=0
facenessCulling=on
vboDataAlignment=natural
enableOptimizedTextureUpdates=1
enableOptimizedVboUpdates=1
forceAutoTextureCompression=0
triJuice=0
enableInlineConstantUpdates=1
enableMemoryPool=1
enableFastClears=1
ditherSafeFastClears=1
shadowGmemInAppBuffers=1
textureTiling=1
preserveZStencilOnSwap=0
allowDepthExport=0
untileDynamicTextures=1
fullSurfaceDynamicUpdatePath=1
useGpuTilingHints=1
MSAASmoothing=normal
MSAABufferAllocation=always
forceMSAAMode=1
MSAAMode=2
VAESEnable=0
VAESGenericError=0
VAESFailNth=0
VAESDoNotFailFirstN=0
VAESRandomSeed=0
VAESFailPercent=0
2D.HwBlt=1
2D.forceEglSwapInterval=0
2D.eglSwapInterval=0
leiaEnableLrzWrites=1
leiaEnableLrzExpansion=0
leiaExportColorForLrzUnresolve=0
leiaEnableFastLrzUnresolves=0
oxiliDisableLazyUpdates=0
oxiliDisableChunkedUpdates=0
oxiliForceShaderDirectUpdates=0
oxiliForceConstantDirectUpdates=0
oxiliForceIstoreCacheMode=0
oxiliForceCstoreSingleBuffer=0
oxiliForceShaderSingleContext=0
oxiliForceSuperthreadMode=0
oxiliForceVsSingleThread=0
oxiliForceFsSingleThread=0
oxiliForceSingleSp=0
oxiliSkipClears=0
oxiliForceSysmemRender=0
FPSCap=0
allowFloatFBOs=0
suppressTimestampInterrupts=0
GPUIdleTimeout=off
GPUIdleTimeoutMsec=0
After installing this mod or simply installing any standard rom its recommended to quickly scroll something on your device to properly set the framebuffer. This is why a newly installed rom may be choppy at first.
BUILD.PROP
Additional edits to the build.prop. These alone will create a significant gain in the visual experience and possible scrolling smoothness with or without yamato!
Tweak as you like.
#----HWUI----
Code:
ro.hwui.text_cache_width=2048
debug.hwui.render_dirty_regions=false
ro.hwui.text_cache_height=256
ro.hwui.fbo_cache_size=16384
ro.hwui.layer_cache_size=16384
ro.hwui.path_cache_size=16384
ro.hwui.round_rect_shape_cache_size=16384
ro.hwui.circle_shape_cache_size=16384
ro.hwui.rect_shape_cache_size=16384
ro.hwui.arc_shape_cache_size=16384
ro.hwui.oval_shape_cache_size=16384
ro.hwui.texture_cache_size=16384
ro.hwui.gradient_cache_size=16384
ro.hwui.text_drop_shadow_cache_size=16384
ro.hwui.font_renderer_cache_size=16384
ro.hwui.resource_cache_size=16384
ro.hwui.patch_cache_size=16384
ro.hwui.disable_vsync=false
ro.hwui.layer_size=1024
ro.hwui.render_layers_as_regions=1
ro.hwui.stencil_buffer_size=3.0
ro.hwui.texture_cache_flush_rate=0.9
ro.hwui.panel_bit_depth=32
ro.hwui.default_text_gamma=1.8
ro.hwui.default_text_black_gamma_threshold=255
ro.hwui.default_text_white_gamma_threshold=255
ro.hwui.disable_scissor_opt=true
debug.hwui.show_overdraw=false
debug.hwui.show_layers_updates=false
ro.hwui.text_gamma_correction=shader3
GPU PERFORMANCE GOVERNOR.
Setting GPU governor to "performance" mode. This will help to smooth system performance with or without yamato.
Code:
echo trustzone >/sys/class/kgsl/kgsl-2d0/pwrscale/policy
echo performance >/sys/class/kgsl/kgsl-2d0/pwrscale/trustzone/governor
echo trustzone >/sys/class/kgsl/kgsl-2d1/pwrscale/policy
echo performance >/sys/class/kgsl/kgsl-2d1/pwrscale/trustzone/governor
echo trustzone >/sys/class/kgsl/kgsl-3d0/pwrscale/policy
echo performance >/sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor
DOWNLOADS
USE THESE MODS AT YOUR OWN RISK. I AM NOT RESPONSIBLE!
DOWNLOADS-
YAMATO MSAA TEXT FILE (D.I.Y.)
http://db.tt/1qpNeaMe
FLASHABLE YAMATO MSAA ZIP
http://db.tt/0e2WAfgk
FLASHABLE YAMATO UNINSTALL
http://db.tt/8KrQ3M7c
BUILD.PROP
This is a text file you can copy and paste from.
http://db.tt/zaTHjZRC
GPU INIT.D SCRIPT
After download remove ".txt" from the name. Then drop the file in init.d
http://db.tt/gj3mdrtH
Yamato Performance Edition v1.0 update
This does NOT use anti-aliasing. It's settings are specifically set for one purpose... A faster device!
YAMATO PERFORMANCE v1.0 TEXT FILE (D.I.Y.)
http://db.tt/fX7QcRPg
FLASHABLE YAMATO PERFORMANCE v1.0
http://db.tt/70hLynZS
FLASHABLE YAMATO UNINSTALL
http://db.tt/8KrQ3M7c
Thanks for your contribution!:beer:
Sent from my SPH-L710 using Tapatalk 2
what exactly does this do? im confused
r.suchil2 said:
what exactly does this do? im confused
Click to expand...
Click to collapse
It will smooth out the display graphics for a higher definition look. It essentially smoothes the edges of everything rendered on your device. Colors and shading will also be improved.
Added downloads in post 2
This works great with the GPU script and the build prop tweaks but that yamoto file causes some weird lines on my status bar so I deleted that. Quadrant scores are over 6k with this mod now! Thanks! Much smoother user experience!
Sent from my SPH-L710 using xda premium
Visionikz03 said:
This works great with the GPU script and the build prop tweaks but that yamoto file causes some weird lines on my status bar so I deleted that. Quadrant scores are over 6k with this mod now! Thanks! Much smoother user experience!
Sent from my SPH-L710 using xda premium
Click to expand...
Click to collapse
Yes there are some disturbances in status bar. They come and go and not sure why. Switching to 2x mode should completely eliminate it though if you want. The build.prop edits should speed things up a bit. A better scroll, better colors and shading.
Added Performance Edition v.5 added to post 3.
OP: Could you place the code between code tags? Makes it easier to see and copy. Thanks
Nice... Thanks
CNexus said:
OP: Could you place the code between code tags? Makes it easier to see and copy. Thanks
Click to expand...
Click to collapse
I will get to a laptop later this weekend but in the meantime I have everything in the downloads section.
razz1 said:
I will get to a laptop later this weekend but in the meantime I have everything in the downloads section.
Click to expand...
Click to collapse
Yes, but I prefer to enter things myself versus copying them.
CNexus said:
Yes, but I prefer to enter things myself versus copying them.
Click to expand...
Click to collapse
Your all set. Op updated!
Updated yamato performance edition to v1.0
All parameters have been set and tested to obtain the most speed for the GS3
This may be the final update for the performance edition. We'll see.
How exactly do you install this?
Sent from my SPH-L710 using xda app-developers app
Yes, I'm confused as to how to install this as well.
prochargedls2 said:
How exactly do you install this?
Sent from my SPH-L710 using xda app-developers app
Click to expand...
Click to collapse
Yamato..
Download the "yamato_panel.txt" file and drop it into "/data/local/tmp/" then reboot.
Build.prop...
Go to "/system/build.prop" file.
Open it to edit it's text.
Add or copy and paste the lines provided in the OP into the "/system/build.prop file.
There is a download provided for the build.prop so you can easily copy and paste from it.
or
Use your favorite build.prop editor and add them through there.
Reason for no flashable zip?
I don't like messing with others build.prop file as I don't have a good uninstall zip for that if they don't like it.
I didn't feel the need for a yamato zip either because it's just one text file you drop in one file.
However, if it would help, I could make one. I would like everyone that would like to try this out to be able to do it. If there is an issue with installing for anyone, just l let me know and I will help you out!
Yes please create a flashable zip because I'm having troubles.
Sent from my SPH-L710 using xda app-developers app

[GUIDE] How To Make An Init.d Script (Noob Friendly)

How to make your own init.d script​
Hey fellow XDA users!​
I'm creating this thread as I've seen a countless number of times the same question asked (literally hundreds)
'How to I set (_____) on boot?'​
Finally I have come around to answering that question! This thread will allow you to control system/kernel parameters on boot
Now many of the kernel devs around the HOX forums have created some pretty epic kernels with tons of features which can be modified as much as the user wants and now I'll be showing you how to set these parameters on boot without the use of apps! :laugh:
Requirements
Rooted
Busybox
Custom Rom with Init.d Support (Most custom Rom's, check in OP of Rom thread)
A Root File Explorer (We're going to do this through the phone)
Stock ROM does not support init.d
If you're on a stock rom, you can easily add init.d support using Ryuinferno's very very helpful thread!
Enable Init.d Support
Once you've done that, come back and follow the instructions
Now to begin, let's look at a typical init.d script
Code:
#!/system/bin/sh
#CPU
echo pmc > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
#Smart Dimmer
echo 1 > /sys/devices/tegradc.0/smartdimmer/enable
#Fast Charge
echo 1 > /sys/devices/platform/htc_battery/fast_charge
#S2W
echo 1 > /sys/android_touch/sweep2wake
OK, now to a new user this may seem quite confusing but once broken down it can be easily understood:
#!/system/bin/sh = This is required at the start of every init.d script
echo .... = Sends the command
'<insert value here>' = You can put a value after 'echo' and it will send that value to the file you have shown the path to, e.g. 'echo 1 >...'
>/.... = Specify the path and file in which to change on boot
So for example if I put this in my script:
echo '1' > /sys/devices/system/cpu/cpu0/cpufreq/gpu_voltage
I am changing the file 'gpu_voltage' to 1, allowing gpu voltage to be enabled on boot (currently only XM's & Alex-V's kernel)
Similarly with the command:
echo '0' > /sys/class/leds/button-backlight/auto_bln
I am disabling auto-bln on boot
Hopefully after you've read all of that, you've understood a little more about init.d scripts
Now let's actually create some scripts
Instructions​
We'll be using a file explorer on Android since Window's editors don't format the text correctly
1. Create a file using your choice of file explorer, I'm using Root Explorer and put it in /system/etc/init.d/
2. Open the file and write the following into it:
#!/system/bin/sh
3. Then choose which file you want to modify on boot and what value you want to change it to, and write the echo command and path into the file
For example: echo interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - (for interactive governor on boot)
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq - (for 1.2ghz on boot)
Now there's some things to look out for when doing this:
• You need to make sure you're pointing to the file not just folder when entering the path in '> /....'
• You need to make sure you put the spaces in the right places and don't put any spaces in random places
• When entering multiple values you need to put the values in quotation marks like this "....." - so for example if I want to set max GPU speed I would do this:
echo "416 416 416 416 304 304 247 247" > /sys/devices/system/cpu/cpu0/cpufreq/gpu_oc
• Also if you put a '#' in front of the line of text then it ignores that line, as you can see in my example I have a line that says '#CPU'. This is just to tell me I'm making modifications to the CPU and so I put a # in there so that line is ignored (the echo command below it is still carried out)
• You can do all the commands in one script and do as many as you like!
The various parameters that can be controlled are most likely on the OP's of the respective kernel threads (it would be ridiculously long if I were to put them all in this thread)​
4. Once you're done, save and exit the file
5. Then rename it with a number in front, this number will decide which init.d script will run first (lower the number the earlier it's run on boot)
So for example I named my file: 25kerneltweaks
It doesn't really matter what number you put but just make sure there's no other scripts running after which will also change kernel parameters (leave them but just give your script a higher number)
Almost done now!
6. The final thing you have to do is set permissions:
Now you won't be able to use ES File Explorer for this step as it just can't set the right permissions for init.d scripts for some odd reason, preferably use Root Explorer but others should work (except ES)
Set permissions as rwx-rwx-rwx (shown in the image)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If you don't have Root Explorer or a good substitute you could also do this through terminal emulator:
To do that enter this into emulator (press enter after every line)
Code:
su
chmod 777 /system/etc/init.d/insertfilenamehere
And permissions should be set
​
And that's pretty much it folks
You have successfully created your own init.d script!
Many people prefer this method as you don't require apps to set stuff on boot, now it'll just be done automatically for you :good:
Btw this will work on any android device, so if your a wandering googler (is that even a word ) searching for a guide like this, it should work on your phone/tablet as long as you fulfill the requirements
Hope you guys found this useful, it's the first thread I've made so sorry if it's a little rough around the edges and
Press thanks if I helped and please rate the thread, I'd greatly appreciate it!
now all who have this questions can make their own script every time they ask if somebody else can do -.- ... good guide mate i always do that with smanager but some ppl are then confused ._.
One-X-master said:
now all who have this questions can make their own script every time they ask if somebody else can do -.- ... good guide mate i always do that with smanager but some ppl are then confused ._.
Click to expand...
Click to collapse
Haha thanks man!
I actually only made it because I seen you reply to someone who was asking about scripts on Xmister's thread and I thought 'Damn I'm tired of these questions'
But yeah hopefully people find this useful :thumbup:
Sent from my :tank:
Headless_monkeyhunta96 said:
Haha thanks man!
I actually only made it because I seen you reply to someone who was asking about scripts on Xmister's thread and I thought 'Damn I'm tired of these questions'
But yeah hopefully people find this useful
Sent from my :tank:
Click to expand...
Click to collapse
then you know how i'm tired of these questions i hate those simple questions which even are mentioned and also asked in google...i searched in google and found really MANY of those question, for example for scripts etc which are really easy....why not even try in google play? i searched a long time ago...and i found smanager...one of the easiest way to make scripts
Thanks, man. This was really needed.
May I add a link to this in my thread?
csec said:
Thanks, man. This was really needed.
May I add a link to this in my thread?
Click to expand...
Click to collapse
Yeah sure man
Sent from my :tank:
Thanks for this thread man!
Was really useful since I didn't like using apps to set my stuff on boot but didn't know how to do it with scripts
Really good guide :good:
Great Guide, well written and presented.
Not for me as I don't program, but great guide non the less !
Rahman2012 said:
Thanks for this thread man!
Was really useful since I didn't like using apps to set my stuff on boot but didn't know how to do it with scripts
Click to expand...
Click to collapse
matt95 said:
Really good guide :good:
Click to expand...
Click to collapse
Wilks3y said:
Great Guide, well written and presented.
Not for me as I don't program, but great guide non the less !
Click to expand...
Click to collapse
Thanks guys!
Means a lot..
Sent from my :tank:
:good:thanks alot
I made a script yesterday but when I restarted this morning the script was deleted. Do I need to place a specific place?
Sent from my HTC One X using xda app-developers app
tandeman said:
I made a script yesterday but when I restarted this morning the script was deleted. Do I need to place a specific place?
Sent from my HTC One X using xda app-developers app
Click to expand...
Click to collapse
Well it has to be placed in system/etc/init.d
That's weird though it shouldn't randomly delete. Do you have any other mods installed?
Sent from my :tank:
Maybe because it put it in sys/
Sent from my HTC One X using xda app-developers app
tandeman said:
Maybe because it put it in sys/
Sent from my HTC One X using xda app-developers app
Click to expand...
Click to collapse
Yeah your gonna have to move it to /system/etc/init.d
Follow the instructions to the letter and you should be fine
Sent from my :tank:
Thanks! I have a question: I tried to set a different max cpu frequency by using this command for my device echo 2107680 > /sys/bus/cpu/devices/cpu0/cpuinfo_max_freq
via adb shell and Root Explorer but anytimes I save the file it back to original value.
I also put a new init.d file within that command with no success. Why that?
sev7en said:
Thanks! I have a question: I tried to set a different max cpu frequency by using this command for my device echo 2107680 > /sys/bus/cpu/devices/cpu0/cpuinfo_max_freq
via adb shell and Root Explorer but anytimes I save the file it back to original value.
I also put a new init.d file within that command with no success. Why that?
Click to expand...
Click to collapse
try
Code:
$ adb root
$ adb shell
and do it all over again
matt95 said:
try
Code:
$ adb root
$ adb shell
and do it all over again
Click to expand...
Click to collapse
matt, thanks! It says about "adbd cannot run as root in production builds" but I flashed my custom ROM. Why that?
Thanks...
sev7en said:
matt, thanks! It says about "adbd cannot run as root in production builds" but I flashed my custom ROM. Why that?
Thanks...
Click to expand...
Click to collapse
Mmmhh then try to do it into recovery mode which is already set as root
matt95 said:
Mmmhh then try to do it into recovery mode which is already set as root
Click to expand...
Click to collapse
Thanks! Doing that now... (God bless my device eheh)
---------- Post added at 07:18 PM ---------- Previous post was at 06:35 PM ----------
Hi, unfortunately it doesn't work. I also made a stand-alone script (below)...
then flashed it with a new ROM but as you can see frequencies and parameters haven't changes at all... why?

[TOOL][v1.2.0] Batch Deodexing Tools using Android Device

[Tool/Utility][v1.2.0]Apktool Mobile Batch Deodexing - Run Batch Deodex Jobs Using Your Android Device!
*** Disclamer
Your device is shipped without root for a reason. Modifying system files that are normally off limits carries the risk of being caught in a situation where you will be unable to fix the damage unless you plan ahead.
It is wise to not proceed unless you have a means of restoring your device in the event of a catastrophic event and that you are confident in your ability to restore any issues you create.
I am not and will not be responsible for any harm that may come to your device or to your sanity as a result of **** up.
For more on what's expected, new members should help themselves to the video below.
Description
A toolset for performing batch deodexing straight from your device. Comes installable as a flashable zip and can easily be modified by advanced users to suit their needs. Just drop all your odex and corresponding archives into a folder and run one simple terminal command (or use Linux Script Handler within your File Manager) and deodezed versions will be outputted to a separate folder.
I wrote this because Apktool Mobile lacks any batch features.
COMPATIBLE FOR ALL ANDROID DEVICES RUNNING ICS OR LATER!
Project is just listed here because I had to choose a location specific to a certain device when creating the project. Mods, feel free to move if desired.
Learn more about deodexing and the differences between an odexed system and deodexed system
Installed Files/Directories:
/sdcard/bdt - Directory with our smali and baksmali jars as well as directories to place batch jobs in as well as output folders. There is a readme in each folder describing it's function.
/data/misc/bdt - Directory which contains the Java Runtime Environment as well as all dependent libraries.
/system/bin - Two scripts are installed here. The first is "bdt" and contains all path variables in case you need to edit a path (ex. you download newer smali/baksmali versions to use, or change the name of the bdt directory on your /sdcard). This also contains wrapper functions athat do all the work. The second file is "batch-deodex" and once you have placed your odex (and corresponding apk/jar) files into the /sdcard/bdt/files-to-deodex folder open a command prompt and run this script to deodex all the odex files into dex files and then insert into the corresponding archive.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Installation Instructions and Usage
Download the latest version from one of the hosts in the downloads section and simply flash it in recovery. You could always manually extract the contents but then you'd also have to chmod quite a bit to set the permissions.
To uninstall, flash the uninstall zip that's also in the downloads section, or manually delete /system/bin/bdt, /system/bin/batch-deodex, /data/misc/bdt folder, and /sdcard/bdt folder.
Batch baksmali/smali
To run a batch decompile, move your odex (or deodexed apk or jars) files into /sdcard/bdt/files-to-deodex and fire a command prompt up and type:
Code:
su
. /system/bin/bdt # Import paths and functions
batch-baksmali
The source folders will be outputted to /sdcard/bdt/smali-source.
To compile a batch of deodexed source folders we just do essentially the same thing. Open up a command prompt and type:
Code:
su
. /system/bin/bdt
bbdth-smali
Doing so will create a dex file for each source folder and this will be outputted to /sdcard/bdt/dex-out.
Batch deodexing
Performing a batch deodex works much the same way. Copy all the odex files and their corresponding apk or jar into /sdcard/bdt/files-to-deodex then open a command prompt up and type:
Code:
su
# no need to import anything for this
batch-deodex
Just that easy. The script may take a while depending on how many files you're deodexing just as with the other scripts so if running a lot be patient.
The deodex script moves all odex files to ../files-to-baksmali and then calls batch-backsmali. Then the script calls batch-smali to create the dex files. After that's done it enumerates through the dex files and finds each one's corresponding archive and once it does it uses the
Code:
zip -jq {archive} classes.dex
to insert classes.dex into the archive without extracting anything or changing any compression settings, etc.
Once complete you'll have your deodexed archives and the script cleans up all other directories. The other two scripts don't do this.
Known Issues
-- Discovered that some ROMs are telling me that my scripts don't exists when they very well do, so of you are seeing a "sh: {scriptname}: The file or directory cannot be found" then just run by using the Linux Script Handler within your File Manager until I figure this out or until the ROM dev gets in touch.
-- I just discovered this error while preparing these test screenshots. It didn't effect the deodexing process though but I'll look into fixing this tomorrow. UPDATE: Haven't looked into this yet as it has no effect on the outcome. I think it's occurring because on the final loop when running a batch and when all is finished it still runs one last time, thinking it's looking for a jar file. Once I get these other minor details done I'll publish on github. Actually there is published code there now, but ir needs to be removed and updated.
Downloads
Batch Deodex Tools 1.2.0 - Box
Batch Deodex Tools 1.2.0 - Dropbox
Uninstall ZIP for 1.1.0
Changelog
Code:
1.2.0 Released: -- 08/21/14
-- fixed an issue causing the /sdcard/BDT folder to not be properly flashed
-- some editing made to the scripts in preparation for uploading to github
1.1.0 Released: -- 06/26/14
-- turned into a stand alone project
-- optimized the scripts
-- flashable in recovery
-- also created flashable zip to uninstall
1.0.1 Released: -- 06/21/14
-- initial release
TO DO
-- Migrate the JRE off /data/... to prepare for Android L. Was going to move to /data/app-lib where it probably should have been to begin but no point now, so will remain in /data/misc/bdt for the time. Rwas more in the Addendum in second post
-- Add Box, Dropbop, and Mega hosts as well. Well having just a Drive and Box host should accommodate the demand. If the demand increases I'll adjust accordingly.
-- Publish code to github.
-- Scratched making this into an APK... Having it as is makes it easier for advanced users to make modifications (use custom files, etc) on the fly
Thanks To/Credits
Code:
* Brut.all for giving us apktool and much more
*
XDA:DevDB Information
Batch Deodex Tools - Android, Tool/Utility for the LG G2
Contributors
MidnightHarvester
Version Information
Status: Stable
Current Stable Version: 1.2.0
Stable Release Date: 2014-08-21
Created 2014-06-22
Last Updated 2014-08-21
Reserved
APPENDUM
Consider this a diary. Dates are when the thoughts or discoveries hit me, not release dates
Aug 15 - After modifying the tookset so it"s Android L ready by moving the JRE to /system/{wherever}, after flashing now the BDT directory doesn't get flashed to the sdcard. I'll need to do a little fiddling with the updater script, then release it once it's working. Granted you can just manually extract and copy that directory over easily but I'd prefer a fully working flaahable..
Aug 19 - Noticed there has been updated smali and baksmali jars, so either an incremental update and most likely just a patch will be worked I n and releaaed. Because of the update I'm also looking at any other files that may have been updated.
Aug 20 - I've discovered that on some devices (specifcally, CloudyG3 1.3), that t
here arr some issues running the scripts via terminal as apparently ... they don't exist. Executing them via Linux Script Handler within a File Manager should work until I figure this out)
Aug 20 - Releases will be migrated over time to my Box account, probably Dropbox account, as well as Mega. Archived releases will also be uploaded, and the OP will be updated as each is moved.
Aug 21 - Fixed a bug preventing the /sdcard/bdt directory from being installed on flash. Also made a few revisions to the code, nothing spectacular. Also uploaded to Box and Dropbox and ditched the Drive host. Incremental update to 1.2 0.
Good job buddy. Keep it up. Will give a try it soon.
Sent from my GT-I9100 using Tapatalk 2
Thanks! I'll be publishing an update in a day or so. I'm creating a stand alone project that won't require root. Right now root is required because the scripts need to access the JRE bin that's located in the data directory of apktool. I'm moving JRE lib (and Java binary) and smali and baksmali jars into a flashable zip.
It'll also be a lot easier to maintain this way. I completely killed my phone yesterday while cleaning up the scripts. After doing a batch deodex as it is now it will clean up the working directories and delete
everything except the deodexed archives.
I modified the paths hoping to create less work in the long run and after testing the modified script by phone rebooted back up and I got "unable to find setup" message and a blank screen. I must have left a "/" off of a path and ended up wiping everything in /sdcard/ ?
The error on boot was caused by the fact I always delete the LG setup app as I never anticipate deleting my SD card. So I was stuck at a black screen with nothing to restore since I wiped the SD card.
Eventually I realized I could pull the notification bar down still, and make it into settings by long pressing a quick toggle. Once I discovered I could open Google Now after enabling it in search settings I was in my way since I could use that to open Chrome and Root Explorer, etc.
I ended up restoring my system back and just wiped /data as well since I already wiped my SD card. Then spent the rest of the day restoring my device and luckily I had most everything backed up onto Drive.
Needless to say no changes were published in yesterday. I can imagine the backlash I would have gotten if I did lol. If I had a penny for each time I've mucked my device up while working on something I'd have, well maybe a dollar but still that's a lot
It shouldn't take long to get the standalone build out. I don't plan on turning the standalone build into an apk though as its easy enough to run via terminal emulator or file manager and take up far less space.
Sent from my VS980 4G using Tapatalk
I'll find another host to upload the install zip to as well as the Drive host in the OP. The zip is too large to attach here. I hope this simplification over installation appeals to more ?
Version 1.1.0 is now live. Installation boils down to just flashing the install zip in recovery. Read OP for additional information on how to use it.
Dang man! You beat me to it hahaha! I had started on this as a personal project for myself earlier today. However, I am wanting to just implement the process strictly through the recovery and by locating/finding all .odex files in my system to later deodex and place back accordingly all without me touching a thing but just running the script. I'm currently digging through your work right now to see if anything may be helpful for what I am aiming to do. Nevertheless, greatly appreciate you sharing this project.
How do you make an odexed apk into am installable apk? I wanna take the LG QVoice apk from an odexed rom and be able to install it like a normal app without having to add it to /system/app or /system/priv-app. Would just deodexing the apk do that?
Skizzy034 said:
How do you make an odexed apk into am installable apk? I wanna take the LG QVoice apk from an odexed rom and be able to install it like a normal app without having to add it to /system/app or /system/priv-app. Would just deodexing the apk do that?
Click to expand...
Click to collapse
You would most likely need to deodex that app and then install it via /data/app.
Make sure that system app you are referring to doesn't use any lib files or other dependencies. Some system apps do and it would be needed to port them over to your device for them to work (and possibly some work on the app itself once decompiled).
Sent from my C525c using Tapatalk
Modding.MyMind said:
You would most likely need to deodex that app and then install it via /data/app.
Make sure that system app you are referring to doesn't use any lib files or other dependencies. Some system apps do and it would be needed to port them over to your device for them to work (and possibly some work on the app itself once decompiled).
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Yea I didn't think of lib files for that app. It makes sense it would need it. Thanks.
Modding.MyMind said:
Dang man! You beat me to it hahaha! I had started on this as a personal project for myself earlier today. However, I am wanting to just implement the process strictly through the recovery and by locating/finding all .odex files in my system to later deodex and place back accordingly all without me touching a thing but just running the script. I'm currently digging through your work right now to see if anything may be helpful for what I am aiming to do. Nevertheless, greatly appreciate you sharing this project.
Click to expand...
Click to collapse
That's an awesome idea bro. You'd need the jre in /data/misc/jdr somewhere. You may be able to run it off the scars in recovery since you can set permissions to the /sdcard mount there but not sure.
Create a script that 'finds' all odex files system wide and corresponding archive files and use the run_program edify script command to run the script so that you can deodex everything from recovery with one slide of a button.
There's not too much that would have to be changed in the script other than changing some of working directory variables as you go. Be careful in the batch-deodex script if borrowing from that as that deletes all odex, apk, and jar files in the /BDT/*/ except for the readme files.
Edit: If you need any advice or help on that project hit me up, as I could probably get it working by the end of the day. Well sooner not this day as my son is here but tomorrow.. Sorry I didn't comment the script that much but there wasn't really much to comment, so I mainly just commented the paths.
MidnightHarvester said:
That's an awesome idea bro. You'd need the jre in /data/misc/jdr somewhere. You may be able to run it off the scars in recovery since you can set permissions to the /sdcard mount there but not sure.
Create a script that 'finds' all odex files system wide and corresponding archive files and use the run_program edify script command to run the script so that you can deodex everything from recovery with one slide of a button.
There's not too much that would have to be changed in the script other than changing some of working directory variables as you go. Be careful in the batch-deodex script if borrowing from that as that deletes all odex, apk, and jar files in the /BDT/*/ except for the readme files.
Click to expand...
Click to collapse
Thanks. I had already set up my project folder along with my deodex script before I came across this thread (what were the odds lol). Was having issues getting the script to work at all until I looked at yours and notice you were exporting the LD_LIBRARY path. I implemented that idea in my script and now I'm getting a few failures for linking executables based on certain commands such as grep for example.
The script is a combination of premade works from different people which I have put together as followed. Currently, the script is a bit rough on what I am aiming to do but my goal for now is to get it to successfully find and deodex all necessary files. Once accomplished, I will proceed forward.
Script:
PHP:
#!/sbin/sh
cd $(dirname "$0")
DEODEXED_APK="/data/DEODEXED.log"
if [ ! -f $DEODEXED_APK ]; then
busybox touch $DEODEXED_APK;
fi;
prop="/system"
smalibaksmali_dir="/data/local/tmp/smali"
java_dir="/data/local/tmp/jvm/java-7-openjdk-armhf/jre/bin/java"
#tmp="$(dirname "$1")"
export LD_LIBRARY_PATH="/data/local/tmp/jvm/java-7-openjdk-armhf"
# Deodexes every .odex file
DEODEX() {
local API="$(busybox grep "ro.build.version.sdk" "$prop/build.prop" | busybox cut -d'=' -f2)"
echo "Detected API level $API" >> $DEODEXED_APK
busybox find "$prop" -type f -iname "*.odex" | while read line; do
local FILE="$(basename "$line")"
local FILEDIR="$(dirname "$line")"
echo "Deodexing $FILE" >> $DEODEXED_APK
echo "Disassembling $FILE..." >> $DEODEXED_APK
$java_dir -Xmx512m -jar $smalibacksmali_dir/baksmali-2.0.2.jar -a "$API" -d "$prop/framework" -x "$FILEDIR/$FILE"
if [[ $? -ne 0 ]]; then
echo "ERROR DEODEXING $FILE, ABORTING!" >> $DEODEXED_APK
rm -rf out
return 1
fi
echo "Assembling into classes.dex..."
$java_dir -Xmx512m -jar $smalibacksmali_dir/smali-2.0.2.jar -a "$API" -o classes.dex out
if [[ ! -e classes.dex ]]; then
echo "ERROR DEODEXING $FILE, ABORTING!" >> $DEODEXED_APK
rm -rf out
return 1
fi
FILE="$(busybox echo "$FILE" | busybox rev | busybox cut -d'.' -f2- | busybox rev)"
local FOUND=0
for EXTENSION in "jar" "apk"; do
if [[ -e "$FILEDIR/$FILE.$EXTENSION" ]]; then
echo "Packing back into $FILE.$EXTENSION..."
zip -rq "$FILEDIR/$FILE.$EXTENSION" classes.dex
rm -f classes.dex
FOUND=1
break
fi
done
if [[ "$FOUND" -eq 0 ]]; then
echo "ERROR, No output found?!"
rm -rf out
rm -f classes.dex
return 1
fi
rm -f "$line"
rm -rf out
done
echo "Deodexing finished"
}
# Start Processing Here
DEODEX
Sent from my C525c using Tapatalk
Saved while I read script after kid stops jumping on me lol
LD_LIBRARY_PATH threw me off to. Somewhere in java or bad small or small expects it to point to the data/data/per.pqy.apktool/lix files.
MidnightHarvester said:
Exporting LD_LIBRARY_PATH and pointing that to wherever you have the lib files stored which in apktool are in /data/data/per.pqy.apktool/lix is key cause either java or baksmali or small reference that Android environment variable.
That took me a while too until I realized what I needed to do. You can cut down on size quite a bit and copy the lib files in /data/misc/bdt in my project as those are the only ones needed for smali and baksmali. With that figured out you'll have it done in no time. You could always flash these tools and then make a script like
Code:
# import my 'bdt' script
. /system/bin/bdt
# copy all odex, apks, and jars into files-to-deodex - could
# use lath variables instead of full pathnames
cp /system/app/. *odex /sdcard/BDT/files-to-deeodex
cp /system/app/. *apk /sdcard/BDT/files-to-deeodex
cp /system/priv-app/. *odex /sdcard/BDT/files-to-deeodex
cp /system/priv-app/. *apk /sdcard/BDT/files-to-deeodex
cp /system/framework/. *odex /sdcard/BDT/files-to-deeodex
cp /system/framework. *apk /sdcard/BDT/files-to-deeodex
# call batch-deodex function
batch-deodex
Then make sure all the deoxed archives are in the deodexed-out directory and if check a few make sure classes. dex are in them lol. Then if running from recovery, copy the new deodexed archives into appropriate places and set permissions (recursively unless you're insane ).
Sounds a lot like what you're doing though. Also gives me an idea for version 2 which also gives the option to deoxed the entire system and then create a flushable zip with all the deodexed archives inside. Will probably work on that tomorrow after my son is gone. Keep me posted ed on the progress on your work though as I haven't had much in out back regarding this.
Click to expand...
Click to collapse
I like your idea about making a flashable zip once it is done. I have it working now.
I made a small typo which resolved my earlier problem.
I used "smalibaksmali_dir" as my variable which pointed to the smali directory.
However, later in my script I spelled 'bak' with a 'c' - smalibacksmali_dir.
I will keep you posted man. I was shocked when i found your thread because prior to I had spoken with a relative about my project and how it appeared no one had done this. Then I found you lol. Kudos for your work bro.
Sent from my C525c using Tapatalk
---------- Post added at 07:54 PM ---------- Previous post was at 06:58 PM ----------
Here is a screenshot with my personal script/project running.
Sent from my C525c using Tapatalk
@MidnightHarvester, my script is working great now. However, I noticed that this bogs down the device greatly. To deodex the Rom from the device will take WAY TOO LONG then if you were to do so using a descent computer. However, if merely deodexing an app here or an app there then it's fine and tolerable but not for all *.odex files at once lol.
There has to be some way to make this move along faster. Otherwise, the wait begins for phones with better processors and more ram.
Sent from my C525c using Tapatalk
Modding.MyMind said:
@MidnightHarvester, my script is working great now. However, I noticed that this bogs down the device greatly. To deodex the Rom from the device will take WAY TOO LONG then if you were to do so using a descent computer. However, if merely deodexing an app here or an app there then it's fine and tolerable but not for all *.odex files at once lol.
There has to be some way to make this move along faster. Otherwise, the wait begins for phones with better processors and more ram.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
I'm pretty sure that the scripts are only utilizing one thread (unless I'm mistaken). Is there a way in bash to start a new thread or at least call on a binary and pass over a callback function? I'll have to look into it.
When I deodexing my /system/priv-app folder I just let it run overnight. There isn't anything really in the script I can do to speed things up much as the majority of the work is being used during the baksmali and smali calls.
That's one reason I didn't echo any output like your script did which I really wanted to but I've found that things tend to run faster without output being sent to stdout. Might not be a huge hit but...
Maybe if I an get it to deodex in recovery nobody would be competing for resources? Definitely keep updated on the thread as this isn't anywhere near done yet.
I'm glad I found somebody else working on this. For a while I thought no one was that interested since there has been PC tools to do this for ages. Problem is for some (like myself) is that THIS is my PC .
I'm trying to think on how to speed things up and drawing a blank. There aren't enough odex files in all of /system for there to be issued with looping. I think the baksmaling and smaling just take time. Take a look at Matt's old Privacy Blocker app (same Matt that developed xUltimate deodex tools on PC). It takes ages to baksmali and smali there as well.
My first early version though was even worse. I actually was decompiling resources as well in the archive and creating a smali folder and moving the decompiler source as well into there and recompiling the entire apk/jar lol. Don't ask me why.
I need to borrow an idea from you as well and let the user set API level. Normally omitting it should be fine (defaults to latest doesn't it?) but having the choices might help of anyone comes across a picky app.
In the meantime if deodexing am entire folder I'd recommend just doing it at night while you sleep. If you can, use a tool to enable all four cores and set all cores to performance mode and leave the Ax plugged in. *shrugs* I have AIDE installed so if I can get into the baksmali/smali source code maybe I can at least have a look.
Edit: I'm running a multithreading test now. You can run a command in another thread by placing '&' after the command. If it works I'll update.
@MidnightHarvester, I too use my device as it were my own computer which is why I make up the things which I do lol. Seems we have much in common. I actually learned about the idea of using multithreads with '&' just the other night as I was researching for ways to optimize my script. Another method is to use 'wait' which will put any future commands on hold until the current one is finished. That should out less stress on the cpu. Another idea is to limit the use of pipes. The more pipes being implemented the more usage the cpu has to dish out.
I believe flashing and running this in the recovery may speed this up as you mentioned that it would required less resources being used during operations, but the question is how much would the improvement be lol.
Keep me updated with using multithreads and feel free to take away whatever you find to be useful from my deodex script.
Expect many future changes to it to optimize it as much as possible.
In addition, using 'while read line' can increase the performance on speed if the following commands afterwards are not causing an overhaul.
Sent from my C525c using Tapatalk
---------- Post added at 03:10 PM ---------- Previous post was at 03:04 PM ----------
I will be pushing my project to my github later on today. Will be easier to keep up with any changes I make. Will take note in README.md that the project is still in development and to use with GRAVE caution lol.
Sent from my C525c using Tapatalk
---------- Post added at 03:13 PM ---------- Previous post was at 03:10 PM ----------
It's ashame I don't currently have any way to build the smali/baksmali sources from my phone.
Need to look in to it and see if any flags could optimize the final build to produce a more proficient workload in performance.
Sent from my C525c using Tapatalk
So, I am working on getting my project to work in the recovery. Looks like some troubleshooting is in store.
From my recovery.log:
Code:
about to run program [/tmp/deodex.sh] with 1 args
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
Detected API level
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "sort"; caused by library "libc.so" not found
Deodexing finished
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
run_program: child exited with status 1
Sent from my C525c using Tapatalk
---------- Post added at 05:33 PM ---------- Previous post was at 05:00 PM ----------
Resolved my problem. Export path for sbin was being overwritten by the script so it prevented busybox from being used. To resolve it you just need to insure that sbin is included to the path as well.
Edit: this was tested with TWRP
PHP:
export LD_LIBRARY_PATH="/sbin":"/tmp/jvm/java-7-openjdk-armhf"
Sent from my C525c using Tapatalk
:cyclop
Modding.MyMind said:
I like your idea about making a flashable zip once it is done. I have it working now.
I made a small typo which resolved my earlier problem.
I used "smalibaksmali_dir" as my variable which pointed to the smali directory.
However, later in my script I spelled 'bak' with a 'c' - smalibacksmali_dir.
I will keep you posted man. I was shocked when i found your thread because prior to I had spoken with a relative about my project and how it appeared no one had done this. Then I found you lol. Kudos for your work bro.
Sent from my C525c using Tapatalk
---------- Post added at 07:54 PM ---------- Previous post was at 06:58 PM ----------
Here is a screenshot with my personal script/project running.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
No probs cyclops. Between family I don't get a chance to get on hereuch but that's all changing here Very soon. I really glad you're taking off where i left off. I saw that there's a GUI out now I haven't read the thread yet so not sure if it's your work or not, but I'm glad others are running with it. Beauty of open source. I rewrote a lot and published to github under GPL but unfortunately during the rewriting I broke something and haven't been back to fox it yet.
I need to as yje code is streamlined as well as being on github open where all can see and make commits. I would get on that but it seems the GUI version has taken off and this is more for legacy but who knows
I also noticed someone else had a btch deodex script published on github though no as robust but I should have borrowed off him instead of reinventing the wheel. Too bad I didn't see that until later.
Inteied my luck at multithreading the shell commands but that would require a LOT of counters keeping track of example which processes are still decompiling and which are recompiling to avoid collisions, so I lwdr it be for now. And now that the GUI is out maybe ibcan lend a hand there if needed.
Is the GUI just a command line GUI or an actual app?I'll look when done reading. If it's an actual app multithreading would be much easier and i wouldn't mind helping out on the team. If its a shell GUI like old Windows apktool versions I commend you. Takes patience to mundnely write out the interface
Either way glas there's interest and happy others with more time to devote can carry on.
@MidnightHarvester
Hello sir,
I'm trying to decompile settings.apk with apktool for android. It won't do it correctly, and I'm wondering if it's because it should be deodexed first. The only 2 I've been able to recompile are htc-resources.apk and framework-res.apk on HTC Evo 3D 4.0.3ics
That's first question, will be able to recompile settings after deodex?
I don't understand this command,
. /system/bin/bdt
bbdth-smali
Are these on one line, separate?
I'm fairly new to modding, will you help me please?
The commands listed, when pasted into terminal, errors a lot. Using SManager to run works, but what is got from it isn't a deodexed app.-
When running batch-deodex(I'm using bdt from v.1.1.0 because it throws out several errors with bdt from v.1.2.0, I haven't looked through it, so I'm not sure if it's just not echo ing them), well, first I put the settings.apk in files-to-deodex folder, create odex of it in apktool(is this right thing to do?) Settings.odex is created in same folder, then ran batch-deodex.
The exact same settings.odex is placed into files-to-baksmali. And same settings.apk is placed in deodexed-out. In the dex-out folder are same 2 files called classes.dex and Settings.dex. and in the smali-source is Settings folder with a boat load of smalis.
After it's done:
exec sh '/system/bin/batch-deodex'
in/batch-deodex' <
rm failed for -rf, No such file or directory
rm failed for -f, No such file or directory
cp: can't stat '/sdcard/BDT/files-to-deodex/*.jar': No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
And here's the log
Error occured while loading boot class path files. Aborting. org.jf.util.ExceptionWithContext: Cannot locate boot class path file /system/framework/conscrypt.odex at org.jf.dexlib2.analysis.ClassPath.loadClassPathEntry(ClassPat h.java:217) at org.jf.dexlib2.analysis.ClassPath.fromClassPath(ClassPath.jav a:161) at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:59) at org.jf.baksmali.main.main(main.java:274)
What am I doing wrong?
How do I get to having deodexed app?
Sent from above using xparent tapatalk blue

please delete thread

// issue solved by switching off some services
please delete this thread.

[WAR MOD] || CPU & VM Tweaks | Battery Saving

Please read this entire post before doing anything.
Pretty straight forward modification that will increase performance and save battery life. You must be rooted to apply this.
Drop this file: https://drive.google.com/file/d/1h0ET7pYHdPB32v-ZtK5pEMlwlHNn8O46/view?usp=drivesdk
... into this location (replacing the existing stock one):
Code:
/system/vendor/bin
Basically, there is a file in that sub-folder "init.qcom.post_boot.sh"
You are replacing that file with mine, which I've made the following changes to:
-modified hispeed_freq and hispeed_load parameter for both CPU clusters so they run more efficiently
-modified vm parameters in /proc/sys/vm to allow a little more RAM to be used. USE YOUR RAM, that's what it is for! I don't like having a full 900Mb of free RAM, then having apps refresh when they are opened again.
-added a script to limit the maximum display brightness (this is still very usable, but it will be more power friendly. The stock settings are way too aggressive)
- there will be much more to come, this is just to start us off
Also, after you drop the new file into the folder, change the permissions to:
Code:
rwxr-xr-x
then reboot/power up
The .sh file executes on its own after each boot. No more CPU apps.
You will see a noticeable difference in battery life and performance. :good:
Yes could you please give me step by step on how I post apply this to my device because I cannot give it permission and then when I do get to permission changed it keeps saying that ignore it it snow please help
Hey bro,
Can you make this mod for the sdm 636?
TKS
---------- Post added at 03:35 PM ---------- Previous post was at 02:58 PM ----------
what is the soc_id of your device?
Igorfmedeiros said:
Hey bro,
Can you make this mod for the sdm 636?
TKS
---------- Post added at 03:35 PM ---------- Previous post was at 02:58 PM ----------
what is the soc_id of your device?
Click to expand...
Click to collapse
SMD632 is the ID.
Pretty sure yours is SMD636
replace file let's see if anything improves
original file has size 200k
your 41k
restart system has again 200k
this is normal ?
How is this working for those that have used it?
I'm curious too..I've benchmarked my G7 and got a baseline for performance and will eventually try this to see if it improved things..but first I plan on trying some of the tweaks available in Magisk.
this mod doesn't seem to stick as it always reverts to the stock file. why not just make a custom flashable kernel?
Is there guidance to make the change persistent after a reboot. This is my first A/B device and things seems little different now. I am unsure if Motorola is restoring the vendor partition or if the reset isn't related to something else.
I've been trying to avoid installing TWRP due to lack of development and was hoping to apply this with either the stock recovery of just in the file system.
*edit.
I guess Ill look into disabling dim-verity without TWRP, I think I saw a way to do it. Or maybe boot TWRP from the command line instead of installing it.
I made a magisk module to load this file.
See Page 2 to download.
Download ?
idcamper said:
Download ?
Click to expand...
Click to collapse
*module fixed
Use Magisk to make this change stick
*module fixed, we down a few posts.
HT123 said:
I made a magisk module to load this file.
Let me know if anyone wants it.
I went this route becuase I didn't want to install TWRP yet.
Click to expand...
Click to collapse
The unofficial Twrp actually works quite well on my Moto G7.
maybeme2 said:
The unofficial Twrp actually works quite well on my Moto G7.
Click to expand...
Click to collapse
Without anyone making twrp flashable zips of the updates I am remiss to install it. If more mods come along that require workarounds like this one I will pull the trigger but for now, this one change does not warrant TWRP for me anyway.
HT123 said:
I made a magisk module to load this file.
Let me know if anyone wants it.
I went this route becuase I didn't want to install TWRP yet.
Click to expand...
Click to collapse
can you send me?
absvini said:
can you send me?
Click to expand...
Click to collapse
*module fixed
Magisk Module fixed
HT123 said:
The mod didn't work. While the file was replaced, it was not processed, look up a few posts to see how to do it without a module.
Click to expand...
Click to collapse
Someone can feel free to fix my misspelling of Kernel in the mod as well.
I had some free time this morning and I fixed the module. I have no idea if it helps or not.
It does not include everything in the original post, only the changes at the bottom. I take no credit or responsibility for this, all I did was turn the changes into Magisk Module. The code below is the changes that get made.
Code:
# WarBeard mods
#
sleep 20
# Adjust CPU parameters to save battery
echo 1036800 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq
echo 75 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_load
echo 1401600 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_freq
echo 95 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_load
# Adjust VM parameters
echo 10 > /proc/sys/vm/dirty_background_ratio
echo 4 > /proc/sys/vm/dirty_expire_centisecs
echo 20 > /proc/sys/vm/dirty_ratio
echo 8 > /proc/sys/vm/dirty_writeback_centisecs
echo 100 > /proc/sys/vm/swappiness
echo 50 > /proc/sys/vm/vfs_cache_pressure
# Limit maximum brightness of display
echo 150 > /sys/class/leds/lcd-backlight/max_brightness
[\code]
idcamper said:
replace file let's see if anything improves
original file has size 200k
your 41k
restart system has again 200k
this is normal ?
Click to expand...
Click to collapse
Same happens to me, just rebooted. I'll check my current file with the one he uploaded on Google Drive by comparing them in a text editor?
HT123 said:
Someone can feel free to fix my misspelling of Kernel in the mod as well.
I had some free time this morning and I fixed the module. I have no idea if it helps or not.
It does not include everything in the original post, only the changes at the bottom. I take no credit or responsibility for this, all I did was turn the changes into Magisk Module. The code below is the changes that get made.
Code:
# WarBeard mods
#
sleep 20
# Adjust CPU parameters to save battery
echo 1036800 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq
echo 75 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_load
echo 1401600 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_freq
echo 95 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_load
# Adjust VM parameters
echo 10 > /proc/sys/vm/dirty_background_ratio
echo 4 > /proc/sys/vm/dirty_expire_centisecs
echo 20 > /proc/sys/vm/dirty_ratio
echo 8 > /proc/sys/vm/dirty_writeback_centisecs
echo 100 > /proc/sys/vm/swappiness
echo 50 > /proc/sys/vm/vfs_cache_pressure
# Limit maximum brightness of display
echo 150 > /sys/class/leds/lcd-backlight/max_brightness
[\code][/QUOTE]
This Magisk module provides the exact same thing as the .sh file in the original post? The exact same benefits?
Click to expand...
Click to collapse
HT123 said:
Someone can feel free to fix my misspelling of Kernel in the mod as well.
I had some free time this morning and I fixed the module. I have no idea if it helps or not.
It does not include everything in the original post, only the changes at the bottom. I take no credit or responsibility for this, all I did was turn the changes into Magisk Module. The code below is the changes that get made.
Code:
# WarBeard mods
#
sleep 20
# Adjust CPU parameters to save battery
echo 1036800 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq
echo 75 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_load
echo 1401600 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_freq
echo 95 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_load
# Adjust VM parameters
echo 10 > /proc/sys/vm/dirty_background_ratio
echo 4 > /proc/sys/vm/dirty_expire_centisecs
echo 20 > /proc/sys/vm/dirty_ratio
echo 8 > /proc/sys/vm/dirty_writeback_centisecs
echo 100 > /proc/sys/vm/swappiness
echo 50 > /proc/sys/vm/vfs_cache_pressure
# Limit maximum brightness of display
echo 150 > /sys/class/leds/lcd-backlight/max_brightness
[\code][/QUOTE]
I notice quite a difference
Click to expand...
Click to collapse

Categories

Resources