[GUIDE] How to enable network location in Mi3/4 WCDMA - Mi 3 Android Development

Hi all!
After some tests, finally I got the network location working outside China. This fix is needed to have the Weather app working correctly. I also have published it in http://en.miui.com/thread-70357-1-1.html, but I wanted to share it in XDA, that has helped me for so many times.
Before continue reading, keep in mind that is supposed that you already know how to use apktool.
Here we go:
1. Pull the framework-res.apk from your phone or from a ROM.
2. Decompile framework-res.apk
3. Check the file res/values/strings.xml
- Find this line:
Code:
<string name="config_networkLocationProviderPackageName">com.amap.android.location</string>
- Change that line into this one:
Code:
<string name="config_networkLocationProviderPackageName">@null</string>
- Find this another line:
Code:
<string name="config_fusedLocationProviderPackageName">com.qualcomm.location</string>
- Change that line into this one:
Code:
<string name="config_fusedLocationProviderPackageName">com.android.location.fused</string>
4. Check the file res/values/bools.xml:
- Find this line:
Code:
<bool name="config_enableNetworkLocationOverlay">false</bool>
- Change that line into this one:
Code:
<bool name="config_enableNetworkLocationOverlay">true</bool>
- Find this another line:
Code:
<bool name="config_enableFusedLocationOverlay">false</bool>
- Change that line into this one:
Code:
<bool name="config_enableFusedLocationOverlay">true</bool>
5. Compile framework-res.apk and push it to your ROM/phone (remember to apply the correct permissions -644-)
6. Delete the app /system/app/AMAPNetworkLocation.apk
7. Reboot in recovery and wipe cache and Dalvik.
8. In the next reboot, a message appears asking to allow to Google to locate you. If you agree to that message, the network location will work correctly.
9. Voilà! The Weather app now is locating correctly.
Thanks to Redber and Faralai for their help.

My weather app always located my position correctly.. i don't know why some people have this problem...

a.broken.star said:
My weather app always located my position correctly.. i don't know why some people have this problem...
Click to expand...
Click to collapse
In Spain we all have had this problem, and the process above is the solution I found.

koboldo said:
In Spain we all have had this problem, and the process above is the solution I found.
Click to expand...
Click to collapse
Ohk... oooopss... sorry...

Related

[How to] noobs guide to decompile/recompile android application

Guide to decompile android application​
REQUIREMENT
Apktool [click here to download][Thanks to brut.all for this apktool]
Java JDK/JRE 32 bit [please google it guy's]
Little knowledge on cmd
_________________________________________________________________________________________________________________________
Preparation before WORKING
Process :-
1)now install the java in your pc/lappy
then copy the apktool.zip & goto directory C:/
make a folder name apktool (u can name it by watever u like)
now goto that folder & paste the zip
extract that zip there...
2) now copy the .apk or jar file which u wnt to decompile
& paste it on apktool folder.....
also copy the framework-res.apk of that rom &
paste it on that folder..
Decompiling application
3) now open cmd
Your cmd will probly look like this..
C:\users\yourname>
so type in
cd.. (yes include the '..' and press enter after you type each command)
this will get you to back directory so now you will see
C:\users>
so type again
cd..
you should now see this:
C:\>
now type
cd apktool (and you are in the apktool directory)
4)Installing Framework
Now that you are in directory we need to install the device's framework to your system for it to compile correctly so type this:
apktool if framework-res.apk
this will install the devices framework to your system (need to do this)
5)now to decompile the apk you want to edit.. type this:
apktool d music.apk mod
music.apk is the apk your decompiling
mod is the folder you're creating for the decompiled apk
do whatever you want to do with your apk...
NOW RECOMPILING
6)now to recompile your new apk type this:
apktool b mod music-new.apk
mod is the folder with your edited files
music-new.apk is your new apk file
Now we are NOT done... we cannot use the new apk's...
now make two separate folder a & b
copy-paste the original music.apk in 'a'
& music-new.apk in 'b'
use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "new-edited" apk and copy them into Original apk
now add to archive ...the origanl apk in zip format
& at the end of the file name .apk ( i mean give the file format name as .apk insted of .zip)
Now you are almost done.....:thumbup:
IF it is a system app then don't sign it....otherwise u have to sign that app....
[=>Guide On How To Sign The Moded App<=]
NOTE:- If you are getting this error =>" java is not a recognized internal or external command "
[=>Then Follow this Guide<=][Thanks to KartzXDA]:good:
That's all
don't forget to hit thanks or comment....:good:
All Mod-Rom by Abhijit Guha(mee)
1} X-zooM[V2] (Netlock free : Transparent Rom):good:​
2}Tutorial On Decompiling Android Apps​
3.Guide To Make Transparent Power Widget​.
4.Guide To Change Statusbar Clock & Notification colour​.
5.Guide On How To Sign The Moded App​.
6.Guide On How To SetUp Environmental Variables​
cool.........
thank for nice guide
sent from my ass ®
Insted of so much to cd folder just right click the folder while holding shift button and you will see adbance options... now open command prompt.. It will save time and is very easy ....
Sent from my GT-S7500 using xda premium
lokeshsaini94 said:
Insted of so much to cd folder just right click the folder while holding shift button and you will see adbance options... now open command prompt.. It will save time and is very easy ....
Sent from my GT-S7500 using xda premium
Click to expand...
Click to collapse
I think you haven't followed something...... this guide is for begginers...so it should be simple one.... not eeky
This is simple method to cd a folder in cmd without all that long commands.... I always use it... Try it once and you will know what i am trying to say....
Sent from my GT-S7500 using xda premium
Thank s for this awesome guide
Sent from my Galaxy Nexus using Tapatalk 2
Awesome guide, very simple to decompile and recompile with it.
Cool guide! I will use it to do some tests with my apks
solved problem lol ... good tutorial ...
xda facebook page should share more tutorials like this!!
Yeah mine says java is not a recognized internal or external command, operable program or batch file. I probably have to add the environment variable, but im not sure how to.
EDIT: got it.
AlwaysDroid said:
Yeah mine says java is not a recognized internal or external command, operable program or batch file. I probably have to add the environment variable, but im not sure how to.
EDIT: got it.
Click to expand...
Click to collapse
You getting this error coz you giving those command in some other directory.........
Note:- First u have to go th that directory or folder where ur apktool files are kept...... then u will not get such error......
Follow that guide from begging then u will get wat I wanna say. best of luck :good:
aguha1044 said:
You getting this error coz you giving those command in some other directory.........
Note:- First u have to go th that directory or folder where ur apktool files are kept...... then u will not get such error......
Follow that guide from begging then u will get wat I wanna say. best of luck :good:
Click to expand...
Click to collapse
No, I just forgot to add the java bin to PATH variable. All good
Sent from my GT-I9000 using xda premium
For the OP. Some ROMs like miui ROM use two frameworks ( framework-res.apk and framework-miui-res.apk) so you need to specify that on the guide. I am just trying to help
tapatalked² cowsquadGnex®
AlwaysDroid said:
No, I just forgot to add the java bin to PATH variable. All good
Sent from my GT-I9000 using xda premium
Click to expand...
Click to collapse
can you tell how to add JAVA bin? I am getting the same error on cmd. thank you
How to setup the environment variable
zain0300 said:
can you tell how to add JAVA bin? I am getting the same error on cmd. thank you
Click to expand...
Click to collapse
TECHNICAL INFORMATION
The PATH is the system variable that your operating system uses to locate needed executables from the command line or Terminal window.
The PATH system variable can be set using System Utility in control panel on Windows, or in your shell's startup file on Linux and Solaris.
SOLUTION
Here PATH represents the bin path of installed version of Java that contains classes. (e.g. C:/jdk1.6.0/bin)
Setting Path on Windows
Windows 7
1. Select Computer from the Start menu
2. Choose System Properties from the context menu
3. Click Advanced system settings > Advanced tab
4. Click on Environment Variables, under System Variables, find PATH, and click on it.
5. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH,
you may select to add a new variable and add PATH as the name and the location of the class as the value.
6. Reopen Command prompt window, and run your java code.
Windows XP
1. Start -> Control Panel -> System -> Advanced
2. Click on Environment Variables, under System Variables, find PATH, and click on it.
3. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH,
you may select to add a new variable and add PATH as the name and the location of the class as the value.
4. Close the window.
5. Reopen Command prompt window, and run your java code.
Windows Vista
1. Right click My Computer icon
2. Choose Properties from the context menu
3. Click Advanced tab (Advanced system settings link in Vista)
4. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may
select to add a new variable and add PATH as the name and the location of the class as the value.
5. Reopen Command prompt window, and run your java code.
Setting Path on Solaris and Linux
To find out if the java executable is in your PATH, execute:
% java -version
This will print the version of the java executable, if it can find it. If you get error java: Command not found. Then path is not properly set.
To find out which java executable the first one found in your PATH, execute:
% which java
Below are the steps to set the PATH permanently,
Giving instructions for two most popular Shells on Linux and Solaris.
For bash Shell:
Edit the startup file (~/ .bashrc)
Modify PATH variable:
PATH="$PATH":/usr/local/jdk1.6.0/bin
export PATH
Save and close the file
Open new Terminal window
Verify the PATH is set properly
% java -version
For C Shell (csh):
Edit startup file (~/ .cshrc)
Set Path
set path="$PATH":/usr/local/jdk1.6.0/bin
Save and Close the file
Open new Terminal window
Verify the PATH is set properly
% java -version
Hit "Thanks" if anyone helped you. :good:
Xperia Arc LT15i
Rooted/Bootloader Unlocked
JellyBean - FXP137/CM10
KartzXDA said:
TECHNICAL INFORMATION
The PATH is the system variable that your operating system uses to locate needed executables from the command line or Terminal window.
The PATH system variable can be set using System Utility in control panel on Windows, or in your shell's startup file on Linux and Solaris.
SOLUTION
Here PATH represents the bin path of installed version of Java that contains classes. (e.g. C:/jdk1.6.0/bin)
Setting Path on Windows
Windows 7
1. Select Computer from the Start menu
2. Choose System Properties from the context menu
3. Click Advanced system settings > Advanced tab
4. Click on Environment Variables, under System Variables, find PATH, and click on it.
5. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH,
you may select to add a new variable and add PATH as the name and the location of the class as the value.
6. Reopen Command prompt window, and run your java code.
Windows XP
1. Start -> Control Panel -> System -> Advanced
2. Click on Environment Variables, under System Variables, find PATH, and click on it.
3. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH,
you may select to add a new variable and add PATH as the name and the location of the class as the value.
4. Close the window.
5. Reopen Command prompt window, and run your java code.
Windows Vista
1. Right click My Computer icon
2. Choose Properties from the context menu
3. Click Advanced tab (Advanced system settings link in Vista)
4. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may
select to add a new variable and add PATH as the name and the location of the class as the value.
5. Reopen Command prompt window, and run your java code.
Setting Path on Solaris and Linux
To find out if the java executable is in your PATH, execute:
% java -version
This will print the version of the java executable, if it can find it. If you get error java: Command not found. Then path is not properly set.
To find out which java executable the first one found in your PATH, execute:
% which java
Below are the steps to set the PATH permanently,
Giving instructions for two most popular Shells on Linux and Solaris.
For bash Shell:
Edit the startup file (~/ .bashrc)
Modify PATH variable:
PATH="$PATH":/usr/local/jdk1.6.0/bin
export PATH
Save and close the file
Open new Terminal window
Verify the PATH is set properly
% java -version
For C Shell (csh):
Edit startup file (~/ .cshrc)
Set Path
set path="$PATH":/usr/local/jdk1.6.0/bin
Save and Close the file
Open new Terminal window
Verify the PATH is set properly
% java -version
Hit "Thanks" if anyone helped you. :good:
Xperia Arc LT15i
Rooted/Bootloader Unlocked
JellyBean - FXP137/CM10
Click to expand...
Click to collapse
i read all this but still could not figured it out since there were few options i did not find on my windows 7 laptop.
Edit: Ok i found all the options now but what does this mean "modify PATH by adding the location of the class to the value for PATH"?
zain0300 said:
i read all this but still could not figured it out since there were few options i did not find on my windows 7 laptop.
Edit: Ok i found all the options now but what does this mean "modify PATH by adding the location of the class to the value for PATH"?
Click to expand...
Click to collapse
Under system variables, find for the variable Path. Click on Edit. Then one window will come up with two text boxes. One is variable name and another one is variable value. Edit the variable value of text box. Add the the path of bin ( e.g., ; C:\jdk\bin [Don't forget to add semicolon before the path]) to the text box.
Please have a look at the attachments.
Hit "Thanks" if anyone helped you.
Xperia Arc LT15i
Rooted/Bootloader Unlocked
JellyBean - FXP137/CM10
KartzXDA said:
Under system variables, find for the variable Path. Click on Edit. Then one window will come up with two text boxes. One is variable name and another one is variable value. Edit the variable value of text box. Add the the path of bin ( e.g., ; C:\jdk\bin [Don't forget to add semicolon before the path]) to the text box.
Please have a look at the attachments.
Hit "Thanks" if anyone helped you.
Xperia Arc LT15i
Rooted/Bootloader Unlocked
JellyBean - FXP137/CM10
Click to expand...
Click to collapse
thankx for your replies. I mistakenly deleted all the other paths that were already there, can I bring them back?
thanks button pushed.
zain0300 said:
thankx for your replies. I mistakenly deleted all the other paths that were already there, can I bring them back?
thanks button pushed.
Click to expand...
Click to collapse
copy this in the path variable value after that add ;C:\jdk....\bin
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShel l\v1.0\
Hit "Thanks" if anyone helped you. :good:
Xperia Arc LT15i
Rooted/Bootloader Unlocked
JellyBean - FXP137/CM10

[GUIDE] Beginners/Ref Guide to Making Roms.

Hi guys! I see many people trying to learn how to make roms, Here i show the easiest and shortest way on how anyone can begin making roms for the Galaxy S3. ​
Requirements:
Prepared CWM Stock Package.
Apktool
7-zip
Notepad ++
Setting Up, and Introduction​
IF you have downloaded firmware from sammobile instead of zoot1's package, use this part for Setting up and introduction: http://forum.xda-developers.com/showpost.php?p=37812381&postcount=33
OR ELSE THE EASIER WAY
To start with, Download the prepared CWM Stock Rom by zoot1 here: http://forum.xda-developers.com/showthread.php?t=1868004
I personally use firmware from sammobile, because i like to do everything myself. Though this method would be easier for beginners.
Extract the zip file to folder called "ROM".
Now lets head towards the customizing.
Thanks to Prawesome alot for this part. I took some info from his guide.
So now, open up the system folder. You'll find loads of folders in it. Here is a brief introduction to each of those folders:
1. apps
When you open this folder. You will find apk's. An apk is an install-able app package for any Android Device.
You can delete specific apps incase you want to delete. But take extra precautions on what you're deleting. As some apps are useful. You can add apps here as well in formats of apk's. But note, adding Play Store apps to the system/app folder is not recommended. For example you don't want Google Talk in your rom, you just have to delete the Talk.apk.
2. bin
Nothing really to mod in this folder. Full of advanced techy stuff. xD
3. etc
Here is where most of the tweaks come in. There is a folder called init.d where mods like the V6 Supercharger or multi-tasking fixes can be applied. Note! Don't add more than 1 or 2 scripts. Most of them usually conflict with each other.
In the gps.conf file, you can edit your gps info to make the gps more accurate. Pretty good guides about this, search them out.
Next is the hosts file. Devs use this to block sites from generating ads, and keeping their roms ad-free. Take a look at my DroidS3 hosts file, there are over 20,000 hosts blocked. You can use the same hosts file for your rom too.
4. Fonts
Very easy folder to understand. All you need to do here is replace ttf files, and you'll change the fonts.
5. Framework
Here is where the big mods come in. I'll explain further on about this. It contains the android.policy.jar, a useful element to add many mods. Framework-res is used to change wallpapers and theme the rom. I'll explain later.
6. libs
Contains all the libs needed for specific system apps to work. Don't mess here unless you're adding a mod.
7. Folders like csc, hdic, sipdb, wakeupdata, vendor, excetra..
These are the folders, there isn't much to do. Csc folder contains the feature.xml where some mods can be added. Search the forums for that. The rest contain multi-languages and more stuff.
8. xbin folder
Used to add scripts like busybox, dexdump, openvpn support. More like the bin folder but smaller.
9. Build.prop
Ever wondered how some roms have android 5.0, when it hasn't even released? All you need to change is the ro.build.version.release to any number you like. Even Android 20! Go change it, and fool some noobs out there. More mods can be added to this file. e.g:
Code:
debug.sf.hw=1
video.accelerate.hw=1
debug.performance.tuning=1
profiler.force_disable_err_rpt=1
profiler.force_disable_ulog=1
ro.config.nocheckin=1
ro.media.enc.jpeg.quality=100
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
ro.telephony.call_ring.delay=0
ro.lge.proximity.delay=15
mot.proximity.delay=15
ro.ril.disable.power.collapse=0
pm.sleep_mode=1
ro.config.nocheckin=1
The codes listed above are for improving jpeg quality, saving some battery life, reducing call delay and more. Search for build.prop mods, you'll find loads of them. ​Now, a small explanation of the Meta-inf folder.
In Meta-Inf you'll find the updater-script.
Since this is aimed at beginners, I'll just show you how to change what text is shown during install in CWM.
Just edit what's in the quotes of the ui_print code in the file, and enter your own text. e.g:
Code:
ui_print("Hi, This message in quotes is displayed in recovery");
Modding!​
It's time for the modding to begin.
Get apktool from: http://forum.xda-developers.com/showthread.php?t=1755243
Now, first copy your framework-res from the /system/framework directory to where you extracted apktool files. Let's call this folder "apktool"
Open the folder apktool, press shift and right click. Click on "Open command window here". Type:
Code:
apktool if framework-res.apk
Now you are ready to decompile apk's.
I'm going to show you how to mod different files. Copy over:
SystemUI.apk
android.policy.jar
framework-res.apk
1. SystemUI.apk
Just showing you basic modding here. Copy over SystemUI.apk to apktool folder. In the command prompt, type
Code:
apktool d SystemUI.apk
After it's done, you should see a SystemUI folder in the apktool directory.
I'm going to show you how to make the status bar transparent, thanks to raubkatze for this part.
Navigate to res/layout/tw_super_status_bar.xml and change android:background to match the red line.
Code:
<com.android.systemui.statusbar.phone.StatusBarWindowView [B][COLOR="Red"]android:background="#00000000[/COLOR][/B]" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
Save and close.
Then navigate to /res/values/drawables.xml
Edit to match:
Code:
<item type="drawable" name="status_bar_background">[COLOR="red"][B]#00000000[/B][/COLOR]</item>
That's it. Save and close.
Go back to your command prompt and type
Code:
apktool b SystemUI SystemUI-new.apk
After it's done, probably will take around 5-10 minutes. You'll find SystemUI-new.apk in your apktool folder. Open both SystemUI.apk and SystemUI-new.apk with 7-zip. Delete AndroidManifest.xml from SystemUI-new.apk and copy AndroidManifest.xml and META-INF from SystemUI.apk to SystemUI-new.apk
That's it. Close the zip files.
If you have adb or android-sdk push SystemUI-new.apk to your phone using:
Code:
adb remount
adb push SystemUI-new.apk /system/app/SystemUI.apk
adb reboot
If you don't have adb, just copy over SystemUI-new.apk to your phone. Rename it to SystemUI.apk and copy to system/app with root explorer. Reboot.
There you have transparent statusbar now! ​
2. android.policy.jar
Decompile android.policy.jar with:
Code:
apktool d android.policy.jar
You will find android.policy.jar.out, open it and use Cristiano Matos guide to mod the files: http://forum.xda-developers.com/showthread.php?t=2018633
After that use:
Code:
apktool b android.policy.jar.out
Open the android.policy.jar.out folder, you will find a dist folder created and inside that is your modified android.policy.jar.
You can use adb again by:
Code:
adb push android.policy.jar /system/framework
or the normal root explorer method. ​
3. framework-res.apk
Here i'll show you small mods.
Decompile it using
Code:
apktool d framework-res.apk
Navigate to res/values/bools.xml. ​Here you can add these. Thanks to DSA for this! :
4 Way Rotation:
Code:
Code:
<bool name="config_allowAllRotations">false</bool>
Change to:
Code:
Code:
<bool name="config_allowAllRotations">true</bool>
Lock Screen Rotation:
Code:
Code:
<bool name="config_enableLockScreenRotation">false</bool>
Change to:
Code:
Code:
<bool name="config_enableLockScreenRotation">true</bool>
and
Code:
Code:
<bool name="lockscreen_isPortrait">true</bool>
change to
Code:
Code:
<bool name="lockscreen_isPortrait">false</bool>
Disable Keyboard Switch In StatusBar When Typing
Code:
Code:
<bool name="show_ongoing_ime_switcher">true</bool>
Change to:
Code:
Code:
<bool name="show_ongoing_ime_switcher">false</bool>
Unplugging From USB doesn't Turn Screen On
Code:
Code:
<bool name="config_unplugTurnsOnScreen">true</bool>
Change to:
Code:
Code:
<bool name="config_unplugTurnsOnScreen">false</bool>[/indent]
Now to change wallpaper. Change the default_wallpaper.jpg in drawable-xhdpi and to change lockscreen wallpaper change keyguard_default_wallpaper.jpg.
Now recompile using:
Code:
apktool b framework-res framework-new.apk
Delete AndroidManifest.xml from framework-new. Copy AndroidManifest.xml and META-INF from framework-res.apk to framework-new.apk
To test use adb:
Code:
adb push framework-new.apk /system/framework/framework-res.apk
Or rename to framework-res.apk and copy to system/framework using root explorer. Reboot.​
Once you've added everything, your modified apks. Ui_print mods, A custom kernel (just replace boot.img) it's time to compile. Now this is really easy. Just highlight all the folders/files like system, meta-inf and boot.img. Right click. Hover over 7-zip and click Add to Rom.zip. Wait for it to be done, and copy Rom.zip to your sd card and flash. Voila! You've made your rom!!​
You can get more mods to add from here: http://forum.xda-developers.com/showpost.php?p=26583654&postcount=4
I was a beginner once, everyone was a beginner once. People helped me, and now I want to help people.
Press the Thanks button, and/or rate this thread 5 stars to show your support. ​
FAQ
- How do i add a mod?
To add a mod, just download it. Open it and copy over all the folders from the zip file EXCEPT the META-INF.
- How can i set up apktool on windows?
To set up apktool on windows, you need aapt, apktool.jar and apktool.bat
- My modified apk is not working?
Do some testing and get to know what went wrong. I'm always here. I'll be glad to help.
- Are these the only apps i can modify?
Ofcourse not! Any apk can be modified. Just decompile it, and make your changes.
- I'm looking for a guide on something i want to learn. Can you add it here?
I'll try my best.​​​
Reserved
Reserved one more.
Any feedback guys? I hope this is useful.
Forget that i had to reserve one more.
R: [GUIDE] Beginners/Ref Guide to Making Roms.
Looks interesting...when i will finish my exam i will check with more attention
Sent from my GT-I9300 using xda app-developers app
Willy89 said:
Looks interesting...when i will finish my exam i will check with more attention
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
Thanks. Glad it's of help.
Sent from my GT-I9300 using xda premium
Thnx for making this thread.
It's always useful to read thread's like this.
Nice job.
Verzonden door mijn GT-I9300 met xda premium
Great guide, thanks, I will point Theshawty in this direction :thumbup::thumbup:
slaphead20 said:
Great guide, thanks, I will point Theshawty in this direction :thumbup::thumbup:
Click to expand...
Click to collapse
Too late old man. Not interested in building roms anymore.
Thanks guys.
If there's anything you'd like to have added.
Let me know.
AW: [GUIDE] Beginners/Ref Guide to Making Roms.
Thanks. That's it what i searched for to start. Great.
weli..this would be intersting..and will c hw thread moves...
I Need Help In Building the ROM
Hi,
I am steinert. i need your help in biulding the rom, actually i finished everything but getting the problem while flashing the rom. when i googled it. i came to know that the problem lies in updater-script. i used root explorer to find out the reason. it was like.
FINISHED EXECUTING SCRIPT FILE
EXIT VALUE:126
STDOUT:
NULL
STDERR:
SH:<STDIN>[1]:/CACHE/RECOVERY/LAST_LOG:CAN'T EXECUTEERMISSION DENIED.
I Hope that You help a NOOB like me....
Thank you in advance....
Jacqueline Steinert said:
Hi,
I am steinert. i need your help in biulding the rom, actually i finished everything but getting the problem while flashing the rom. when i googled it. i came to know that the problem lies in updater-script. i used root explorer to find out the reason. it was like.
FINISHED EXECUTING SCRIPT FILE
EXIT VALUE:126
STDOUT:
NULL
STDERR:
SH:<STDIN>[1]:/CACHE/RECOVERY/LAST_LOG:CAN'T EXECUTEERMISSION DENIED.
I Hope that You help a NOOB like me....
Thank you in advance....
Click to expand...
Click to collapse
After flashing the rom.
Check the error through Advanced > Show recovery log in recovery.
Post results here.
I : checking for entendedcommand..
I : skipping execution of extendedcommand, file not found...
Jacqueline Steinert said:
I : checking for entendedcommand..
I : skipping execution of extendedcommand, file not found...
Click to expand...
Click to collapse
Huh?
Get me a screenshot of your meta-inf/com/google/android directory.
What exactly did you modify? It should work if you left the meta-inf untouched.
masterex567 said:
Huh?
Get me a screenshot of your meta-inf/com/google/android directory.
What exactly did you modify? It should work if you left the meta-inf untouched.
Click to expand...
Click to collapse
I just removed all the apps and inserted new apps...!!
Should i send you my updater-script?
Jacqueline Steinert said:
I just removed all the apps and inserted new apps...!!
Should i send you my updater-script?
Click to expand...
Click to collapse
Removed all?
Some are core apps like SystemUI, etc.
Get me a screenshot of your rom.zip..
masterex567 said:
Removed all?
Some are core apps like SystemUI, etc.
Get me a screenshot of your rom.zip..
Click to expand...
Click to collapse
{
"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"
}
This is the screenshot of my rom..! and before also i got the same problem with out changing the system .apk's
Jacqueline Steinert said:
View attachment 1700664
This is the screenshot of my rom..! and before also i got the same problem with out changing the system .apk's
Click to expand...
Click to collapse
Highlight those 3 and in 7zip options click add to " ".zip
Sent from my GT-I9300 using xda premium

[Q] "pm disable" - Where's it store the list?

I know of three ways to disable/freeze unwanted apps:
Using the command pm disable PACKAGE_OR_COMPONENT
Titanium Backup Pro
Disable the app through the built-in Application Manager (does not work for all apps)
Here's some details I could find about pm disable: http://www.kpbird.com/2013/05/android-shell-command-pm-package-manager.html
But my question to the community: When an app is disabled/frozen by any of these methods, what keeps track of these? Where is this data stored?
If nobody can answer my question above, then I have a different question: Are there any apps/commands that would allow you to view/log filesystem changes on-the-fly? (goal with this: start this "watcher" app, then disable an app using pm, and figure out what changed).
Thanks!
I found it! After quite some time grepping around, I found that the list of enabled/disabled apps is located here:
/data/system/users/0/package-restrictions.xml
Now, all I need to do is find a way to update this file in bash, without relying on any external programs. I plan to make a flashable zip to run a simple script that searches for each of the following three lines:
Code:
<pkg name="com.wssyncmldm" enabled="1" />
<pkg name="com.LocalFota" enabled="1" />
<pkg name="com.sec.android.fwupgrade" enabled="1" />
And updates each to a "2".
If any of the three lines are not found, the script should add them near the end of the file, on new lines immediately before this one:
Code:
<preferred-activities />
One more thing: it's possible that a person might have multiple user accounts on their phone (seems rare...), there could be other package-restrictions.xml files in other directories (maybe a /data/system/users/1/ or example). It would be ideal if the script could search for other user accounts and make the same modifications.
Any scripting-heroes willing to make this up for me??
BTW: the point/purpose of this is to disable the OTA updates from a flashable zip, in a custom recovery, without requiring a rooted system.
Aou said:
I found it! After quite some time grepping around, I found that the list of enabled/disabled apps is located here:
/data/system/users/0/package-restrictions.xml
Now, all I need to do is find a way to update this file in bash, without relying on any external programs. I plan to make a flashable zip to run a simple script that searches for each of the following three lines:
Code:
<pkg name="com.wssyncmldm" enabled="1" />
<pkg name="com.LocalFota" enabled="1" />
<pkg name="com.sec.android.fwupgrade" enabled="1" />
And updates each to a "2".
If any of the three lines are not found, the script should add them near the end of the file, on new lines immediately before this one:
Code:
<preferred-activities />
One more thing: it's possible that a person might have multiple user accounts on their phone (seems rare...), there could be other package-restrictions.xml files in other directories (maybe a /data/system/users/1/ or example). It would be ideal if the script could search for other user accounts and make the same modifications.
Any scripting-heroes willing to make this up for me??
BTW: the point/purpose of this is to disable the OTA updates from a flashable zip, in a custom recovery, without requiring a rooted system.
Click to expand...
Click to collapse
I could probably make a flashable zip that replaces package-restrictions.xml with a modified version that disables OTA
do you have that file?
the bash script looking for and replacing lines is not possible AFAIK via recovery.
jetlitheone said:
I could probably make a flashable zip that replaces package-restrictions.xml with a modified version that disables OTA
do you have that file?
the bash script looking for and replacing lines is not possible AFAIK via recovery.
Click to expand...
Click to collapse
Well, I've done this sort of thing in MS-DOS batch, using For loops (reading the file, line-by-line and processing it). I'll have to look into the bash equivalent.
Also, simply replacing the file is far too dangerous. If any entries in that file mismatch what's installed on the system, the device will not boot properly (TouchWiz launcher will not load, for one). Every time you enable/disable an app, the entire file shifts around and changes. It's a nightmare. But dealing with it line-by-line would be feasible...
Aou said:
Well, I've done this sort of thing in MS-DOS batch, using For loops (reading the file, line-by-line and processing it). I'll have to look into the bash equivalent.
Also, simply replacing the file is far too dangerous. If any entries in that file mismatch what's installed on the system, the device will not boot properly (TouchWiz launcher will not load, for one). Every time you enable/disable an app, the entire file shifts around and changes. It's a nightmare. But dealing with it line-by-line would be feasible...
Click to expand...
Click to collapse
Yeah I know what you mean I don't know it might be possible. Only thing I know of is applications that run bash scripts on boot up. But not of running one via a flashable zip in recovery
Sent from my SGH-I337 using Tapatalk 4 Beta
Based on some of the flashable zips out there, I think it's possible to use busybox to execute a bash script. I came up with a little bit of crappy psuedocode for what needs to happen:
Code:
set foundFlag = 0
if (file exists: /system/app/<app>.apk) do:
for (each line of package-restrictions.xml) do:
if ( line = <pkg name="com.wssyncmldm" enabled="1" /> ) do:
echo <pkg name="com.wssyncmldm" enabled="2" /> into newfile
set foundFlag = 1
else do:
echo line into newfile
end if
end for
if (foundFlag != 1) do:
for (each line of package-restrictions.xml) do:
if ( line = <preferred-activities /> ) do:
echo <pkg name="com.wssyncmldm" enabled="2" /> into newfile
echo <preferred-activities /> into newfile
else do:
echo line into newfile
end if
end for
end if
move newfile -> package-restrictions.xml
end if
The above would need to be repeated 3 times for the 3 apk's that need to be disabled.
.

Extended Power Menu +center clock+ambient display Android M oficial

First download the apktool from here then install the framework of android M extracted from your Rom, choose your desired mod/s and follow the instructions.
Ambient Display:
1. Decompile SystemUI.apk
2. Navigate to systemui/res/values/bools.xml and change this line:
from
PHP:
<bool name="doze_display_state_supported">false</bool>
<bool name="doze_pulse_on_pick_up">false</bool>
to
PHP:
<bool name="doze_display_state_supported">true</bool>
<bool name="doze_pulse_on_pick_up">true</bool>
3. Save and recompile SystemUI.apk
4. Decompile framework-res.apk
5. Navigate to framework-res/res/values/strings.xml and change this line:
from
PHP:
<string name="config_dozeComponent"></string>
to
PHP:
<string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
6. Save and close
7. Now in the same folder open bools.xml and change this line:
from
PHP:
<bool name="config_dozeAfterScreenOff">false</bool>
<bool name="config_powerDecoupleInteractiveModeFromDisplay">false</bool>
to
PHP:
<bool name="config_dozeAfterScreenOff">true</bool>
<bool name="config_powerDecoupleInteractiveModeFromDisplay">true</bool>
Save it and close
8. Now in the same folder open integers.xml and change this line:
from
PHP:
<integer name="config_screenBrightnessDoze">1</integer>
to
PHP:
<integer name="config_screenBrightnessDoze">17</integer>
9. Save and recompile framework-res.apk
Add Extended Power Menu:
don't ask for reboot options,soft,recovery...etc, here i just enabled the hidden power menu options in the google source code.
1. Decompile framework-res.apk
2. Navigate to framework-res/res/values/arrays.xml and change this line:
from
PHP:
<string-array name="config_globalActionsList">
<item>power</item>
<item>bugreport</item>
<item>users</item>
</string-array>
to
PHP:
<string-array name="config_globalActionsList">
<item>power</item>
<item>airplane</item>
<item>settings</item>
<item>lockdown</item>
<item>voiceassist</item>
<item>bugreport</item>
<item>silent</item>
<item>users</item>
</string-array>
3. Save and recompile framework-res.apk
Add center clock:
1. Decompile SystemUI.apk
2. Navigate to systemui/res/layout/status_bar.xml and add this line:
PHP:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
immediatly after this line:
PHP:
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
and delete this line:
PHP:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="7.0dip" />
3. Save and close
4. Navigate to systemui/res/values/dimens.xml and change this line:
from
PHP:
<dimen name="keyguard_carrier_text_margin">16.0dip</dimen>
to
PHP:
<dimen name="keyguard_carrier_text_margin">156.0dip</dimen>
5. Save and recompile SystemUI.apk
for every mod put your modded framework or/and system in the corresponding folder inside the attached zip(mod_hammerhead for Nexus 5 and mod_shamu for Nexus 6), flash via TWRP revovery.
Hi,can i have individual mod ..?
for e.g, i wish to have ambient display turn on only ..
nsg86 said:
Hi,can i have individual mod ..?
for e.g, i wish to have ambient display turn on only ..
Click to expand...
Click to collapse
Give me your framework and systemui
Sent from my Nexus 5 using Tapatalk
PiSpecialist said:
First flash the framework.zip, let it boot then flash system.zip.
Screenshoots:
Click to expand...
Click to collapse
firstly thanks great work... but the only thing stopping me from flashing this straight away is the fact its unclear if the extended power menu includes reboot/recovery.. could you clarify if it does or not.
TIA
gaosphappy said:
firstly thanks great work... but the only thing stopping me from flashing this straight away is the fact its unclear if the extended power menu includes reboot/recovery.. could you clarify if it does or not.
TIA
Click to expand...
Click to collapse
See the screenshots.
Sent from my Nexus 5 using Tapatalk
PiSpecialist said:
See the screenshots.
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
ive seen both the screen shots... its not there (that i can see ??? ) just wandered if there was more options to the power menu tucked away N.M
this got me stuck at google logo, running factory image, twrp latest, supersu, hellscore kernel, also using layers theme engine
dewlap said:
this got me stuck at google logo, running factory image, twrp latest, supersu, hellscore kernel, also using layers theme engine
Click to expand...
Click to collapse
Same expect I don't have layers.
Stuck at Google bootup animation too
For me did not work, got stuck in bootanimation, I am using kernel stock and there is no app cm or layer. To return did not need to give a reset factory only flash system.img. CAUTION!!
A pretty decent workaround for those that don't want to mess around with flashing frameworks is to use Nova Launcher's gestures feature and Material Power Menu.
Set double tap to Material Power Menu and viola! (only works on home screen) but good enough for me.
Your frameworks will all be different causing bootloop. The mod needs to be made on a clean install and only flashed on a clean install
Sent from my Nexus 5 using Tapatalk
can i have individual mod? Only Ambient Display
For those are getting bootloop, flash the attached zip, let it boot, then flash the others zip in the OP.
Erase dalvik and cache for well done
Hello,
Work fine on my Nexus 5 Xstasmooth 6.0
After flash Framework and system zip you must erase dalvik and cache
laugeek57 said:
Hello,
Work fine on my Nexus 5 Xstasmooth 6.0
After flash Framework and system zip you must erase dalvik and cache
Click to expand...
Click to collapse
Thanks
Sent from my Nexus 5 using Tapatalk
laugeek57 said:
Hello,
Work fine on my Nexus 5 Xstasmooth 6.0
After flash Framework and system zip you must erase dalvik and cache
Click to expand...
Click to collapse
Thanks for the info, @laugeek57
But i guess it is only for users with Xtrasmooth 6.0. For user like me with Lean ROM (@Mohamed Yaser) it isn't working. Thanks to @PiSpecialist for his "stock.zip" file, it works.
Appreciate your help @PiSpecialist and @laugeek57
Will it work in android one????
Dear @PiSpecialist
Just a couple of questions...
- For the center clock. In case i want to revert back to upper right clock, could you tell me how to do it?
- Are you planning to make a flashable file for a new advance power menu which include reboot options?
As always, thank you for your usefull contributions
Cheers
Is it possible to have a How To for centered clock ?
Or is it the same way than 5.1 ?

[GUIDE] How to make GSIs overlay file for your phone

Hello, when you using phh's GSIs, you may found bugs on auto brightness, battery usage data, etc (e.g: Xiaomi, Huawei, etc.). For this, you can make an overlay files for your mobiles.
Requirements:
framework-res.apk on your stock rom. (It may on /system/framework/framework-res.apk)
apktool (to extract framework-res.apk)
git (to clone repo)
Linux (to build overlay files)
Steps:
1. Fork phhusson/vendor_hardware_overlay on GitHub.
2. Clone Repository which you forked, and make a new branch for your works.
3. Copy a device which similar for your device, and rename it to your own device.
4. Edit <Your device>/Android.mk (Just modify the contents of the brackets, same as below)
Code:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := treble-overlay-[Manufacturer of your device]-[Name of your device]
LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
LOCAL_PRIVATE_PLATFORM_APIS := true
include $(BUILD_PACKAGE)
5. Edit <Your device>/AndroidManifest.xml
Code:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.phh.treble.overlay.[Manufacturer of your device].[Name of your device]"
android:versionCode="1"
android:versionName="1.0">
<overlay android:targetPackage="android"
android:requiredSystemPropertyName="ro.vendor.build.fingerprint"
android:requiredSystemPropertyValue="+[write as similar format]*"
android:priority="[Take next number of last used]"
android:isStatic="true" />
</manifest>
If you don't know how to take androidriority, you can execute this commands to list priority which used already:
Code:
cd [Path of repository]
find -name AndroidManifest.xml |while read manifest;do packagename="$(xmlstarlet sel -t -m '//manifest' -v @package -n $manifest)";priority="$(xmlstarlet sel -t -m '//overlay' -v @android:priority -n $manifest)";echo -e "$priority\t$packagename";done|more
(the single line command split here, just for viewing or making a shell script):
Code:
find -name AndroidManifest.xml |while read manifest;do
packagename="$(xmlstarlet sel -t -m '//manifest' -v @package -n $manifest)";
priority="$(xmlstarlet sel -t -m '//overlay' -v @android:priority -n $manifest)";
echo -e "$priority\t$packagename";
done
It will print a list for you (unsorted), and you just take an unused priority.
You can find device fingerprint on /vendor/build.prop, or execute following commands (on your device or adb shell):
Code:
getprop ro.vendor.build.fingerprint
If you can't find ro.vendor.build.fingerprint, you can find ro.vendor.product.name or ro.product.vendor.device, then change android:requiredSystemPropertyName and android:requiredSystemPropertyValue what you found.
Huawei seems to use ro.hw.oemName to detect phone, and others manufacturer maybe have their own detection, too. But it should be unique for other phones with same manufacturer.
(It's NOT recommended unless your device don't have ro.vendor.build.fingerprint.)
6. Extract framework-res.apk with apktool on another side. (to avoid commited by mistake)
7. Replace <Your device>/res/xml/power_profile.xml to which power_profile.xml for your device.
It will on <Extracted framework-res.apk>/res/xml/power_profile.xml.
Or you can find whoever's device tree, it may have this file, too.
8. Edit <Your device>/res/values/config.xml
Find each key on following files what for your device:
Code:
[Extracted framework-res.apk]/res/values/arrays.xml
[Extracted framework-res.apk]/res/values/bools.xml
[Extracted framework-res.apk]/res/values/fractions.xml
[Extracted framework-res.apk]/res/values/integers.xml
And then replace values into <Your device>/res/values/config.xml
9. Add your device into <Path of repository>/overlay.mk
Just write like other lines.
10. Build overlays
Just execute following commands:
Code:
chmod u+x [Path of repository]/build/build.sh
[Path of repository]/build/build.sh
If You get this, Do what it said:
Code:
Please install aapt (apt install aapt should do)
Or if you get this:
Code:
OpenJDK Server VM warning: You have loaded library /root/overlay/vendor_hardware_overlay/build/signapk/libconscrypt_openjdk_jni.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.conscrypt.NativeCrypto.get_cipher_names(Ljava/lang/String;)[Ljava/lang/String;
at org.conscrypt.NativeCrypto.get_cipher_names(Native Method)
at org.conscrypt.NativeCrypto.<clinit>(NativeCrypto.java:764)
at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:56)
at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:49)
at com.android.signapk.SignApk.main(SignApk.java:942)
I have no solution, either. Try to build on another computer.
11. Test overlay with tests.sh and yourself
For general checks (symtax, etc.), just execute following command:
Code:
chmod u+x [Path of repository]/tests/tests.sh
[Path of repository]/tests/tests.sh
You should fix errors what reported for your device, and then restart from step 10.
If it reported errors but not for your device, just ignore it.
When check passed, you can find overlay file on <Path of repository>/build/treble-overlay-<Manufacturer of your device>-<Name of your device>.apk, just copy it into your phone's /system/overlay/, and set permission to rw-r--r-- / 0644.
And then reboot your phone to test your overlay.
12. If it works for your device, don't forget to perform a pull request for phhusson/vendor_hardware_overlay, to support his awesome works.
Thanks for the guide @minadzuki
but i'm getting this error after step 10:
(core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
even when i try to build for existing devices I got the same error
king1990 said:
Thanks for the guide @minadzuki
but i'm getting this error after step 10:
(core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
even when i try to build for existing devices I got the same error
Click to expand...
Click to collapse
Oh...I forgot this, sorry.
Because I haven't encountered this error, so I don't have a way to solve it, either. (I tried to built it on three remote servers only)
And...is it cause segment fault?
Or you can try to install google-android-build-tools instead of aapt. (because I can't find aapt on archlinux but found this)
Very nice guide, thanks!
I'll link it as part of a "how to contribute"
For aapt, there is an aapt included in the git. If it doesn't work for you (like @king1990's segfault), know that the one included in the git has the lowest priority. It will pick up aapt from the system first.
(but then you'll need to have a system-wide aapt).
Or if you have an Android SDK somewhere, you can set your PATH to include it.
Edit: I just realized that what I just described might actually be the issue. If there is a system-wide aapt, it will use the libc++ in the git, which would explain the crash.
I fixed this case in my current git.
If there is a system-wide aapt it will use it.
If for some reason, system-wide aapt isn't suitable, you can run build.sh with --local-aapt to force the use of the in-git aapt (i.e. it will have higher priority than system's so no conflict should happen)
king1990 said:
Thanks for the guide @minadzuki
but i'm getting this error after step 10:
(core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
even when i try to build for existing devices I got the same error
Click to expand...
Click to collapse
Could you check again with latest git?
If it still doesn't work, can you try to call build.sh --local-aapt ?
@phhusson Thanks now it working fine and building without faults
I have few questions regarding the AndroidManifest.xml :
1- for android:requiredSystemPropertyValue how do I know which name to use ? is it trial and error ?
2- for androidriority does matter which number I choose ?
3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
4- to install the overlay is it just as @minadzuki says ?
and thanks again for your great work
king1990 said:
@phhusson Thanks now it working fine and building without faults
I have few questions regarding the AndroidManifest.xml :
1- for android:requiredSystemPropertyValue how do I know which name to use ? is it trial and error ?
2- for androidriority does matter which number I choose ?
3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
4- to install the overlay is it just as @minadzuki says ?
and thanks again for your great work
Click to expand...
Click to collapse
1. For example, Xiaomi Mi 6X has this fingerprint:
xiaomi/wayne/wayne:8.1.0/OPM1.171019.011/8.7.12:user/release-keys/
So you can take xiaomi/wayne to use, and android:requiredSystemPropertyValue will be: +xiaomi/wayne*
2. it will affect to build images, or affect the detection on System. If you got this:
Code:
F: .xxx/AndroidManifest.xml: priority xx conflicts with another manifest
You just take next number and try again, until now priority 53 has been taken (without pull request), you can take priority since 54.
3. Sorry, I don't know for this.
4. Yes, just simply copy and permission change.
king1990 said:
@phhusson Thanks now it working fine and building without faults
Click to expand...
Click to collapse
Cool
3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
Click to expand...
Click to collapse
overlays in /system/overlay and /vendor/overlay are the same thing, and on my GSI both are loaded, so yes it affects it.
But if your vendor has a framework-res__auto_generated_rro.apk, you probably don't need an overlay file for your phone, because it's already there.
(Please note that /system/overlay doesn't exist in AOSP, that's a change specific to my ROM, and custom ROMs based on it. AOSP only has /vendor/overlay)
@minadzuki Thanks for answering my questions. @phhusson its clear now , I don't know if this is related to your treble approach or not but some GSI ROMs refuse to go the minimum value in the brightness curve no mater what value I set in the curve, it never achieved.
is this treble or ROM related ?
king1990 said:
@minadzuki Thanks for answering my questions. @phhusson its clear now , I don't know if this is related to your treble approach or not but some GSI ROMs refuse to go the minimum value in the brightness curve no mater what value I set in the curve, it never achieved.
is this treble or ROM related ?
Click to expand...
Click to collapse
Brightness is a bit complex on Android Pie... (well it already was before, but it got even worse)
Do you have a link to your current overlay, so I can take a look at which code path you'd go to?
What's the lowest backlight value you get in /sys/class/backlight/panel0-backlight/brightness or /sys/class/leds/lcd-backlight/brightness?
Also what's your device? Does it have extended brightness range? (what's the value of getprop persist.sys.qcom-brightness // is it a samsung device?)
phhusson said:
Brightness is a bit complex on Android Pie... (well it already was before, but it got even worse)
Do you have a link to your current overlay, so I can take a look at which code path you'd go to?
What's the lowest backlight value you get in /sys/class/backlight/panel0-backlight/brightness or /sys/class/leds/lcd-backlight/brightness?
Also what's your device? Does it have extended brightness range? (what's the value of getprop persist.sys.qcom-brightness // is it a samsung device?)
Click to expand...
Click to collapse
for overlay this the extracted files from the overlay apk (my device is Axon7)
The lowest backlight is 10 (once manually edit it to 1 it goes to really dim brightness)
what I don't understand that I already built two GSI ROMs one is DU13 & other Liquid pie both report the same backlight light value at 10 at minimum value but in DU its very dim and in liquid its still bright ?!
The command did not give back any information so I assume we don't extended brightness range.
Thanks
Edit : it was overlay problem , fixed after modifying it
I tried to create an overlay for my Honor View 10 (Berkeley)
Is there a list of recommended settings to copy over from the stock ROM? I started with copying everything listed in tests/knownKeys and it seems to work
There's a power_profile.xml in the framework-res.apk I dumped from my stock ROM but the battery capacity is set to 1000 instead of 3750. Is that right?
There's also a power_profile_test.xml in there with a much more sane value of 3000 mAh. Should I use this one instead?
Copperhead100 said:
I tried to create an overlay for my Honor View 10 (Berkeley)
Is there a list of recommended settings to copy over from the stock ROM? I started with copying everything listed in tests/knownKeys and it seems to work
There's a power_profile.xml in the framework-res.apk I dumped from my stock ROM but the battery capacity is set to 1000 instead of 3750. Is that right?
There's also a power_profile_test.xml in there with a much more sane value of 3000 mAh. Should I use this one instead?
Click to expand...
Click to collapse
I don't have any Huawei phones, sorry.
Maybe you can referrer /Huawei/kirin970/CLT or /Huawei/kirin970/EML, Honor V10 maybe have its OEM name and called "BKL"
Copperhead100 said:
I tried to create an overlay for my Honor View 10 (Berkeley)
Is there a list of recommended settings to copy over from the stock ROM? I started with copying everything listed in tests/knownKeys and it seems to work
There's a power_profile.xml in the framework-res.apk I dumped from my stock ROM but the battery capacity is set to 1000 instead of 3750. Is that right?
There's also a power_profile_test.xml in there with a much more sane value of 3000 mAh. Should I use this one instead?
Click to expand...
Click to collapse
On Huawei, you'll find real power_profile.xml somewhere in /odm or /product. I'd say /product/etc/power_profile.xml
phhusson said:
On Huawei, you'll find real power_profile.xml somewhere in /odm or /product. I'd say /product/etc/power_profile.xml
Click to expand...
Click to collapse
Thanks. It's actually /product/etc/xml/power_profile.xml
There's a new pull request incoming
is it possible to create an overlay in Widows usingGIT for Windows?
JEANRIVERA said:
is it possible to create an overlay in Widows usingGIT for Windows?
Click to expand...
Click to collapse
Yes, you can write source code everywhere (don't forget to replace CRLF to LF), but maybe you should build it on Linux, or you have a way to build it on Windows (e.g.: WSL, Mingw, etc.)
@minadzuki I can't find a config.xml in my framework-res.apk, am I missing something? or that gets created somehow in the process?
another question
on step 5 you say to edit AndroidManifext.xml, does that means delete everything in it and copy paste what you put on the code box? or just add that at the end of the xml file?
JEANRIVERA said:
@minadzuki I can't find a config.xml in my framework-res.apk, am I missing something? or that gets created somehow in the process?
another question
on step 5 you say to edit AndroidManifext.xml, does that means delete everything in it and copy paste what you put on the code box? or just add that at the end of the xml file?
Click to expand...
Click to collapse
framework-res.apk doesn't contain config.xml, it split into several files: arrays.xml, bools.xml, fraction.xml, integers.xml. just create config.xml or copy from other devices and find values on these files (to replace it).
and step 5, just replace values which for your device, like what other devices wrote.
minadzuki said:
framework-res.apk doesn't contain config.xml, it split into several files: arrays.xml, bools.xml, fraction.xml, integers.xml. just create config.xml or copy from other devices and find values on these files (to replace it).
and step 5, just replace values which for your device, like what other devices wrote.
Click to expand...
Click to collapse
thanks for the response but I am really lost here those 4 xml has way to much data in it, should I just copy everything to config.xml?
to be honest what I am trying to fix are 2 things the battery stats not showing and the auto brightness and brightness slider and if the led light is fixable by an overlay that too, I can provide you all the files needed could you build it for me please? my device is an HTC U12+
JEANRIVERA said:
thanks for the response but I am really lost here those 4 xml has way to much data in it, should I just copy everything to config.xml?
to be honest what I am trying to fix are 2 things the battery stats not showing and the auto brightness and brightness slider and if the led light is fixable by an overlay that too, I can provide you all the files needed could you build it for me please? my device is an HTC U12+
Click to expand...
Click to collapse
you can check like this:
https://github.com/phhusson/vendor_hardware_overlay/blob/master/Xiaomi/Mi8/res/values/config.xml
then take values from those 4 xmls.

Categories

Resources