[SCRIPT] Repack multiple APKs with proper compression settings (and other stuff!) - Android Apps and Games

Hi Guys,
I was speaking to baadnwz a couple of weeks ago and i asked him which script he used to properly pack all the APKs in his ROM. He told me he used no script, just repacked the APKs he thought were most relevant.
I figured it couldn't be too hard to write something that took an APK, extracted it somewhere, then repacked it with the proper compression, so i wrote one. baadnwz then challenged me to make it work for multiple APKs, so he can just run it against a folder full of them like a lazy asshole. i went one better, and made a script that you could run against a ROM folder structure, it will search out all APKs, repack them, and copy them back into place. HOT!
because this uses recursion and functions to make it easier to write (and because i'm generally comfortable in it), i have written it in VBScript. So this means it won't work on linux as far as i know, sorry. Feel free to convert it or whatevs
WHAT DOES IT DO??????//
1. finds an APK
2. unpacks it in a folder
3. optimises the PNGs (if you want it to)
4. repacks all files as deflate except a blacklist of filetypes*
5. repacks the blacklisted filetypes* as STORE
6. zipaligns the new APK
7. copies it back to the original location, overwriting the original APK
8. finds the next APK, and repeat from step 2
* the blacklisted file types are easily editable. just find the STOREFileNames variable. by default the filetypes are:
"*.arsc", "*.m10", "*.png", "*.wav", "*.ogg", "*.mp4", "*.jpl", "*.jpeg", "*.gif","*.mp2", "*.mp3", _
"*.aac","*.mpg", "*.mpeg", "*.mid", "*.midi", "*.smf", "*.jet","*.rtttl", "*.imy", "*.xmf", _
"*.m4a","*.m4v", "*.3gp", "*.3gpp", "*.3g2", "*.3gpp2", "*.amr", "*.awb", "*.wma", "*.wmv", _
"*.so", "*.dat", "*.bin"
WHY DO YOU WANT THIS??
If certain filetypes in the APK are compressed as STORE (which means they aren't compressed at all), then Android can use them directly. If they are stored as DEFLATE (like all other file types should be), then Android must first decompress the APK somewhere. This means slower apps, more cache, and it's just not how things are supposed to be done. This script makes sure that all files inside all APKs are stored as they should be, and it will optimise PNG files and zipalign the final APK as it goes.
This script is really meant for ROM chefs to run against their ROMs before releasing them, but if you (a mere user) have a ROM that your chef hasn't run this script on, then you can extract the ROM, run the script on it, then recompress the ROM and flash it.
HOW DOES IT DO IT?????///////
It uses the command line version of 7-Zip. Download it from here:
http://7-zip.org/download.html
It uses zipalign.exe from the android SDK. if you don't know where this comes from.. maybe you shouldn't be using this script
It uses a cool OptiPNG utility to optimise the PNGs if you want it to. This slows the processing down a lot.. but it's up to you if you wanna do it. You'll need to download the utility from here:
http://optipng.sourceforge.net/
WHAT DO I HAVE TO DO TO MAKE IT WORK//////?
Grab the script, put it in the same folder as the root of your ROM (the script will repack all APKs in the subfolders from where it's sitting, including the APKs in the folder the script is in).
open up the script, there are 5 variables you MUST verify, most likely you will have to change them.. unless you put things on a D and E drive and your name is Nick..
tempAPKextract = "E:\Temp\tempAPKExtract"
tempAPKBuild = "E:\Temp\tempAPKBuild"
sevenZipLoc = """D:\nick\android\7za\7za.exe"""
zipAlignLoc = """D:\nick\android\android-sdk-windows\tools\zipalign.exe"""
optiPNGLoc = """D:\android\7-zipA\ROM\optipng.exe"""
the first two temp ones can be anywhere.. just make sure at least the sub folders up to "tempAPK..." exist (eg in this case the E:\Temp folder must already be there)
the next three are the locations of the tools required for the script to work, edit to please!
Run the script. If you have set verboseOutput to true (it's false by default), then I would highly recommend you run the script from the commandline with the command:
cscript fixAllAPKs.vbs
anyways, hope it's useful to you.
DOWNLOAD
CHANGELOG????/
v1.5.1 - cleaned up some code, added in verboseOutput so you can watch the progress as it's fixing (must run as cscript!)
v1.5 - added OptiPNG to the script, enabled by default. Quite slow. Added some more file types.
v1.4.3 - added more file types to STORE, thanks gtg465x
v1.4.1 - minor code clean up, fixed some comments.
v1.4 - fixed the problem where the script wouldn't fix any APKs in the root folder that the script was in
v1.3 - almost doubled the speed of the script. fixed some naughty bugs

edit: nevermind

not from what i've been told. if it's not compressed, the android system doesn't have to explicitly decompress it somewhere when it wants to use it, it can just pick it straight out of the APK.

omniwolf said:
not from what i've been told. if it's not compressed, the android system doesn't have to explicitly decompress it somewhere when it wants to use it, it can just pick it straight out of the APK.
Click to expand...
Click to collapse
Good man. Here are all of the files blacklisted by the default Android Asset Packaging Tool (aapt) if you want to include them.
{
".jpg", ".jpeg", ".png", ".gif",
".wav", ".mp2", ".mp3", ".ogg", ".aac",
".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",
".rtttl", ".imy", ".xmf", ".mp4", ".m4a",
".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",
".amr", ".awb", ".wma", ".wmv"
};

cool, thanks for the info. i've added the missing ones in and uploaded a new version.
cheers!

Nice work.
Suggestion or maybe a challenge for Ver 2:
Given a definition of what languages the user defines, can you repack including only those languages. This would include both drawables and layout language folders.
Removing languages not only speeds up the rom but reduces the apk size which for Sense 3.0 is becoming challenging for many older (> 1 year) devices.
Thanks for your contributions to XDA.

Also need to add .so to the blacklist. Ran into a problem with that the other day.

Here's mine.
It synchronizes with our SVN repository and builds the rom. Any commits which were made are automatically turned into a new ClockWorkMod flashable package.
Code:
#! /bin/sh
#This is the repository Directory, change to match your setup
Repo="~/TeamKomin/trunk"
#This is the Final folder, this is where the file will end up
Output="~/Desktop"
#synchronize SVN repository
svn update "$Repo"
#remove temp folder if exist
test -e "$Output/tmp/" && rm -Rf "$Output/tmp/"
#make new temp folder
mkdir "$Output/tmp/"
#copy repository to temp folder
cp -rf "$Repo/data" "$Output/tmp/"
cp -rf "$Repo/META-INF" "$Output/tmp/"
cp -rf "$Repo/system" "$Output/tmp/"
cp -rf "$Repo/updates" "$Output/tmp/"
#clear SVN folders to reduce size
find "$Output/tmp/" -name ".svn" -type d -exec rm -rf {} \;
cd "$Output/tmp"
#remove old files if there
test -e "$Output/AndromedaRepo.zip" && rm -f "$Output/AndromedaRepo.zip"
#zip up a new Andromeda3 version
zip -r "$Output"/AndromedaRepo.zip ./*
#done
I've also got a version which uses the Expect command to log into our SFTP server and update the files.teamkomin.com website... I'm not posting that here though as it contains security sensitive information.
Using this method, all members work on the ROM as though it were on the phone... This script packages it. No need to package or unpackage the entire thing.

myn said:
Nice work.
Suggestion or maybe a challenge for Ver 2:
Given a definition of what languages the user defines, can you repack including only those languages. This would include both drawables and layout language folders.
Removing languages not only speeds up the rom but reduces the apk size which for Sense 3.0 is becoming challenging for many older (> 1 year) devices.
Click to expand...
Click to collapse
ok, sounds like a good idea. i'm not actually a ROM developer, so i don't know the ins and outs of the various files. any hints on which files i exclude for various languages? just having a vague look around i see in framework-res.apk there's some raw-ar, raw-cs, raw-en-GB folders, are these the ones you're saying i can strip out?
this will obviously be a lot easier if i can do it programmatically, do you know the rules?
Also need to add .so to the blacklist. Ran into a problem with that the other day.
Click to expand...
Click to collapse
ok cool, added it in and uploaded 1.4.3. thanks dude.
Here's mine.
It synchronizes with our SVN repository and builds the rom. Any commits which were made are automatically turned into a new ClockWorkMod flashable package.
I've also got a version which uses the Expect command to log into our SFTP server and update the files.teamkomin.com website... I'm not posting that here though as it contains security sensitive information.
Using this method, all members work on the ROM as though it were on the phone... This script packages it. No need to package or unpackage the entire thing.
Click to expand...
Click to collapse
ok cool. does this actually repack and zip align the APKs though? this looks like it just takes care of the overall ROM zip structure, not the APKs within..? maybe your script could call mine.. if there was a vbs parser for linux

omniwolf said:
ok, sounds like a good idea. i'm not actually a ROM developer, so i don't know the ins and outs of the various files. any hints on which files i exclude for various languages? just having a vague look around i see in framework-res.apk there's some raw-ar, raw-cs, raw-en-GB folders, are these the ones you're saying i can strip out?
this will obviously be a lot easier if i can do it programmatically, do you know the rules?
ok cool, added it in and uploaded 1.4.3. thanks dude.
ok cool. does this actually repack and zip align the APKs though? this looks like it just takes care of the overall ROM zip structure, not the APKs within..? maybe your script could call mine.. if there was a vbs parser for linux
Click to expand...
Click to collapse
We keep the APKs on the server for ease of use. It makes it easier to reference a single file for testing that way.

http://www.jsware.net/jsware/vblinux.php5
vbscript on linux with wine!

Got error on line 118 - WshShell.Run
Anything else shall I edit apart of 4 paths? I have 64-bit OS if that matters.

I just realized how much easier this would be on linux...
Code:
#! /bin/bash
OutDir=~/Desktop/newRom
InDir=~/Desktop/myRom
zipAlign=/home/adam/code/android-sdk-linux_x86/tools/zipalign
TempDIr=~/Desktop/TempDir
FIFO=~/Desktop/temp1234
realign="apk dll whatever files"
#set things up
rm -Rf "$OutDir"
mkdir "$OutDir"
rm "$FIFO"
mkfifo "$FIFO"
#Move to dir and start script
cd InDir
#Spawn another process to write to the fifo object
find `pwd`>"$FIFO" &
#read each line in the fifo
while read line
do
#get each object extension in $realign variable
for x in $realign
do
#test if the extension matches the realignment
if [ $x = ${line#*.} ]; then
#make the path in case it does not exist, could be optimized
touch "$line"
#meh... this would be the command ish...
"$zipAlign" "$line" "$temp/$line"
else
mv "$line" "$temp/$line"
fi
done
done <$FIFO
#this just removes the redundant filesystem created...
#/home/adam/desktop/out/home/adam/desktop/myrom
rm -Rf "$OutDir"
mkdir "$OutDir"
mv "$/TempDIr/$InDIr" "$OutDir"
Untested, should work with some realignment of the variables at the top.

mike1986. said:
Got error on line 118 - WshShell.Run
Anything else shall I edit apart of 4 paths? I have 64-bit OS if that matters.
Click to expand...
Click to collapse
i'd say it's a problem with your
sevenZipLoc
variable, it's the first place it gets used. my OS is 64bit too, so that shouldn't be a problem. what does your sevenZipLoc variable look like?

omniwolf said:
i'd say it's a problem with your
sevenZipLoc
variable, it's the first place it gets used. my OS is 64bit too, so that shouldn't be a problem. what does your sevenZipLoc variable look like?
Click to expand...
Click to collapse
sevenZipLoc = """C:\Program Files\7-Zip\7z.exe"""
EDIT:
It seems that I forgot to download "command version"...

Any way to add optimizing PNGs to this script as well?

williamfold said:
Any way to add optimizing PNGs to this script as well?
Click to expand...
Click to collapse
show me how to do this and i might be able to add it in..

Heres the link to the opensource OptiPNG program to optimize a PNG
http://optipng.sourceforge.net/

I hope it perfectly work

wow thanks bro, that's way i need to learn about it

Related

Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux)

So i have written a simple script to ease the process of editing apks. Got a lot of downloads so thought its in demand
Whether you're doing basic image editing or editing the smali or xml files, on average u have to use (Brut.all or JF's smali/baksmali) awesome tool to extract the apk, edit it, then sign the apk and then adb push/install it. This process is quite tiresome if you are testing a method that needs fine tweaking.
This script should make the process a LOT smoother.
Theres an option of compiling/signing/installing all in one step
Thanks:
Goes to Brut.all for his awesome tool.
Goes to JF for ofcourse, smali/baksmali
Goes to farmatito for porting this script to linux
Features:
- Extract, Zip apk's.
- Optimize pngs (ignores .9.pngs)
- Zipalign apks
- Sign apks
- Push to specific location on phone
- Incorporates brut.all's apktool
- Pull apk from phone into modding environment.
- Batch optimize apk (Zipalign,optipng,or both)
- Quick sign an apk (Batch mode supported)
- Batch Ogg optimization
- Compression level selector (monitor status above menu)
- Batch install apk from script (option 16)
- Logging on/off has been removed. Instead a log.txt is created which logs the activities of the script organized using time/date headers
- User can change the max java heap size (only use if certain large apks get stuck when decompiling/compiling apks) (Option 19)
- Improved syntax of questions/answers
- Error detection. Checks if error occured anytime u perform a task, and reports it
- Read log (Option 20)
- U can now set this script as ur default application for apks. When u do, if u double click any apk it will install it for u.
- Supports batch installation, so if u drag multiple apks into the script (not while its running) it will install them all for u. U can ofcourse drag a single apk as well
- Added framework dependent decompiling (For non propietary rom apks). (Option 10). Checks whether the dependee apk u selected is correct.
- Allows multiple projects to be modified, switch to and from.
- Allows to modify system apk's using apktool but ensures maximum compatibility in terms of signature / manifest.xml
- Stuff i forgot i guess
Instructions (Windows):
- Place apk in appropriate folder (Any filename will work, if running for first time folders will not be there, you must run and then the folders will be created)
- Run script
- Minimize the script
- Edit files inside the project folder
- Maximize the script
Instructions (Linux):
- Place apk in appropriate folder (Any filename will work, if running for first time folders will not be there, you must run and then the folders will be created)
- Open terminal and change-directory to apkmanager (Easiest way is to type "cd ")
- Chmod 755 Script.sh
- Chmod 755 all files apps inside other folder (thanks for the tip bkmo )
- Run script by typing ./Script.sh
- Minimize the script
- Edit files inside the out folder
- Maximize the script
Requirements:
Java
Adb
Future Improvements:
- Manage multiple simultaneous apk edits (choose which apk to extract/build)
- Option to optimize the apks
- Option to adb push to user defined location
- Other stuff i dont know yet
Got problems ?
1. Make sure your path has no spaces
2. Your filename has no wierd characters
3. Java/adb are in your path
4. It's not a proprietary rom's apk (aka Sense,Motorola,Samsung) (If u are, then use option 11 and drag the required framework, eg com.htc.resources, twframework-res...etc)
5. It's not a themed apk (if it is, expect .9 png errors, use as close to stock as possible)
6. Look at the log to know whats happening
7. If all else fails, post as much info as possible and we will try to assist you.
MOD EDIT:
New DL link from this post
http://apkmultitool.com
Nice
As you probably know, I want to add signing and installing functionality to apktool. But I don't plan to make any kind of GUI for it, so such wrapper is a very good thing for many users, thanks
What is "Option to optimize the apks"?
I was thinking of incorporating the script "apkopt" it was basically using optipng to optimize the png's and then used zip align on the apks. Thanks btw, this tool wudnt exist without ur awesome script
I just did this so ppl would stop asking questions like "How do i change this/that in an app"
Here this is wht im talking about Link
Very nice
Thanks dude...
once again you manage to make modding easier with your scripts!
Does your apkopt avoid .9.png files? Because those have been a pain in the behind.
Re: Apk Manager 1.0 - Makes Modifying Ur Apk A Breeze
my script currently does not optimize apks. it will be in the upcoming updates and yea prolly when ill implement itll avoid .9.pngs lol
I have already incorporated "adb push" into the script.
Aside from adding an option to optimize the apks, is there anything else you guys think would make this script easier to use ?
Im really targetting those ppl who overcomplicate the simple process of editing apks. Any tips would be appreciated.
I posted a video attached to the main post.
New version out, features added are
Zipalign apks
Optimize pngs, ignores .9.pngs
allows to adb push to phone through script.
Great script man, it works flawlessly. You may just wanna edit your post #1 rather than continuously bumping with new posts for every update. I'm sure a mod won't be too pleased with that
I'm getting the
'java' is not recognized as an internal or external command, operable program or batch file​message when I attempt to sign an apk. I tried switching the PATH in Environment Variables so that it's pointing to my Java bin folder, but then I just end up with
java.io.FileNotFoundException: ..\place-apk-here\repackaged-unsigned.apk <The system cannot find the file specified>
at java.util.zip.ZipFile.open<Native Method>
at java.util.zip.ZipFile.<init><Unknown Source>
at java.util.zip.ZipFile.<init><Unknown Source>
at java.util.zip.ZipFile.<init><Unknown Source>
at com.android.signapk.SignApk.main<SignApk.java:320>
Could Not Find C:\ApkManager2.0\place-apk-here\../place-apk-here/repackaged-unsigned.apk​Help? :]
What app are you trying to edit ? also are you editing pngs only or code editing ?
Hop on Here im helping someone out so ill help u 2
There's a lot of things in /system that benefit from the optimized .pngs. Vending.apk, for instance, shrunk to half the size and runs a bit quicker and smoother now. Even framework-res.apk enjoyed the optimization. Paid apps, on the other hand, don't seem to fare so well; perhaps they check the md5sum of the app or something.
Yea png optimization works for almost all apks, zipalign on the other hand as i recall doesnt work on certain system apks such as settings.apk. Im prolly gonna incorporate apkopt's script into this which would allow to optimize a folder full of apks. As for paid apps not being optimized, a lot of dev already do their part on making the apk as small as possible, so perhaps thats the case.
hmm, after trying a couple of unpaid apps, it seems that perhaps the testkeys aren't compatible with my build. For any signed app, I get an error "Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]"
Yes when u modify a non system apk, they need to be resigned, and you cannot resign it with same key as dev cuz u dont know it hence anytime u modify an app, u must uninstall it, install the modded version, and from then on any change u make u dont have to uninstall as the keys will match
ahhh thanks. My mistake was just removing the package rather than uninstalling it.
Getting this on a zipalign. The file is there but it is repackaged-unsigned.apk and throws this error:
Please make your decision: 5
Unable to open 'E:\ApkManager\place-apk-here\repackaged-signed.apk' as zip archi
ve
Could Not Find E:\ApkManager\place-apk-here\repackaged-signed.apk
The system cannot find the file specified.
Nevermind....looks like it is by design that it tries both signed and unsigned and throws the error on the file that does not exist. It's just I did not see any zipalign output
having an issue that when I go to resign an apk the file deletes after running the script.. am I missing something here?

[Script] LowFatYoghurt - Choose your topping

Hi,
as I have seen some complaints in the CM forums about what apps should be in the CM6 release (bla bla bloatware bla bla...) and I already use a CM6 nightly with a lot of the apps removed. I thought a script that automagically creates a slimmed down version of a CM6-update.zip according to your personal choice might help some people.
How it works:
You need a linux box with working java6 binaries
Unzip the attached .zip
Optional: Read the release notes in slim.sh. (In fact, better read the whole file and understand what it will do...)
Copy testsign.jar from here in the extracted directory
Copy the gapps into the directory (must be named gapps-mdpi-FRF91-3-signed.zip)
Copy some CM6-update.zip into the directory
Decide what you want to keep/delete:
This is the interesting part. There are 3 Files ending with .bl in the extracted directory. Just edit them with your favourite text editor. Files with a # in front of the filename will be kept, without it it will be deleted.
Optional: Put some stuff you want in the adds folder, but use the directory structure of the update.zip (e.g. you want launcherpro: copy LauncherPRO.apk to adds/system/app/LauncherPRO.apk)
Run the script: "sh slim.sh NameOfCM6Update.zip"
Flash LowFatYoghurt-CM6-signed.zip and hope that you did not remove something essential [as always, flash on your own risk]
The .bl files in their current state are what I am trying at the moment, so EDIT THEM YOURSELF, I can not promise that everything runs smooth with this settings.
Have fun with this, learn something, improve and share it.
Thanks go out to cyanogen and his team for this awesome build and to everyone else contributing to the android community. The updater-script somewhere deep in adds is kanged from cyanogen and just slightly modified (thanks again).
mblaster
€: Some more automation for the lazy ones...
The new scriptfile GetFreshLFY.sh can be extracted from GetFreshLFY2.zip into the same directory as LowFatYoghurt. To run just type "sh GetFreshLFY.sh" to automatically download and slim the newest nightly for d/s using your current .bl files and adds.
€€: Fast update. Changed GetFreshLFY.sh to make it not download the newest nightly if it already is present.
This is cool. very well-implemented.
jcarrz1 said:
This is cool. very well-implemented.
Click to expand...
Click to collapse
Thanks. I just thought if it is useful for me it might as well be usefull for anyone else
Nice idea, but I always just run a gscript I made to remove them for me. I guess this would take a few mb off of the rom before hand thereby making the flashing process a bit faster.
mejorguille said:
Nice idea, but I always just run a gscript I made to remove them for me. I guess this would take a few mb off of the rom before hand thereby making the flashing process a bit faster.
Click to expand...
Click to collapse
Not only that. If you dare to remove enough, CM6 might eventually fit stock spl (got it down to about 70mb, so quite close). Additionally you can use firerats mtd patch to use the saved /system space for /data.
€: Someone should really make a bootanimation out of your sig
Added another script to OP.
Nice work. And great idea. Thanks.
I liked the idea here but changed it up a bit. I made it so the script runs after the rom installs.
PHP:
"Usage $SCRIPT_NAME [-l] [-s]"
""
"options:"
" -l | --list Creates a list of your apps and media"
" -s | --slim Removes unwanted specified files"
" -h | --help This help"
""
"To remove files run $SCRIPT_NAME -l to create a list of files"
"Open $SLIM_APK and $SLIM_MEDIA"
"Remove the '#' infront of each file you want to delete."
"Run $SCRIPT_NAME -s to remove all the unwanted files."

Need someone to compile an APK for me

Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Thanks!!
Here's what I need compiled:
http://mikelierman.com/SystemUI.apk.zip
0vermind said:
Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Thanks!!
Here's what I need compiled:
http://mikelierman.com/SystemUI.apk.zip
Click to expand...
Click to collapse
What did you use to decompile it? APK Manager from this thread?
http://forum.xda-developers.com/showthread.php?t=695701
Oh and once you compile it, you don't have to sign it because is a system app and not a regular app.
0vermind said:
Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Click to expand...
Click to collapse
What errors are you getting from apktool? It's going to be hard for someone else to compile an apk that has not been decoded by them and not knowing what files have been changed. Letting us know at least what .png or .xml files were modified would be a start but will work best if we could just figure out why you aren't able to build with your modifications.
The first thing I noticed from the zip you attached is that it's missing the apktool.yml file that should get created a package is decoded. Second, make sure to pull /system/framework/framework-res.apk so resources can be decoded/built properly. If you are using APK Manager, use option 10 to decode with framework-res.apk. If you are just using apktool run the command "apktool if framework-res.apk" before decoding.
mazdarider23 said:
Oh and once you compile it, you don't have to sign it because is a system app and not a regular app.
Click to expand...
Click to collapse
SystemUI.apk actually does get signed using the platform key. The easiest way to do so in my opinion is to use ZipSigner 2 on your phone. Also, once you've placed the modified SystemUI.apk into /system/app make sure it's permissions are rw-r--r--(chmod 644 /system/app/SystemUI.apk) and it's owner:group is root:root(chown 0:0 /system/app/SystemUI.apk). Next reboot to recovery, wipe dalvik-cache and cache, then reboot.
MongooseHelix said:
What errors are you getting from apktool? It's going to be hard for someone else to compile an apk that has not been decoded by them and not knowing what files have been changed. Letting us know at least what .png or .xml files were modified would be a start but will work best if we could just figure out why you aren't able to build with your modifications.
The first thing I noticed from the zip you attached is that it's missing the apktool.yml file that should get created a package is decoded. Second, make sure to pull /system/framework/framework-res.apk so resources can be decoded/built properly. If you are using APK Manager, use option 10 to decode with framework-res.apk. If you are just using apktool run the command "apktool if framework-res.apk" before decoding.
SystemUI.apk actually does get signed using the platform key. The easiest way to do so in my opinion is to use ZipSigner 2 on your phone. Also, once you've placed the modified SystemUI.apk into /system/app make sure it's permissions are rw-r--r--(chmod 644 /system/app/SystemUI.apk) and it's owner:group is root:root(chown 0:0 /system/app/SystemUI.apk). Next reboot to recovery, wipe dalvik-cache and cache, then reboot.
Click to expand...
Click to collapse
Well I'm glad you told me because little old me has been modifying system apps since the days of the nexus one and I've yet to sign one....I think is all depends on who's doing the modification...hahahaha....Good luck 0vermind on finding someone to compiling your systemui.apk!
mazdarider23 said:
Well I'm glad you told me because little old me has been modifying system apps since the days of the nexus one and I've yet to sign one....I think is all depends on who's doing the modification...hahahaha....Good luck 0vermind on finding someone to compiling your systemui.apk!
Click to expand...
Click to collapse
I'm not quite sure what to make of that comment...I certainly wasn't trying to step on your toes so I apologize if it came across that way. Just wanted to help avoid and rule out any issues that might come up. With APK Manager or by using 7zip, you can move the manifest and/or META-INF folder containing the signature from the original but to imply that system apps are not signed is incorrect.
I also think it is important that those messing with system apps understand that there are different keys used to sign apps. For anybody reading this that wants to figure out how certain packages are signed, here's a bit of an explanation. If we extract SystemUI.apk, we see a directory called META-INF. This holds the key/signature info. The key's serial number can be determined with the following command:
Code:
keytool -printcert -v -file SystemUI/META-INF/CERT.RSA | grep SerialNumber
You can check other apks/jars and noticing which have matching serial numbers, meaning they are signed with the same key...
platform key - SystemUI.apk, Settings.apk, Phone.apk, etc
shared key - Contacts.apk, UserDictionaryProvider.apk, etc
test key - Calendar.apk, DeskClock.apk, etc
google proprietary key - Vending.apk, Talk.apk, etc (including some market user apps like Maps, VoiceSearch, Docs)
MongooseHelix said:
I'm not quite sure what to make of that comment...I certainly wasn't trying to step on your toes so I apologize if it came across that way. Just wanted to help avoid and rule out any issues that might come up. With APK Manager or by using 7zip, you can move the manifest and/or META-INF folder containing the signature from the original but to imply that system apps are not signed is incorrect.
I also think it is important that those messing with system apps understand that there are different keys used to sign apps. For anybody reading this that wants to figure out how certain packages are signed, here's a bit of an explanation. If we extract SystemUI.apk, we see a directory called META-INF. This holds the key/signature info. The key's serial number can be determined with the following command:
Code:
keytool -printcert -v -file SystemUI/META-INF/CERT.RSA | grep SerialNumber
You can check other apks/jars and noticing which have matching serial numbers, meaning they are signed with the same key...
platform key - SystemUI.apk, Settings.apk, Phone.apk, etc
shared key - Contacts.apk, UserDictionaryProvider.apk, etc
test key - Calendar.apk, DeskClock.apk, etc
google proprietary key - Vending.apk, Talk.apk, etc (including some market user apps like Maps, VoiceSearch, Docs)
Click to expand...
Click to collapse
Thanks, I didn't know this! I'm glad there's people like you and mazdarider23 on this forum that know **** like this!!!

A way to Optimizing APK & Framework files

For optimizing apks, aside from fixAllAPKs by omniwolf, I found another one.
Note: I have no responsibility for breaking your ROM, so backup first.
Rights: No rights reserved, you can do whatever you like.
The classes.dex files have significant amount of debug infos in it, striping out those can reduce file size and increase some performance. I test it with all /system/app/ and /system/framework/ files, the ROM runs snapier, especially when you launching apps. Stripe out those debug info doesn't hurt anything, they are usefull only for original developer and one who wants to mod it, but you can always keep a copy of the original one for modding and debugging purpose.
Note that this does not boost performance like increase CPU freq, but the theory is, since the file size is reduced, dex and dalvik-cache became smaller in size, occupies memories smaller, thus processing is faster, and saves a little battery life, you can think it as something like optipng does.
Note also, you don't need to specify 0 compression, dex will be decompressed to /data/dalvik-cache, just use fixAllAPKs for fixing files inside APK that should not be compressed, and 0 compression for file type like xml isn't really a good idea.
Don't use this for ICS Framework files yet, there are specific files will causes surprising bugs when recompiled, but I'm lazy to find it out why and what, so just don't do it.
For FixAllAPKs, original thread here, http://forum.xda-developers.com/showthread.php?t=1123463
or post #36 by carl1961 http://forum.xda-developers.com/showpost.php?p=21458549&postcount=36
==========================================================================================================
RemoveDebuggingInfo_v2.2:
API Level must be specified to get 100% compatibility, it seems not forward nor backward compatible.
Froyo = 8, GB = 10, ICS4.0 ~ 4.0.2 = 14, ICS 4.0.3 = 15
Added API Level chooser, default 15 (ICS 4.0.3)
Added more descriptions.
Correct typos.
==========================================================================================================
depricated...
RemoveDebuggingInfo_v2.1:
First, Thanks to all who corrects me.
fix typo for menu selection 6
fix path for pulling for adb to work without setting PATH env variable
fix pushing framework to wrong directory
update smali/baksmali to v1.3.2
update script to compile/decompile using api level 15
added menu selection of fixAllAPKs
Instructions: Important
The default config is for ICS 4.03 base ROM, if you are gonna use it for Gingerbread Base ROM, need to edit the file RemoveDebuggingInfo.bat, and change the -a 15 to -a 10 for API level 10, then just double click start.bat and follow the on screen instruction.
java -jar baksmali-1.3.2.jar -b -a 10 -o .\classes .\classes.dex
java -jar smali-1.3.2.jar -a 10 .\classes -o .\classes.dex
Click to expand...
Click to collapse
Using API level 10 for ICS and API level 15 for GB will not work, you phone will just hang or endless reboots.
Pushing framework will reset all your settings, so if you choose to push framework, do a factory reset instead and just re-install your user apps.
After pushing /system/app, you must reboot to recovery and wipe dalvik and cache, another way of pushing is boot to recovery, mount /system then push.
I have only tested on Gingerbread 2.08.401.1 base, have no idea for ICS, but it should work, as the latest smali/baksmali supports ICS.
If you experience glitches, do it from the beginning by using un-modified apk and jar.
How it works: it is just baksmali (decompile dex to smali code WITHOUT debugging info) and then smali (compile back to dex)
Requirements: java and htc sync usb driver.
==========================================================================================================
Depricated - too much error.
RemoveDebuggingInfo_v2:
Added another script for simpler operations, instead of dragging hundreds of APKs, it is self descriptive, can pull and push /system/app, /system/framework, optimizing all files for app and framework, and reboot to recovery.
Tested on v2.08.401.1 ROM, on all files /system/app, /system/framework, should work on other device and ROM too, but not sure, test it yourself!
==========================================================================================================
For /data/app/ user application files, modify it may not installed at all, re-sign it also not help, so just do it manually to test.
But for now, here is a way to do it manually, since /system partition will not grow and many spaces left, you can simply put some APP on this partition, and following are working on my ROM, some should have naming as com.a.b.c... whatever is the name installed on /data/app/ stripe out the -1 at the end. Just besure the APP is uninstalled before pushing to /system/app/
Below are what I tested.
AdobePhotoshopExpress.apk
BarcodeScanner.apk
com.evernote.skitch.apk
ESFileExplorer.apk
GoogleDocs.apk
GoogleGoggles.apk
GoogleTranslate.apk
GPSTest.apk
org.hermit.audalyzer.apk
For APKs that has lib folder, you can just extract it and put it on /system/lib/ then del the lib folder inside the apk archive, e.g. flashplayer, adobereader.
adb should be start only once after booting your PC, if you get issues, like adb always shows restarting and out of date, it is because the included adb.exe in htc sync is out of date, and you had installed android sdk with environmental variable set, to fix it, both must have same version, or simply delete one of them, and if you have path variable set, you can del the included adb.exe as well.
Thanks for this, I will be sure to use it
Sent from my HTC Sensation XE with Beats Audio Z715e using xda premium
I have 189 Apps in system/app .... is there a way to make it with all files!?
Jonny said:
Thanks for this, I will be sure to use it
Just out of interest, what program do you use for getting the smali code?
Click to expand...
Click to collapse
It is the one and only, baksmali.jar and smali.jar http://code.google.com/p/smali/
xtcislove said:
I have 189 Apps in system/app .... is there a way to make it with all files!?
Click to expand...
Click to collapse
Yes I know it is so much, but need to write a sohphisticated code, maybe if I have time, I'll try to make it more easier, a vbscript or cmd script, or a shell script in linux. And don't forget the framework files too.
mudhi said:
I test it with all /system/app/ and /system/framework/ files, the ROM runs snapier, especially when you launching apps.
Click to expand...
Click to collapse
It is really so. I have checked it up.
mudhi said:
It is the one and only, baksmali.jar and smali.jar http://code.google.com/p/smali/
Click to expand...
Click to collapse
Thank you mudhi
a little off topic here, Is there a way to change smali files into a readable code (let's say i want to use it with eclipse !!)
i have tried searching and i came across Dex2Jar and jd-gui !!
my question here is: is there a way to use smali files into Eclipse ??
Alfaifi said:
Thank you mudhi
a little off topic here, Is there a way to change smali files into a readable code (let's say i want to use it with eclipse !!)
i have tried searching and i came across Dex2Jar and jd-gui !!
my question here is: is there a way to use smali files into Eclipse ??
Click to expand...
Click to collapse
Yes, use dex2jar to jar archive file, then jd-gui to view the source, you can also use DJ-decompiler (commercial) to view and change code, but that's not really readable, and compile back is too hard, and also jbe, ce etc... but I came to a conclusion.
Use dex2jar to decompile dex and use jd-gui to view the source for understand logic, method etc... and just reference it to smali code, and if you get use to it, hacking app will be easier, perhaps more easier than viewing the source code, because hackiing involviing mostly on 0 to 1, true to false, jump to where ... and that is only adding or changing a single code in smali, e.g. logic if a == b then c, if you want to make it always c, then just if 0 == 0 then c, or just a simple jump etc...
@mudhi new smali/baksmali 1.3.2 is out
And is also possible to remove debugging info from jar files that are present in framework folder?
texture said:
And is also possible to remove debugging info from jar files that are present in framework folder?
Click to expand...
Click to collapse
I think you can just rename them to .apk and then back to .jar.
mike1986. said:
I think you can just rename them to .apk and then back to .jar.
Click to expand...
Click to collapse
No you dont need to, just put(or pull) all framework files (both apks and jars) and it will process them all automatically.
Btw i just ran this on InsertCoin 4.1.1 for all APPS and Framework except i changed a script a bit (added -mx0) so it compresses APKS with 0 compression.
And can tell you that phone definitively feels faster, boots faster, apps open faster, and there a bit more free RAM available now.
Thank you mudhi allot for this!
mike1986. said:
@mudhi new smali/baksmali 1.3.2 is out
Click to expand...
Click to collapse
ah... hehe thank you, supposed ICS 4.0.3 is supported. Thank you!
Need a little clarification ..
java -version
if errorlevel 1 goto javaerr
---------------------
C:\>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.
---------------------
I installed java however still get an error ..
What is needed > to install ? Link Maybe ?
Also ... I found a small ops in the bat file ..
:javaerr
cls
echo Java is not found, please install java and rerun the script.
echo Hit anykey to quit
PAUSE
goto end < forgot this ?
Thanks ..
WarlockW said:
Need a little clarification ..
java -version
if errorlevel 1 goto javaerr
---------------------
C:\>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.
---------------------
I installed java however still get an error ..
What is needed > to install ? Link Maybe ?
Also ... I found a small ops in the bat file ..
:javaerr
cls
echo Java is not found, please install java and rerun the script.
echo Hit anykey to quit
PAUSE
goto end < forgot this ?
Thanks ..
Click to expand...
Click to collapse
You need to set java variable, here's how-to:
http://java.com/en/download/help/path.xml
mudhi, You've got few errors in start.bat file. If you want to pull the apps to "app" folder, use this command "adb pull /system/app/ app". If you do cd app, It won't find the adb in the app folder and won't do nothing.
ivicask said:
No you dont need to, just put(or pull) all framework files (both apks and jars) and it will process them all automatically.
Btw i just ran this on InsertCoin 4.1.1 for all APPS and Framework except i changed a script a bit (added -mx0) so it compresses APKS with 0 compression.
And can tell you that phone definitively feels faster, boots faster, apps open faster, and there a bit more free RAM available now.
Thank you mudhi allot for this!
Click to expand...
Click to collapse
Before optimizing with this script, my apks are all fixed with the vbscript by omniwolf, it only compress files that should be compressed, the script fixAllAPKs.vbs can be used before or after this. Anyway, I'll add a decision to run the script.
mudhi said:
Before optimizing with this script, my apks are all fixed with the vbscript by omniwolf, it only compress files that should be compressed, the script fixAllAPKs.vbs can be used before or after this. Anyway, I'll add a decision to run the script.
Click to expand...
Click to collapse
Is there any problem with doing 0 compression on all files? I dont have space problems, and doesnt that make phone run faster as it doesnt need to decompress any data? Saves both CPU and RAM?
drms12 said:
mudhi, You've got few errors in start.bat file. If you want to pull the apps to "app" folder, use this command "adb pull /system/app/ app". If you do cd app, It won't find the adb in the app folder and won't do nothing.
Click to expand...
Click to collapse
Oh yes, I know where's the error, because I have android sdk installed and environmental PATH variable are set, you can fix it by just set the PATH variable with where the adb.exe exist.
Or just change the script with this
ullapp
cd app
../adb pull /system/app/
or
ullapp
adb pull /system/app/ app
same as pullframe
mudhi said:
Oh yes, I know where's the error, because I have android sdk installed and environmental PATH variable are set, you can fix it by just set the PATH variable with where the adb.exe exist.
Or just change the script with this
ullapp
cd app
../adb pull /system/app/
or
ullapp
adb pull /system/app/ app
same as pullframe
Click to expand...
Click to collapse
Yes
I think you forgot to update the download, It still ver2.
There is an error in script - the push command to upload files to framework uploads them to /system/app
ICS 4.0.3 - got bootloop just after lockscreen shows. Had to restore system.

[ZIP] Dynamic automated build.prop editing

Hey,
since I'm flashing nightlies on a regular basis and also want to use my own custom /system/build.prop file, there are a few ways to accomplish both things as easy as possible:
Backing up /system/build.prop through a script in /system/addon.d
Flashing my own file using a zip after every update
Restoring previous build.prop using a Editor app and reboot
Manually change or add every desired entry and reboot
For most of you one of these ways should absolutely do the trick, but my problem was either things like build version, date, etc. got stuck at my custom file's one or I had to reboot after manually updating it, which got really annoying after several times.
So I decided to create my own flashable zip which works as follows:
Somewhere on the device is a simple text file in which are all those entries that shall be changed,added to or removed from /system/build.prop (In my case it's /sdcard/tweak.prop)
After mounting /system and /data (not if they are already) and setting write permissions to /system/build.prop the zip extracts a shell script to /tmp/tweakprop.sh
It This script scans the text file (aborts if not found) and looks for changed, new or unwanted entries in /system/build.prop in order to apply them. Changed entries will be overridden, new ones will be added, unwanted get removed and entries existing in /system/build.prop but not in your personal file will be ignored
When tweaking is done, it just removes /tmp/tweakprop.sh and unmounts /system and /data (only if they weren't mounted before) and reverts /system/build.prop's permissions to rw-r--r--
-> (See content of example.txt for more detailed examples and syntax!)
Using this method, you can not only forget about manually updating versions and/or lame reboots after updates for changes to take effect, but also edit your personal text file at any time without root rights beeing required. Once set up to be flashed after every update, your /system/build.prop is always tweaked as you wish and looks like a stock one (ROM version, etc. under About Phone).
The zip flashes well on all recoveries. Make sure your tweak.prop file ends with an empty line, otherwise the last line will be ignored!
I hope some of you can use this zip, it's free to modify. If you have any suggestions, let me know.
This project has been moved to a git repo at https://notabug.org/kl3/tweakprop. Please refer to it in the future to get updates as this is much easier for me to maintain. Upcoming changelog can be found here.
Changelog
Changelog
version 0.1:
initial release
version 0.2:
ignore lines in personal file not matching a valid entry pattern (someVAR=someVAL) to not mess up /system/build.prop and support personal structuring inside the file like "# media tweaks #", "# dalvik section #", etc.
code cleaned up
version 0.2.1:
typo fixed in line 24 of tweakprop.sh so the if-statement asks for the correct file (thanks to the_pirate_predator)
version 0.3:
changed the while-loop to get it's input directly from sed, which makes a second buffer file obsolete
version 0.3.5:
example.txt provided as tweak.prop template
ignore lines beginning with # or being empty
version 0.4:
instead of a fixed path, the personal file gets searched on internal storage (file name can be set in the script) so you can put your file anywhere - no more problems with /sdcard/ or /sdcard/0/ on different devices
personal file must not be empty, otherwise script aborts#
only override really different entry values in order to prevent "... value of someVAR overridden" spam in recovery log
version 0.4.5:
fixed last line of personal file being ignored due to deleting all empty lines before
speed up search for personal file, now looking on internal storage and even on external SD card if nothing was found before (ext. SD neither gets checked if present, nor mounted or unmounted, just trying to search on it silently)
version 0.4.5a:
same as 0.4.5a, but personal file is inside the zip and gets extracted to /tmp/tweak.prop, no need to have one on the internal storage
version 0.4.6(a):
output not shown in TWRP fixed, now works as it should
version 0.5:
code cleanup: everything's now in the update-binary, resulting in much less code and faster execution time
output to recovery should now work on all device-recovery combinations
version 0.5.1:
lines beginning with ! will be removed globally
little code-cleanup
version 0.5.2:
lines beginning with @ will append the string after | to values of existent entries
slight changes in code structure
version 0.5.3:
lines beginning with $ will change the value to the string after | only if the entry already exists, hence $telephony.lteCdmaDevice|1 is nothing but a more explicit approach of telephony.lteCdmaDevice=1, as the first one will only make changes but no new entries
version 0.5.4:
the build.prop file can now be backed up before editing using a BACKUP= line, see example.txt for details
tiny bug fixed
version 0.5.4a:
tweak.prop file (example.txt) is included, no personal file on your device's storage is used. Edit the zip's content before flashing!
version 0.5.9(a):
Error handling fixed, script properly exits now if anything failes and won't make further changes
More verbose output
Date and tweak.prop version added to backup files to keep track of them
Special characters like / are now escaped and handled correctly by sed
Slight changes in coding style as it's good practise
Click to expand...
Click to collapse
Such Awesome, much appreciate i wanted to make one too, but never got the time to.
Sent from my Xperia V using XDA Premium 4 mobile app
What should my text file look like if I just want to add one line of text at the end of my build.prop? For example,
qemu.hw.mainkeys=0
to activate softkeys on a device with capacitive buttons?
Thanks
Sent from my XT912 using Tapatalk
Need some information
I need explanation for the following lines of code.
Code:
## your personal file with tweaks and custom entries/values
tweak=/sdcard/0/tweak.prop
## abort execution if $tweaks not found
if [ ! -e $tweaks ]
then
ui_print "ERROR: Personal file not found. No changes were made."
ui_print "Script aborted. Check file path and flash again."
exit 0
fi
## read only lines matching any valid entry pattern (someVAR=someVAL), e.g.
## net.bt.name=Android, omni.device=n7100, url.legal=http://www ...
sed '/.*=.*/!d' $tweak > /tmp/tweak.prop
tweaks=/tmp/tweak.prop
You are giving a condition loop without even declaring the variable "tweaks" at first. You have declared only after the loop ends. Then that means, the code in the loop never executes. I think this is a small mistake you did with the code. Make sure you correct those.
But else, a great work!! :good: :good:
Sorry, but stick to one variable, "tweak", or "tweaks".
Otherwise, its a very simple, yet efficient algorithm. :good:
jonwgee said:
What should my text file look like if I just want to add one line of text at the end of my build.prop? For example,
qemu.hw.mainkeys=0
to activate softkeys on a device with capacitive buttons?
Click to expand...
Click to collapse
Just a simple text file containing your mentioned line. Any other empty or non-entry lines will be ignored by my script anyway.
the_pirate_predator said:
I need explanation for the following lines of code.
Code:
## your personal file with tweaks and custom entries/values
tweak=/sdcard/0/tweak.prop
## abort execution if $tweaks not found
if [ ! -e $tweaks ]
then
ui_print "ERROR: Personal file not found. No changes were made."
ui_print "Script aborted. Check file path and flash again."
exit 0
fi
## read only lines matching any valid entry pattern (someVAR=someVAL), e.g.
## net.bt.name=Android, omni.device=n7100, url.legal=http://www ...
sed '/.*=.*/!d' $tweak > /tmp/tweak.prop
tweaks=/tmp/tweak.prop
You are giving a condition loop without even declaring the variable "tweaks" at first. You have declared only after the loop ends. Then that means, the code in the loop never executes. I think this is a small mistake you did with the code. Make sure you correct those.
But else, a great work!! :good: :good:
Click to expand...
Click to collapse
You're right. It's a typo, I'm correcting it now. Thanks for your advice.
thewisenerd said:
Sorry, but stick to one variable, "tweak", or "tweaks".
Otherwise, its a very simple, yet efficient algorithm. :good:
Click to expand...
Click to collapse
I use a second buffer file that is a cleaned version of the original one. If I find a smarter way, I will.
I was searching for something like this for ages.
But i have a nob question! lol
I need to create a text file with all the lines i want to add to my built.prop file, so where I put the text file? And i have to give a certain name to that file or any name will do?
Hugo
oguh said:
I need to create a text file with all the lines i want to add to my built.prop file, so where I put the text file? And i have to give a certain name to that file or any name will do?
Click to expand...
Click to collapse
My script searches for a file called tweak.prop located at your internal storage (storage/emulated/0/tweak.prop or sdcard/tweak.prop or sdcard/0/tweak.prop), but you can freely change the line
PHP:
tweak=/sdcard/0/tweak.prop
to any path you want your personal file to be.
klenamenis said:
My script searches for a file called tweak.prop located at your internal storage (storage/emulated/0/tweak.prop or sdcard/tweak.prop or sdcard/0/tweak.prop), but you can freely change the line
PHP:
tweak=/sdcard/0/tweak.prop
to any path you want your personal file to be.
Click to expand...
Click to collapse
Thx for the quick response, and for your great work.
hugo
Sorry but i don't get it.
i need to create a txt file called tweak.prop and place it where i want, for example /sdcard/tweak.prop
after extracting the tweakprop-0.3.zip for editing the line /tmp/tweakprop.sh
Code:
## your personal file with tweaks and custom entries/values
tweak=/sdcard/tweak.prop
zipping meta-inf and tmp folder and finally flashing this zip.. am i doing something wrong ?
because it takes no changes.
got this line in tweak.prop at /sdcard/tweak.prop
Code:
ro.sf.lcd_density=400
sorry, i really dont get it.
bnbagiz said:
Sorry but i don't get it.
i need to create a txt file called tweak.prop and place it where i want, for example /sdcard/tweak.prop
after extracting the tweakprop-0.3.zip for editing the line /tmp/tweakprop.sh
Code:
## your personal file with tweaks and custom entries/values
tweak=/sdcard/tweak.prop
zipping meta-inf and tmp folder and finally flashing this zip.. am i doing something wrong ?
because it takes no changes.
Click to expand...
Click to collapse
As my script already shows, changing the path to /sdcard/0/tweak.prop again should do the trick.
I just want to change my DPI with this. What do I need to change in your default tweak.prop to be able to do that?
Click thanks if I helped you.
Sent from my SM-N900W8 using XDA Premium mobile app
Code:
klenamenis said:
As my script already shows, changing the path to /sdcard/0/tweak.prop again should do the trick.
Click to expand...
Click to collapse
did not work ! :/ you mean changing the path for the tweak.prop in the unzipped tweakprop.sh in /tmp/, aren't you ?
Code:
build=/system/build.prop
## your personal file with tweaks and custom entries/values
tweak=/sdcard/0/tweak.prop
---------- Post added at 02:41 PM ---------- Previous post was at 02:34 PM ----------
sauron82 said:
I just want to change my DPI with this. What do I need to change in your default tweak.prop to be able to do that?
Click thanks if I helped you.
Sent from my SM-N900W8 using XDA Premium mobile app
Click to expand...
Click to collapse
that is what i am trying to do
you need to change the line
Code:
ro.sf.lcd_density="value you like to have, i.e. 400"
bnbagiz said:
Code:
did not work ! :/ you mean changing the path for the tweak.prop in the unzipped tweakprop.sh in /tmp/, aren't you ?
Code:
build=/system/build.prop
## your personal file with tweaks and custom entries/values
tweak=/sdcard/0/tweak.prop
Click to expand...
Click to collapse
Yes, that's what I meant. Then just try any other path. I guess the internal storage's path is a device specific thing. Which device do you? I would try locating your personal file at /system as this path exists on all devices/ROMs.
klenamenis said:
Yes, that's what I meant. Then just try any other path. I guess the internal storage's path is a device specific thing. Which device do you? I would try locating your personal file at /system as this path exists on all devices/ROMs.
Click to expand...
Click to collapse
I am using a LG G2 Intern. D802
PAC-Man ROM (but thing thats irrelevant)
so if i place my tweak.prop in /system/ i need to edit the path in tweakprop.sh right ?
edit:
personal file is in /system/tweak.prop
editting tweakprop.sh line to
/system/tweak.prop
does not work don't get it .. sounds so simple, actually it is, but i don't know what i am doing wrong
bnbagiz said:
that is what i am trying to do you need to change the line
Code:
ro.sf.lcd_density="value you like to have, i.e. 400"
Click to expand...
Click to collapse
I know that, but where do I put it in the provided tweak.prop? What do I remove from the provided tweak.prop so that's the only change? I really don't know what any of this code actually means. Thanks to the OP for providing this, but instructions aren't very clear.
Click thanks if I helped you.
Sent from my SM-N900W8 using XDA Premium mobile app
You're my hero.So tired of changing build.prop values every time I try a different ROM. :good:
bnbagiz said:
edit:
personal file is in /system/tweak.prop
editting tweakprop.sh line to
/system/tweak.prop
does not work don't get it .. sounds so simple, actually it is, but i don't know what i am doing wrong
Click to expand...
Click to collapse
Hm.. Which recovery? Maybe it's a problem with the updater-script doesn't get executed correctly. Sadly, I have no possibilities to test those scenarios.
sauron82 said:
I know that, but where do I put it in the provided tweak.prop? What do I remove from the provided tweak.prop so that's the only change? I really don't know what any of this code actually means. Thanks to the OP for providing this, but instructions aren't very clear.
Click to expand...
Click to collapse
I didn't provide any personal file. If you only want to change this line, create a file called tweak.prop containing only this line and place it right on your internal storage.
Sent from my GT-N7100 using Tapatalk
bnbagiz said:
I am using a LG G2 Intern. D802
PAC-Man ROM (but thing thats irrelevant)
so if i place my tweak.prop in /system/ i need to edit the path in tweakprop.sh right ?
edit:
personal file is in /system/tweak.prop
editting tweakprop.sh line to
/system/tweak.prop
does not work don't get it .. sounds so simple, actually it is, but i don't know what i am doing wrong
Click to expand...
Click to collapse
If you put it in /system/ it'll get erased when you flash a new nightly anyways, as most .zip scripts wipe the /system partition... So... it would be best to keep it on the SD card.

Categories

Resources