Related
Ok sorry if this has all ready been covered, but I did a search and could not find anything. I am trying to re-size the wallpaper to use the entire screen when in landscape mode with out cutting off part of the photo. After downloading apktools, and recompiling the launcher2.apk and opening the wallpaper_chooser.xml file I find this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical"> <ImageView android:layout_height="0.0dip" android:layout_width="fill_parent" android:layout_weight="1.0" android:scaleType="fitCenter" android:id="@id/wallpaper"/> <Gallery android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@id/gallery"/> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@id/set" android:text="@string/wallpaper_instructions" android:layout_gravity="center_horizontal"/> </LinearLayout>
Now correct me if I am wrong but can I set this:
"android:layout_gravity="center_horizontal"/>"
to this:
android:layout_gravity="fill_parent"/>
recompile the .xml and .apk would this cause the wallpaper to re-size it's self to fill the window instead of cutting it off?
Any suggestions or inputs from more experienced programmers?
Moved to proper forum
Rockstar52 said:
Ok sorry if this has all ready been covered, but I did a search and could not find anything. I am trying to re-size the wallpaper to use the entire screen when in landscape mode with out cutting off part of the photo. After downloading apktools, and recompiling the launcher2.apk and opening the wallpaper_chooser.xml file I find this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical"> <ImageView android:layout_height="0.0dip" android:layout_width="fill_parent" android:layout_weight="1.0" android:scaleType="fitCenter" android:id="@id/wallpaper"/> <Gallery android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@id/gallery"/> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@id/set" android:text="@string/wallpaper_instructions" android:layout_gravity="center_horizontal"/> </LinearLayout>
Now correct me if I am wrong but can I set this:
"android:layout_gravity="center_horizontal"/>"
to this:
android:layout_gravity="fill_parent"/>
recompile the .xml and .apk would this cause the wallpaper to re-size it's self to fill the window instead of cutting it off?
Any suggestions or inputs from more experienced programmers?
Click to expand...
Click to collapse
The problem is that the parent is probably all of your homescreens combined, not just the screen you're currently on. You could try that though. Launcher Pro has a setting to do this by default, but if you want to use the stock launcher, also try setting layout_height and layout_width to the resolution of your device. (eg. on my A101, it would be layout_height="600px" and "layout_width="1024px"). Dip is Device Independent Pixels, which can get wonky if you change the LCD Density setting, so I tend to use pix instead for my personal compiling.
There's probably some stuff on google on this topic. I'll try to find some time to look if you can't find anything.
msticninja said:
The problem is that the parent is probably all of your homescreens combined, not just the screen you're currently on. You could try that though. Launcher Pro has a setting to do this by default, but if you want to use the stock launcher, also try setting layout_height and layout_width to the resolution of your device. (eg. on my A101, it would be layout_height="600px" and "layout_width="1024px"). Dip is Device Independent Pixels, which can get wonky if you change the LCD Density setting, so I tend to use pix instead for my personal compiling.
There's probably some stuff on google on this topic. I'll try to find some time to look if you can't find anything.
Click to expand...
Click to collapse
Thanks. I tried the the full_parent code but when I went to recompile it, it said the code is invalid, so I changed it to full_center, now after recompiling the apk Android won't accept an unsigned apk.
Rockstar52 said:
Thanks. I tried the the full_parent code but when I went to recompile it, it said the code is invalid, so I changed it to full_center, now after recompiling the apk Android won't accept an unsigned apk.
Click to expand...
Click to collapse
That's a system app, so it should not be signed to begin with. You must over write the original manually, don't try to install.
Use APKManager from :http://forum.xda-developers.com/showthread.php?t=695701and follow the instructions. 9 for decompile, edit the files, 11 to recompile, yes to system app, yes to keep originals, go into keep folder and delete resources.arsc and the files you modified, then go back to script and let it complete. I like to use Winrar to recompress the apk to 0 (no) compression, but it's not necessary. APKTools doesn't remake the resources.arsc automatically, so if you modify xml, APKManager is a much more stable and simple way to recompile. Just remember to delete the resources.arsc and any files you modified from the "keep" folder when the script is paused.
msticninja said:
That's a system app, so it should not be signed to begin with. You must over write the original manually, don't try to install.
Use APKManager from :http://forum.xda-developers.com/showthread.php?t=695701and follow the instructions. 9 for decompile, edit the files, 11 to recompile, yes to system app, yes to keep originals, go into keep folder and delete resources.arsc and the files you modified, then go back to script and let it complete. I like to use Winrar to recompress the apk to 0 (no) compression, but it's not necessary. APKTools doesn't remake the resources.arsc automatically, so if you modify xml, APKManager is a much more stable and simple way to recompile. Just remember to delete the resources.arsc and any files you modified from the "keep" folder when the script is paused.
Click to expand...
Click to collapse
ok thanks, I'll give it a shot and report back.
ok was able to use APKMananger, I took the framework-res.apk unpacked and replaced some photos. I then rezipped and copied the new one back to system/framework but each time it goes into a bootloop?
Rockstar52 said:
ok was able to use APKMananger, I took the framework-res.apk unpacked and replaced some photos. I then rezipped and copied the new one back to system/framework but each time it goes into a bootloop?
Click to expand...
Click to collapse
Tell me your exact process in APKManager, and the files you are changing. Make sure you are hitting Y to system app and then deleting changed files in Keep folder. If you do a full decompile and recompile, it will always bootloop, because some XMLs do not reencode correctly, even if you haven't changed them.
msticninja said:
Tell me your exact process in APKManager, and the files you are changing. Make sure you are hitting Y to system app and then deleting changed files in Keep folder. If you do a full decompile and recompile, it will always bootloop, because some XMLs do not reencode correctly, even if you haven't changed them.
Click to expand...
Click to collapse
My bad, I am able to dcompile, edit the .xml and recompile the Launcher.apk. Which I copy from the folder /system/app/. I get the boot loop when I try to edit the (Android System) framework-res.apk from the folder /system/framework. All I am trying to do in there is replace some of the system icons to my own custom ones, making sure that I use the same image type, px size, overall file size.
Rockstar52 said:
My bad, I am able to dcompile, edit the .xml and recompile the Launcher.apk. Which I copy from the folder /system/app/. I get the boot loop when I try to edit the (Android System) framework-res.apk from the folder /system/framework. All I am trying to do in there is replace some of the system icons to my own custom ones, making sure that I use the same image type, px size, overall file size.
Click to expand...
Click to collapse
Then don't bother decompiling. Just unpack and repack without decode or reencode. You can just use Winrar for that. If you change a .9.png, not just .png, you'll need to decomp/recomp and delete resources.arsc in between.
msticninja said:
Then don't bother decompiling. Just unpack and repack without decode or reencode. You can just use Winrar for that. If you change a .9.png, not just .png, you'll need to decomp/recomp and delete resources.arsc in between.
Click to expand...
Click to collapse
So using a file explorer for root, I would change the framework-res.apk to framework-res.zip on my Archos then copy the file to my computer unzip, change the .png rezip then replace the modified .apk with the old one. Is the correct?
EDIT:
I did the steps above, and now it cleared the bootloop problem, but the funny thing is the .png files I modified are not being used, it still uses the stock images, where else could these images be?
Rockstar52 said:
So using a file explorer for root, I would change the framework-res.apk to framework-res.zip on my Archos then copy the file to my computer unzip, change the .png rezip then replace the modified .apk with the old one. Is the correct?
EDIT:
I did the steps above, and now it cleared the bootloop problem, but the funny thing is the .png files I modified are not being used, it still uses the stock images, where else could these images be?
Click to expand...
Click to collapse
They're in the drawable-mdpi folder IIRC.
How to Add Pie Controls to your 4.+ ROM with ease
Any and all feedback is welcome/encouraged! Lets Make an awesome ROM together!
What You Need:
PC
A program to decompile/recompile apk's ( I prefer Virtuous Ten Studio)
The latest LMT Launcher
The settings.apk and framework-res.apk from your ROM
Since I have already typed up all of the code, I will just provide you with it and tell you where to place it. :laugh:
Step 1: Install your framework for your apk tool of choice, and decompile your settings.apk. Decompile your LMT Launcher apk as well + uninstall any previous version from your device.
Step 2: To get the easiest step out of the way, inside of the decompiled LMT launcher, open the AndroidManifest.xml file and delete the below line. Now save and recompile.
Code:
<category android:name="android.intent.category.LAUNCHER" />
Step 3: Navigate to the res>xml folder inside of you decompiled settings apk and open the settings_headers.xml file.
Paste the code below where you feel fit, I have chosen to place the code under the
"<intent android:action="com.android.settings.MANUFACTURER_APPLICATION_SETTING" />" line.
Code:
</header>
<header android:title="@string/navigation_settings" />
<header android:id="@id/pienav_settings" android:title="@string/pienav_label">
<intent android:targetPackage="com.android.lmt" android:action="android.intent.action.MAIN" android:targetClass="com.android.lmt.LMT" />
Step 4: Navigate to the res>values folder inside of you decompiled settings apk and open the strings.xml file. Paste the following code at the bottom of the file above the </resources> line
Code:
<string name="navigation_settings">Navigation</string>
<string name="pienav_label">Pie Controls</string>
Step 5: Navigate to the res>values folder inside of you decompiled settings apk and open the ids.xml file. Paste the following code at the bottom of the file above the </resources> line
Code:
<item type="id" name="pienav_settings">false</item>
Save everything and recompile your settings
How to Flash:
I have made a zip file with necessary folders and updater script, all you have to do is place your modded LMT Launcher in the data/app folder and your modded Settings in the system/app folder, then flash it!
reserved
I followed your instructions and I was able to recompile the Settings.apk (AOKP 4.2.2 Galaxy Nexus) but after pushing the apk to the system and applying proper permissions, the Settings app doesn't show up on my app drawer. I also used VTS to compile it and (I think) I installed the framework-res.apk correctly. Any idea what went wrong?
daggerxXxsin said:
I followed your instructions and I was able to recompile the Settings.apk (AOKP 4.2.2 Galaxy Nexus) but after pushing the apk to the system and applying proper permissions, the Settings app doesn't show up on my app drawer. I also used VTS to compile it and (I think) I installed the framework-res.apk correctly. Any idea what went wrong?
Click to expand...
Click to collapse
Download the Pie Flasher here, & put your settings.apk inside of the system app folder and put your modded lmt launcher.apk inside of the data app folder, then flash.
Make sure you didn't remove the "<category android:name="android.intent.category.LAUNCHER" />" line from your settings.apk
I need help to change blink rate from the notification LED in framework-res.apk
When decompile in folder res/values are file integers.xml
I've change defaultNotificationLedOff to 500 to make faster blinking.
When I recompile apk and flash to phone it doesnt boot.
Can someone help?
Im on Omega v5
I am tying to do the same thing on my Sony Xperia ZL.
I have been using Apk manager to de and re compile.
The problem with me was that the new edited integers.xml did not show in the new recompiled fie.
In order to see what I am saying, decompile the framework-res.apk, make the changes in the integers.xml and then recompile.
Now Decompile you own work and open the integers.xml, you will be surprised what you see.
The changes you made do not exist.
decompile I9500 framework-res.apk
ahgahg said:
I am tying to do the same thing on my Sony Xperia ZL.
I have been using Apk manager to de and re compile.
The problem with me was that the new edited integers.xml did not show in the new recompiled fie.
In order to see what I am saying, decompile the framework-res.apk, make the changes in the integers.xml and then recompile.
Now Decompile you own work and open the integers.xml, you will be surprised what you see.
The changes you made do not exist.
Click to expand...
Click to collapse
I met the same problem. When I decompile the samsung I9500 framework-res.apk, then modify nothing and recompile it. When I put the recompiled file into the system, the system will auto reboot and can't go to the lockscreen.
But when I doing the same thing on HTC device, it works well, so why this happen?
So ive been trying to modify the framework-res.apk and i can decompile it but just cant recompile it, Even if i just decompile with no edits then re-compile it errors out with APKTool or XdaAutotool or apk multi tool. Anyone have an luck????
supercobaltss said:
So ive been trying to modify the framework-res.apk and i can decompile it but just cant recompile it, Even if i just decompile with no edits then re-compile it errors out with APKTool or XdaAutotool or apk multi tool. Anyone have an luck????
Click to expand...
Click to collapse
Are you using the S5 framework and twframework-res? Or perhaps you have an out of date decompiler. Did you copy META-INF and AndroidManifest.xml from your the old apk to the recompiled apk? It's hard to guess at the problem since you didn't give us crucial details on what tool versions and steps you used or exact error messages you saw. There are a number of threads on the subject, so do a search to see what is working for others.
Hi,
I want to edit the SystemUI_ZKE.apk, but when I use "APK Editor Pro" for instance the apk crashes after a reboot.
What would be the right way to do this? My goal is to delete the charging.ogg file that wakes my wife as I plugin a charger when I go to bed
Any other solution to *that* problem is welcome too.
I'm on a A2017G B06 btw.
Thanks in advance,
Cheers,
/Cacti
Edit: Sorry, wrong forum, should be posted in the Questions & Answers. @mods: please move it, thanks.
le_cactus said:
Hi,
I want to edit the SystemUI_ZKE.apk, but when I use "APK Editor Pro" for instance the apk crashes after a reboot.
What would be the right way to do this? My goal is to delete the charging.ogg file that wakes my wife as I plugin a charger when I go to bed
Any other solution to *that* problem is welcome too.
I'm on a A2017G B06 btw.
Thanks in advance,
Cheers,
/Cacti
Edit: Sorry, wrong forum, should be posted in the Questions & Answers. @mods: please move it, thanks.
Click to expand...
Click to collapse
You need to use apktool on Windows or Linux instead: https://ibotpeaches.github.io/Apktool/. You'll need Java already installed.
Your device also needs to be rooted and have TWRP recovery installed.
Put the apktool.jar and wrapper script in the system directory (C:\Windows on Windows)
Pull frameworks and SystemUI from your device with
Code:
adb pull /system/framework/framework-res.apk
adb pull /system/framework/framework-zte-res.apk
adb pull /system/priv-app/SystemUI_ZTE/SystemUI_ZTE.apk
Install frameworks to your computer:
Code:
apktool if framework-res.apk
apktool if framework-zte-res.apk
Decompile SystemUI_ZTE.apk:
Code:
apktool d SystemUI_ZTE.apk
Make whatever changes you want to make then recompile with:
Code:
apktool b SystemUI_ZTE
Use signapk.jar to sign the apk then put the apk into a flashable zip and flash to your device in TWRP.
If you want to make changes to smali you'll need to pull the SystemUI_ZTE odex file and deodex the apk with oat2dex and then use 7-zip or WinRAR to paste the classes.dex file into the apk before decompiling.
Gr8 tutorial. I'll try that tomorrow, hope I get it fixed. Thank you!
Cheers,
/Cacti
Sent from my ZTE A2017G using XDA-Developers Legacy app
Hi,
*
Earlier I tried with APK Editor Pro (https://play.google.com/store/apps/details?id=com.gmail.heagoo.apkeditor.pro)
What happened was (after replacing the SystemUI_ZTE.apk with the modified APK) after a reboot the system booted with parts of the UI nog working. Navigationkeys didn't work except for the home button, and I had no status bar at all. After rebooting again it only showed my wallpaper, and no matter what I did it wouldn't show me anything else. So I had to restore.
*
Modifying the APK with the APKTool gave me the exact same result. Only thing i did differently as to bkores guide was I signed it using ZipSigner (but that never failed me before) and I just replaced the file using TWRP, instead of flashing it through an installer zip. But I can't imagine that being the problem?
*
Anyways, anybody able to modify the SystemUI_ZTE.apk? All I need is the B06 (A2017G) with a replaced charging.ogg (with only silence).*Any tips are welcome.
*
TIA,
*
Cheers,
/Cacti
Sent from my ZTE A2017G using XDA-Developers Legacy app
le_cactus said:
Hi,
*
Earlier I tried with APK Editor Pro (https://play.google.com/store/apps/details?id=com.gmail.heagoo.apkeditor.pro)
What happened was (after replacing the SystemUI_ZTE.apk with the modified APK) after a reboot the system booted with parts of the UI nog working. Navigationkeys didn't work except for the home button, and I had no status bar at all. After rebooting again it only showed my wallpaper, and no matter what I did it wouldn't show me anything else. So I had to restore.
*
Modifying the APK with the APKTool gave me the exact same result. Only thing i did differently as to bkores guide was I signed it using ZipSigner (but that never failed me before) and I just replaced the file using TWRP, instead of flashing it through an installer zip. But I can't imagine that being the problem?
*
Anyways, anybody able to modify the SystemUI_ZTE.apk? All I need is the B06 (A2017G) with a replaced charging.ogg (with only silence).*Any tips are welcome.
*
TIA,
*
Cheers,
/Cacti
Click to expand...
Click to collapse
Try copying META-INF folder from old apk to new apk. If that doesn't work try copying resources.arsc from new apk to old apk and flash the old apk. Don't sign
Can it have anything to do with the .odex file?
I'll try the meta-inf thingy and see if that works
Cheers,
/Cacti
Sent from my ZTE A2017G using XDA-Developers Legacy app
Actually try this instead. I think the apk needs to be deodexed before it can be modified like you said.
Pull the odex file
Code:
adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI.odex
Get smali folder from the odex file with oat2dex.jar here: https://github.com/testwhat/SmaliEx/releases/tag/snapshot
Open command window in directory of odex file
Code:
java -jar oat2dex.jar smali SystemUI.odex
Decompile the apk and then copy and paste the smali folder into the directory of the decompiled apk.
Make your charging.ogg change and then recompile the apk. Copy and paste the META-INF from original apk to new apk.
Push apk to your device and delete the "oat" folder in the SystemUI_ZTE folder on your device.
Hi,
Thank you for your support so far, but that didn't work out eighter....
bkores said:
Code:
adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI.odex
Click to expand...
Click to collapse
Assuming you made a typo (since there is no SystemUI.odex) I used this instead:
Code:
adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI_ZTE.odex
bkores said:
Get smali folder from the odex file with oat2dex.jar
Click to expand...
Click to collapse
After the oat2dex command I don't have a smali folder, just 5434 smali files scattered over serveral folders, so I don't know how to proceed from there.
Cheers,
/Cacti
le_cactus said:
Hi,
Thank you for your support so far, but that didn't work out eighter....
Assuming you made a typo (since there is no SystemUI.odex) I used this instead:
After the oat2dex command I don't have a smali folder, just 5434 smali files scattered over serveral folders, so I don't know how to proceed from there.
Cheers,
/Cacti
Click to expand...
Click to collapse
Well then create a folder called smali in the directory of decompiled apk and paste the folders into smali
Can someone help me, i want to change framework.jar but there is no classes.dex in jar nor framework.odex in /system/framework/oat/arm64 (also arm). Because of it i can't decompile it with smali/baksmali tool. I want to change volume steps in AudioService exactly what VolumeSteps+ do but without Xposed. Any help? I'm on Nougat B10 Rom.
SkaboXD said:
Can someone help me, i want to change framework.jar but there is no classes.dex in jar nor framework.odex in /system/framework/oat/arm64 (also arm). Because of it i can't decompile it with smali/baksmali tool. I want to change volume steps in AudioService exactly what VolumeSteps+ do but without Xposed. Any help? I'm on Nougat B10 Rom.
Click to expand...
Click to collapse
Perhaps this can help a bit : https://forum.xda-developers.com/axon-7/themes/a2017-volume-steps-enabler-call-media-t3745747
If you want a decompiled framework, I can send you. Just pm me.
If you want I'll implement your mods and recompile again. Up to you to test
raystef66 said:
Perhaps this can help a bit : https://forum.xda-developers.com/axon-7/themes/a2017-volume-steps-enabler-call-media-t3745747
If you want a decompiled framework, I can send you. Just pm me.
If you want I'll implement your mods and recompile again. Up to you to test
Click to expand...
Click to collapse
I solved a problem, AudioService is not in framework.jar anymore, it's on services.jar. Check my post on your mentioned thread.