Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Does anyone know about android and creating flashable zips?

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 15:40 - 20 Nov 2015    Post subject: Does anyone know about android and creating flashable zips? Reply with quote

I want to create a flashable zip to edit 2 system files in on an android device.

I have tweaked my system to have a better DPI and louder speaker.

Everytime I update these changes are erased, it is most annoying as the resolution change borks my icons/widgets and I have to recreate it all.

I was hoping I could get these changes in a ZIP so I can flash it when I flash the update/SuperSU/Xposed etc.

It will need to add a line to 'Build.Prop' in /System and change a few lines in 'MixerPaths.xml' in /System/Etc.

Can anyone do this/show me how to do it?
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

J.M.
World Chat Champion



Joined: 27 Mar 2011
Karma :

PostPosted: 16:23 - 20 Nov 2015    Post subject: Reply with quote

Are you comfortable with writing scripts?

Take a look at this:
https://www5.zippyshare.com/v/RvfbVEkr/file.html

Use that as a template. They've done the legwork involving creating a flashable zip. It runs the /tmp/mytweaks.sh file when you flash the zip. This is run by the com/google/android/updater-script

This sh already takes care of changing the build.prop (and actually the DPI).

You can extend the mytweaks.sh to then change what you need to in MixerPaths.xml.

Easiest is appending lines. If that's not possible, next easiest is bundling a modified MixerPaths.xml in the zip and replacing the existing. Most difficult is modifying lines using the script, but you could probably utilise sed or something to do it.
____________________
2004 R1 & 2018 XSR900
 Back to top
View user's profile Send private message You must be logged in to rate posts

J.M.
World Chat Champion



Joined: 27 Mar 2011
Karma :

PostPosted: 01:03 - 22 Nov 2015    Post subject: Reply with quote

Did you have any luck with this? I can lend a hand if there's anything that's not working properly.
____________________
2004 R1 & 2018 XSR900
 Back to top
View user's profile Send private message You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 13:56 - 22 Nov 2015    Post subject: Reply with quote

I haven't had I look yet but will next week, thanks for your input I'll let you know. Thumbs Up
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 12:18 - 23 Nov 2015    Post subject: Reply with quote

J.M. wrote:
Are you comfortable with writing scripts?

Take a look at this:
https://www5.zippyshare.com/v/RvfbVEkr/file.html

Use that as a template. They've done the legwork involving creating a flashable zip. It runs the /tmp/mytweaks.sh file when you flash the zip. This is run by the com/google/android/updater-script

This sh already takes care of changing the build.prop (and actually the DPI).

You can extend the mytweaks.sh to then change what you need to in MixerPaths.xml.

Easiest is appending lines. If that's not possible, next easiest is bundling a modified MixerPaths.xml in the zip and replacing the existing. Most difficult is modifying lines using the script, but you could probably utilise sed or something to do it.


I've had a look at it,

I'd rather change the lines if possible than replace the file, my thinking being if something else is updated in Mixer Paths I do not want to lose that. However the DPI is most important as not doing it has a negative effect.

Am I right in thinking all that zip will do is add the line in tmp/Misc file to the build.prop?

Thanks,

Chris
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

J.M.
World Chat Champion



Joined: 27 Mar 2011
Karma :

PostPosted: 15:01 - 23 Nov 2015    Post subject: Reply with quote

That script is written with OnePlus Two in mind as the build prop doesn't contain any entry for DPI. All the script does is add the line to the build.prop file.

If you look at the bash script you will see how it does it.

If you already have a build prop with DPI listed, I would probably delete the file and modify the script.

I'd personally make it create a backup, then pipe it through a command like sed to replace your existing entry (if there is one). Otherwise I'd leave the script be.

The bonus of modifying through sed means that you XML tweak would be a simple extension of the DPI code.
____________________
2004 R1 & 2018 XSR900
 Back to top
View user's profile Send private message You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 15:25 - 23 Nov 2015    Post subject: Reply with quote

My phone is a OP2, so the script should be fine.

I'm ok with the script until the last section that actually does the work Laughing it loses me there.

Do you have an example of how to change a value rather than add it?

Another q

Is everything in the in the META-INF folder generic and not to be worried about?

Cheers,
Chris
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

J.M.
World Chat Champion



Joined: 27 Mar 2011
Karma :

PostPosted: 00:34 - 24 Nov 2015    Post subject: Reply with quote

Code:
for prop in `cat /tmp/$mod`;do
      export newprop=$(echo ${prop} | cut -d '=' -f1)
      sed -i "/${newprop}/d" /system/build.prop
      echo $prop >> /system/build.prop
    done


1. Loops through each entry in the misc file.
2. Splits on the = sign to key the key of the key=value pair
3. Use sed to remove any line in the build.prop for that key, regardless of value
4. Append the entry from the misc file to the end of build.prop

Code:
Jordans-Mini:~ jordan$ X=lcd=123
Jordans-Mini:~ jordan$ Y=$(echo ${X} | cut -d '=' -f1)
Jordans-Mini:~ jordan$ echo $Y
lcd

Jordans-Mini:~ jordan$ echo "lcd=123" | sed 's/lcd/test/'
test=123
Jordans-Mini:~ jordan$ echo "lcd=123" | sed '/lcd/d'
 


The META-INF folder is actually where the system looks when flashing the script. However the code in their META-INF folder basically takes care of writing the /system partition to be writable and then invoking the mytweaks.sh script.

So all of your changes can be done in the mytweaks.sh without worry about META-INF.

My real question right now is what happens when you modify a file and try to run it. However, I'm 99% certain that flashing a zip through a custom recovery gives you the ability to skip signature verification, so it shouldn't be an issue. If it is, we can just sign it. It's just more effort.
____________________
2004 R1 & 2018 XSR900
 Back to top
View user's profile Send private message You must be logged in to rate posts

J.M.
World Chat Champion



Joined: 27 Mar 2011
Karma :

PostPosted: 14:44 - 17 Dec 2015    Post subject: Reply with quote

What changes did you make in MixerPaths.xml?

I'm going to put together a flashable zip today because I want to change my DPI and I'm no longer rooted, so I might as well do your change too seeming as you think it's beneficial and we have the same device Very Happy
____________________
2004 R1 & 2018 XSR900
 Back to top
View user's profile Send private message You must be logged in to rate posts
Old Thread Alert!

The last post was made 10 years, 303 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.10 Sec - Server Load: 0.69 - MySQL Queries: 14 - Page Size: 64.59 Kb