comparing CN and EU firmware, in depth changes - Realme X2 Guides, News, & Discussion

I am ttrying to find interesting changes between the EU (A16) and the CN (A13) firmware, i have decompiled the entire rom and ofund some interesting data, but since it is many and i don't have time now to put it here, i will start with the other configuration files.
I haven't wrote about any difference, only the interesting ones
let's start:
file hostapd_default.conf
location: /system/etc/hostapd/
CN firmware:
Code:
# ieee80211w: Whether management frame protection (MFP) is enabled
# 0 = disabled (default)
# 1 = optional
# 2 = required
ieee80211w=0
EU firmware:
Code:
# ieee80211w: Whether management frame protection (MFP) is enabled
# 0 = disabled (default)
# 1 = optional
# 2 = required
ieee80211w=1
Location: etc\permissions
only in EU:
Code:
com.oppo.exp.xml
com.oppo.features_allnet_common_19672.xml
com.oppo.features_expCommon.xml
only in CN:
Code:
com.oppo.features.allnet.xml
com.oppo.features.cn_google.xml
com.oppo.features_allnet_common_19771.xml
com.oppo.rom.allnet.xml
com.oppo.rom.allnetcmccdeep.xml
com.oppo.rom.allnetcmccmp.xml
com.oppo.rom.xml
Location: etc\security
different entirely, this can explain why you can't easily transfer apps from EU to CN, because of different signatures.
this one is interesting:
Location: /system/selinux
filename: plat_property_contexts
this line only presnt in CN
Code:
vendor.boot.verifiedbootstate u:object_r:oppo_fingerprint_prop:s0
Location: /system/sysconfig
filename: system_app_name
different entirely, I don't know what is the rule of this file but it might be interesting
location /system/oppo/
filename: recovery_rootcheck
another interesting file, is it checking the files for modifications?
location /system/oppo/
filename: sys_deviceidle_whitelist.xml
another inetresting file with different content, it is whitelist for apps.

<Mod edit: Quoted OP removed>
Is there a way you can dump the ota of a13 or even the whole file so I can install it on my x2 cn?

there are must be some global identificators for EU and CN must be, because incallui, call recorder apks have only 3 byte changes like "EXP" additional in EU.

continue:
those apps are the same in both versions:
Code:
system/app/AntHalService
system/app/ARCore_stub
system/app/atfwd
system/app/Athena
system/app/BackupRestoreRemoteService
system/app/BluetoothMidiService
system/app/BookmarkProvider
system/app/BTtestmode
system/app/CallFeaturesSetting
system/app/ColorAppServicesManager
system/app/ConfURIDialer
system/app/CtsShimPrebuilt
system/app/datastatusnotification
system/app/DecryptAssistant
system/app/DeviceInfo
system/app/DynamicDDSService
system/app/embms
system/app/FidoCryptoService
system/app/FileInfoProvider
system/app/GoogleContactsSyncAdapter
system/app/GoogleExtShared
system/app/GooglePrintRecommendationService
system/app/ImageTool
system/app/imssettings
system/app/KeKeMarket
system/app/KeKeUserCenter
system/app/LteDirectDiscovery
system/app/MIMOSISOApk
system/app/ModemTestMode
system/app/OcrService
system/app/OppoCriticalLogService
system/app/OppoDolbyService
system/app/OppoDropboxChmodService
system/app/OppoEngineerNetwork
system/app/OppoExServiceUI
system/app/OppoLFEHer
system/app/OppoLogKit
system/app/OppoPortalDetect
system/app/OppoPostmanService
system/app/OppoQualityProtect
system/app/PacProcessor
system/app/Qmmi
system/app/QtiSystemService
system/app/QtiTelephonyService
system/app/RadioInfo
system/app/remoteSimLockAuthentication
system/app/remotesimlockservice
system/app/ResourceMonitor
system/app/RfTestApk
system/app/RomUpdate
system/app/SAUHelper
system/app/SecureElement
system/app/smcinvokepkgmgr
system/app/SoterService
system/app/talkback
system/app/uceShimService
system/app/uimlpaservice
system/app/uimremoteclient
system/app/uimremoteserver
system/app/WallpaperBackup
system/app/WapiCertManage
system/app/WAPPushManager
system/app/WifiBackupAndRestore
system/app/WifiRfAgeTest
system/app/WifiRxSensTest
system/app/workloadclassifier
system/app/xdivert
system/priv-app/AndroidPlatformServices
system/priv-app/CallEnhancement
system/priv-app/CNEService
system/priv-app/com.qualcomm.location
system/priv-app/ConfigUpdater
system/priv-app/CtsShimPrivPrebuilt
system/priv-app/DeepThinker
system/priv-app/dpmserviceapp
system/priv-app/GmsCore
system/priv-app/GoogleBackupTransport
system/priv-app/GoogleExtServices
system/priv-app/GoogleOneTimeInitializer
system/priv-app/GooglePartnerSetup
system/priv-app/GoogleServicesFramework
system/priv-app/ims
system/priv-app/OppoGestureEngine
system/priv-app/OppoSoundTriggerTestApp
system/priv-app/ProxyHandler
system/priv-app/qcrilmsgtunnel
system/priv-app/seccamservice
system/priv-app/SharedStorageBackup
system/priv-app/SoftsimRedteaRoamingDeamon
system/priv-app/StatementService
system/priv-app/UserDictionaryProvider
system/priv-app/WfdService
those apps only in EU:
Code:
system/app/AfterSalesService
system/app/AvastOfferWall
system/app/Calculator2
system/app/CalendarGoogle
system/app/Chrome
system/app/ColorFileStand
system/app/ColorScreenRecorder
system/app/com.facebook.appmanager
system/app/EmailPartnerProvider
system/app/Gamecenter
system/app/Gmail2
system/app/GoogleLatinInput
system/app/GoogleTTS
system/app/Keep
system/app/Locationpicker
system/app/LockAssistant
system/app/Maps
system/app/Messages
system/app/OcrScanner
system/app/OppoChromeCustomizations
system/app/OppoCompass2
system/app/OppoOperationManualExp
system/app/OppoPartnerBookmarksProvider
system/app/OppoPhoneActivationExp
system/app/OppoWeather2
system/app/WebViewStub
system/app/YouTube
system/priv-app/CarrierServices
system/priv-app/CellBroadcastReceiver
system/priv-app/com.facebook.services
system/priv-app/com.facebook.system
system/priv-app/GoogleFeedback
system/priv-app/GooglePackageInstaller
system/priv-app/GoogleRestore
system/priv-app/LogTool
system/priv-app/NewSoundRecorder
system/priv-app/Omacp
system/priv-app/Phonesky
system/priv-app/PlayAutoInstallConfig
system/priv-app/SetupWizard
system/priv-app/SoftsimRedteaRoaming
system/priv-app/TagGoogle
system/priv-app/Velvet
system/priv-app/Wellbeing
those are only in CN:
Code:
system/app/BaiduInput
system/app/Calendar
system/app/CloudService
system/app/ColorDirectService
system/app/ColorDirectUI2
system/app/com.mobiletools.systemhelper-19771
system/app/CTAutoRegist
system/app/Deamon
system/app/Feedback
system/app/FindMyPhoneClient2
system/app/IFlySpeechService
system/app/Instant
system/app/InstantLocalService
system/app/NetworkLocation
system/app/OcrScanner2
system/app/OppoOperationManual
system/app/OppoPhoneActivation
system/app/OPPOWallet
system/app/OppoWifiSecureDetect
system/app/OVoiceManagerService
system/app/Prome
system/app/RegService
system/app/RemoteGuardService
system/app/SogouInput
system/app/SupportServices
system/app/ThirdSupport
system/app/WebViewGoogleNX
system/priv-app/FindMyPhone
system/priv-app/GooglePlayServicesUpdater
system/priv-app/OmsService
system/priv-app/OppoSpeechAssist
system/priv-app/OppoSpeechService
system/priv-app/PackageInstaller
system/priv-app/SmartLock
system/priv-app/Tag
regarding smali changes, in next post (when i get to it)

Btw, why you guys wants eu rom instead of cn? Setting language to English don't make it same as eu one?
If not then you can try this
delete the cn only apps with their libs
Place eu only apps with their libs
If it bootloop then delete the syatem/priv-app, syatem/app, system/framework folder from cn rom, put these folders from eu to cn and flash it.
If it doesn't work maybe we need to modify systemui.apk or framework thingy, if yes then compare it with eu ones and edit it accordingly.
BTW the only reason we can't flash eu on cn is coz of partition size difference?
Then replace only system.img from eu to cn, keep rest firmware as original (CN).
You can use supers kitchen and deodex the cn rom and try to boot it.
All of these are lil wild but worth trying.

narshi shukla said:
Btw, why you guys wants eu rom instead of cn? Setting language to English don't make it same as eu one?
If not then you can try this
delete the cn only apps with their libs
Place eu only apps with their libs
If it bootloop then delete the syatem/priv-app, syatem/app, system/framework folder from cn rom, put these folders from eu to cn and flash it.
If it doesn't work maybe we need to modify systemui.apk or framework thingy, if yes then compare it with eu ones and edit it accordingly.
BTW the only reason we can't flash eu on cn is coz of partition size difference?
Then replace only system.img from eu to cn, keep rest firmware as original (CN).
You can use supers kitchen and deodex the cn rom and try to boot it.
All of these are lil wild but worth trying.
Click to expand...
Click to collapse
Because you cannot introduce normally your account: you can only apply for it with a Chinese number of phone, also you cannot change your launcher + notifications problem.

edit: the original table was made in excel, but putting it here caused crappy results, is there any better way to do this?
comparison of APP folder apps:
file change in Resources change in Smali change in Cert change in assets
system/app/ApplicationsProvider changes in resources no changes in smali changes in cert no assets in decompiling
system/app/AssistantScreen no changes in resources no smali in decompiling changes in cert changes in assets
system/app/BackupAndRestore no changes in resources no smali in decompiling changes in cert changes in assets (minor)
system/app/Bluetooth no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/BuiltInPrintService no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/CaptivePortalLogin no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/CarrierDefaultApp no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/CertInstaller no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/ChildrenSpace no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/Clock no changes in resources no smali in decompiling changes in cert no changes in assests
system/app/ColorEyeProtect changes in resources ( xml folder different) no smali in decompiling changes in cert no assets in decompiling
system/app/ColorScreenshot no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/ColorUIEngine no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/CompanionDeviceManager no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/DlnaService no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/DownloaderCenterUI no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/FileEncryption no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/FileManager no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/FloatAssistant changes in resources (minor, called breeno in CN and voice assitant in EU) no smali in decompiling changes in cert no assets in decompiling
system/app/GameSpace no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/HealthCheck no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/HTMLViewer no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/InCallUI no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/KeKePay no changes in resources changes in smali changes in cert changes in assets
system/app/KeyChain no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/MCS changes in resources (CN version has many google strings) changes in smali changes in cert no assets in decompiling
system/app/NotificationCenter changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/NQNfcNci no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoAod no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoAtlasService no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoCamera no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoDCS no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoEngineerMode no changes in resources no smali in decompiling changes in cert changes in assets (intersting change, PD Charger support in CN, widevine support in EU
system/app/OppoFlashLight no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoGestureUI changes in resources (minor) no smali in decompiling changes in cert no assets in decompiling
system/app/OppoGuardElf no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoMultiApp no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoPowerMonitor no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoSmallWeatherWidget changes in resources (minor, drawables) no smali in decompiling changes in cert no assets in decompiling
system/app/OppoTranslationService no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoTZUpdate no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoUsbSelection no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OppoWeatherService no changes in resources no smali in decompiling changes in cert changes in assets
system/app/OppoWifiSniffer no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OShare no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/OTA changes in resources (minor public.xml) no smali in decompiling changes in cert no assets in decompiling
system/app/OTAUI changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/PhoneManager changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/PhoneNOAreaInquireProvider no changes in resources no smali in decompiling changes in cert changes in assets
system/app/Pictorial no changes in resources changes in smali (Magazine and otherstuff) changes in cert no assets in decompiling
system/app/PrintSpooler no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/RecentTask no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/SafeCenter changes in resources (minor dimensions) no smali in decompiling changes in cert no assets in decompiling
system/app/SafeSdkProxy no changes in resources changes in smali (release in cn and releaseEXP in eu changes in cert no assets in decompiling
system/app/SecurePay no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/SecurityPermission changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/Shelper changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/SimAppDialog no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/Stk changes in resources (different in strings) no smali in decompiling changes in cert no assets in decompiling
system/app/SystemAppUpdateService no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/Traceur no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/WallpaperChooser no changes in resources no smali in decompiling changes in cert no assets in decompiling
system/app/Wallpapers changes in resources (drawables) no smali in decompiling changes in cert no assets in decompiling
Click to expand...
Click to collapse

what u mean about decompile-compile system apps at 4pda? deodex it?

In the past I modded many roms by decompiling them with tools based on APKTOOL (like jbart) and compiling them again with mods like additional languages, changes of smali code etc.
I tried doing some mods in A13 and A14 system apps, but after recompiling the app, the firmware ignores it.
I suspect that they save the apk checksum to avoid mods, but this is still only a theory.
For example I tried to enable VOLTE, in the bools.xml of the framework there is a line about volte in which it is marked as false, I tried to change it but the system couldn't load with my modified framework.
As I said it happens even when I recompile with no changes, and in other system apps as well.

kkffiirr said:
In the past I modded many roms by decompiling them with tools based on APKTOOL (like jbart) and compiling them again with mods like additional languages, changes of smali code etc.
I tried doing some mods in A13 and A14 system apps, but after recompiling the app, the firmware ignores it.
I suspect that they save the apk checksum to avoid mods, but this is still only a theory.
For example I tried to enable VOLTE, in the bools.xml of the framework there is a line about volte in which it is marked as false, I tried to change it but the system couldn't load with my modified framework.
As I said it happens even when I recompile with no changes, and in other system apps as well.
Click to expand...
Click to collapse
Recompiling apk is a tricky thing.
I'll suggest you to mod apps using Mt manager.
Give it root permission, go to /system and open the target app and mod it, it can edit many things.

narshi shukla said:
Recompiling apk is a tricky thing.
I'll suggest you to mod apps using Mt manager.
Give it root permission, go to /system and open the target app and mod it, it can edit many things.
Click to expand...
Click to collapse
Thanks, but this is not what I look for, I will continue my efforts in the recompiling

kkffiirr said:
edit: the original table was made in excel, but putting it here caused crappy results, is there any better way to do this?
comparison of APP folder apps:
Click to expand...
Click to collapse
here the comparision of the priv-app:
Code:
system/priv-app/BackupRestoreConfirmation changes in resources
system/priv-app/BlackList changes in resources changes in smali
system/priv-app/BlackListApp changes in resources
system/priv-app/BlockedNumberProvider changes in resources changes in smali
system/priv-app/Browser changes in resources changes in smali
system/priv-app/CalendarProvider changes in resources
system/priv-app/CallLogBackup changes in resources changes in smali
system/priv-app/CarrierConfig changes in resources
system/priv-app/Contacts changes in resources changes in smali
system/priv-app/ContactsProvider changes in resources changes in smali changes in assets
system/priv-app/daxService changes in resources
system/priv-app/DefaultContainerService changes in resources
system/priv-app/DocumentsUI changes in resources
system/priv-app/DownloadProvider changes in resources
system/priv-app/ExternalStorageProvider changes in resources
system/priv-app/FusedLocation changes in resources
system/priv-app/GlobalSearch changes in resources changes in smali
system/priv-app/InputDevices changes in resources
system/priv-app/KeKeThemeStore changes in resources changes in smali changes in assets
system/priv-app/ManagedProvisioning changes in resources
system/priv-app/MediaProvider changes in resources changes in smali
system/priv-app/Mms changes in resources changes in smali changes in assets
system/priv-app/MmsService changes in resources changes in smali
system/priv-app/MtpDocumentsProvider changes in resources
system/priv-app/NumberRecognition changes in resources changes in smali changes in assets
system/priv-app/OppoBootReg changes in resources changes in smali changes in assets
system/priv-app/OppoGallery2 changes in resources changes in smali changes in assets
system/priv-app/OppoLauncher changes in resources changes in smali changes in assets
system/priv-app/OppoMusic changes in resources
system/priv-app/OppoSimSettings changes in resources changes in smali changes in assets
system/priv-app/OppoWirelessSettings changes in resources changes in smali
system/priv-app/SceneService changes in resources changes in smali changes in assets
system/priv-app/Settings changes in resources changes in smali
system/priv-app/SettingsProvider changes in resources changes in smali
system/priv-app/Shell changes in resources
system/priv-app/SmartDrive changes in resources changes in smali
system/priv-app/SOSHelper changes in resources changes in smali
system/priv-app/StorageManager changes in resources
system/priv-app/SystemUI changes in resources changes in smali changes in assets
system/priv-app/Telecom changes in resources
system/priv-app/TelephonyProvider changes in resources changes in smali
system/priv-app/TeleService changes in resources
system/priv-app/VideoGallery changes in resources
system/priv-app/VpnDialogs changes in resources changes in smali
system/priv-app/WallpaperCropper changes in resources

Basically, there are all apks have same sources. Basically different only language strings and some code in smali (EX, EXP, EUEX etc) for CN and EU header. All systems, security and country politicts applied over rights described into XMLs.
Also looks like checksum and rootcheck applied only when OTA update happend.
Comparing interesting only if we take exactly firmware for modem.

I beg to differ,
First of all now we know much more about the firmware structure than we knew when I started the thread.
Second, there are the missing app like screen recorder and else that can be transferred to the CN in some methods.
Third, there are some changes in apps, like more global oriented like the assistant (global version of breeno) and glonalsearch (which is Chinese only in CN version), more features like global T9 dialing in global dialer, some other changes.
Since I am busy I couldn't dig more into the changes, but it can help to anyone who want to create hybrid rom and enjoy "the best of both worlds".

Hey guys
Ive just got my x2 from custom
but I Cant Install any apps please help me
every time I try there is a registerition popup from realme account or some sort
I tried to register but sadly I cant even change the country code and its fixed to +86
I Know that my phone is the cn version but this is not fair.
I just want to Install my apps why would in the heaven this phone needs registerition!
software is so restrictive and so much chiniese sht is there
I Really like my phone but this is so frusturating
Is there anyone having the same prob like me?
Id be appreciate is someone help me to find out what should I do
Thanks.

What does DeepThinker do... Any clue?

Question: Are the LTE bands the same in all variants? I really need bands 5, 7, and 28 in my area.

Related

Build framework-res.apk?

I have already dexcode the framework-res.apk, the tool which I used is named "apktool".
And I have done it like this,
apktool if framework-res.apk;
apktool if twframework-res.apk;
apktool d framework-res.apk;
There is no any warnings or errors alarm, and out for framework-res directory and resources.
After I modify some part of *.xml, I type
apktool b reamework-res
it got some errors.
Please help me, why that happend?
----------------------------------------
log:
G:\Android\Tools\apk>apktool b framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'RestrictedOnSms' has no default translation in G:\Android
\Tools\apk\framework-res\res; found: zh_CN zh_TW
aapt: warning: string 'RestrictedOnVoiceData' has no default translation in G:\A
ndroid\Tools\apk\framework-res\res; found: zh_CN zh_TW
.......................
aapt: warning: string 'zzz_screen_captured_succeed' has no default translation i
n G:\Android\Tools\apk\framework-res\res; found: zh_CN
I: Building apk file...
---------------------
After I repack the framework-res.apk and update the update.zip, the device was stuck at the booting time. How to make the framework-res.apk to get the right way to boot the device?
mapleshadow said:
I have already dexcode the framework-res.apk, the tool which I used is named "apktool".
And I have done it like this,
apktool if framework-res.apk;
apktool if twframework-res.apk;
apktool d framework-res.apk;
There is no any warnings or errors alarm, and out for framework-res directory and resources.
After I modify some part of *.xml, I type
apktool b reamework-res
it got some errors.
Please help me, why that happend?
----------------------------------------
log:
G:\Android\Tools\apk>apktool b framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'RestrictedOnSms' has no default translation in G:\Android
\Tools\apk\framework-res\res; found: zh_CN zh_TW
aapt: warning: string 'RestrictedOnVoiceData' has no default translation in G:\A
ndroid\Tools\apk\framework-res\res; found: zh_CN zh_TW
.......................
aapt: warning: string 'zzz_screen_captured_succeed' has no default translation i
n G:\Android\Tools\apk\framework-res\res; found: zh_CN
I: Building apk file...
---------------------
After I repack the framework-res.apk and update the update.zip, the device was stuck at the booting time. How to make the framework-res.apk to get the right way to boot the device?
Click to expand...
Click to collapse
do a search and check out daneshm90's apk manager, not in this forum but i think it should be in another forum. the latest apk manager 4.9 beta final allows you to modify both pngs, and xmls. just follow his instructions there.
very easy to use. hope this helps.
At the beginning, thank you for your help. I have used the application, that's amazing. But the same thing happend, when I used this application to make the one framework-res.apk(of course I modified the *.xml) and update it to the device. That's so strange.
My step is as below:
Option 10, certainly I unpack the twframework-res.apk without any errors. And then........
Option 11, I coded and repack the framework-res.apk, then type yes with enter twice.
If I do it in the wrong way? Or what's your schedule?
mapleshadow said:
At the beginning, thank you for your help. I have used the application, that's amazing. But the same thing happend, when I used this application to make the one framework-res.apk(of course I modified the *.xml) and update it to the device. That's so strange.
My step is as below:
Option 10, certainly I unpack the twframework-res.apk without any errors. And then........
Option 11, I coded and repack the framework-res.apk, then type yes with enter twice.
If I do it in the wrong way? Or what's your schedule?
Click to expand...
Click to collapse
OP, you have problem with twframwork-res.apk OR with framework-res.apk? Both are different...
Did you delete all those files that you have modified in the keep folder? Maybe you can try increasing the heap size to 512 instead of default 64mb.
STK,So I'll try

[MOD][15 Toggles] How to mod Lidroid framework for JellyBean Roms

This is an update of this guide to get it working on Jelly Bean Roms, all we need is a 3 empty frameworks to rebuild Lidroid one (Thanks to LegendK95 for the idea), i built 3 fake frameworks: wanam3.apk, wanam4.apk, wanam5.apk.
Get them from attachments and push them with Apktool ( i recommend this Apktool update, thank to iBotPeaches):
Code:
apktool.bat if path_to/framework-res.apk
apktool.bat if path_to/twframework-res.apk
apktool.bat if path_to/wanam3.apk
apktool.bat if path_to/wanam4.apk
apktool.bat if path_to/wanam5.apk
Now you can decompile "lidroid-res.apk" (Available here), open "apktool.yml", you will find this :
Code:
isFrameworkApk: true
usesFramework:
ids:
- 1
sdkInfo:
minSdkVersion: '16'
targetSdkVersion: '16'
Add the 3 frameworks (2,3 and 4):
Code:
isFrameworkApk: true
usesFramework:
ids:
- 1
- 2
- 3
- 4
sdkInfo:
minSdkVersion: '16'
targetSdkVersion: '16'
Done, make your changes and re-compile.
Woohoo! many thanks mate, now I can make AndroidGX-MOD S3 fully compatible with Jelly Bean roms
We have chance to get you into this board! :good:
... I return working on it!
Ok, just tried your tutorial, but seems like there is a problem : I can't decompile properly without errors.
I'm still using Wanam APK ICS Manager but replaced with latest files from apktool thread that you provided (same for aapt.exe).
I decompiled lidroid-res.apk as dependencies with wanam3-5.apk ==> OK, but recompiling is not, here is my log.txt :
Code:
--------------------------------------------------------------------------
|25/09/2012 -- 13:16:02,68|
--------------------------------------------------------------------------
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)
Exception in thread "main" brut.androlib.AndrolibException: java.io.FileNotFoundException: X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam3.apk"X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam4.apk"X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam5.apk (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResources.java:481)
at brut.androlib.Androlib.installFramework(Androlib.java:447)
at brut.apktool.Main.cmdInstallFramework(Main.java:199)
at brut.apktool.Main.main(Main.java:72)
Caused by: java.io.FileNotFoundException: X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam3.apk"X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam4.apk"X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam5.apk (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)
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 brut.androlib.res.AndrolibResources.installFramework(AndrolibResources.java:449)
... 3 more
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\sub\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.err.CantFindFrameworkResException
at brut.androlib.res.AndrolibResources.getFrameworkApk(AndrolibResources.java:441)
at brut.androlib.Androlib.parseUsesFramework(Androlib.java:482)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
at brut.androlib.Androlib.buildResources(Androlib.java:269)
at brut.androlib.Androlib.build(Androlib.java:192)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
I tried to recompile without doing the modification of apktool.yml, and recompiling is OK this time, but I guess it's not the right way.
Any idea please ?
AndroidGX said:
Ok, just tried your tutorial, but seems like there is a problem : I can't decompile properly without errors.
I'm still using Wanam APK ICS Manager but replaced with latest files from apktool thread that you provided (same for aapt.exe).
I decompiled lidroid-res.apk as dependencies with wanam3-5.apk ==> OK, but recompiling is not, here is my log.txt :
Code:
--------------------------------------------------------------------------
|25/09/2012 -- 13:16:02,68|
--------------------------------------------------------------------------
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)
Exception in thread "main" brut.androlib.AndrolibException: java.io.FileNotFoundException: X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam3.apk"X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam4.apk"X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam5.apk (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResources.java:481)
at brut.androlib.Androlib.installFramework(Androlib.java:447)
at brut.apktool.Main.cmdInstallFramework(Main.java:199)
at brut.apktool.Main.main(Main.java:72)
Caused by: java.io.FileNotFoundException: X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam3.apk"X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam4.apk"X:\Android common\APK Manager JB (by Wanam)\place-apk-here-for-modding\wanam5.apk (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)
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 brut.androlib.res.AndrolibResources.installFramework(AndrolibResources.java:449)
... 3 more
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\sub\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.err.CantFindFrameworkResException
at brut.androlib.res.AndrolibResources.getFrameworkApk(AndrolibResources.java:441)
at brut.androlib.Androlib.parseUsesFramework(Androlib.java:482)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
at brut.androlib.Androlib.buildResources(Androlib.java:269)
at brut.androlib.Androlib.build(Androlib.java:192)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
I tried to recompile without doing the modification of apktool.yml, and recompiling is OK this time, but I guess it's not the right way.
Any idea please ?
Click to expand...
Click to collapse
Did you push the 3 frameworks? if so, you don't need to decompile with dependencies.
wanam said:
Did you push the 3 frameworks? if so, you don't need to decompile with dependencies.
Click to expand...
Click to collapse
Thanks! it worked like a charm :good:
I never knew that just pushing while no selectionning the concerned lidroid-res will be working, but it is
Very interesting.
Thanks again mate.
AndroidGX said:
Thanks! it worked like a charm :good:
I never knew that just pushing while no selectionning the concerned lidroid-res will be working, but it is
Very interesting.
Thanks again mate.
Click to expand...
Click to collapse
My pleasure
@Wanam or
Someone can explain me the first part, the apktool.bat stuffs. How can i push the wanam files?
I try those commands but i have several errors
I'm able to de-compile lidroid-res.apk without the push parts.
In re-compiling (apktool b lidroid-res lidroid-res-new.apk) the first line after hit enter is: "Could not find sources" but the rest of process goes ok.
In the end i have a new apk with a few less mbs than the original.
Any help will be very appreciated.
Thanks... Working great...
Thanks my friend wanam!
works like a charm!
thanks for all help!
regards
adesirello
Thanks for this mod .
can you explain how i can put 8toogle or 6 or 5 if i want in portrait mode ?
i have note 2 and i have 5 toggle , but i prefere 8 toggle it is mod in lidroid-res.apk or in systemui.apk
can you tell what xml i wan modified please
i have this pb but i have put 5 ressources
Microsoft Windows [version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.
C:\APK_JB_MANAGER-By-BroLee\other>apktool.bat if path_to/framework-res.apk
Exception in thread "main" brut.androlib.AndrolibException: java.io.FileNotFound
Exception: path_to\framework-res.apk (Le chemin dÆaccÞs spÚcifiÚ est introuvable
)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:477)
at brut.androlib.Androlib.installFramework(Androlib.java:448)
at brut.apktool.Main.cmdInstallFramework(Main.java:193)
at brut.apktool.Main.main(Main.java:69)
Caused by: java.io.FileNotFoundException: path_to\framework-res.apk (Le chemin d
ÆaccÞs spÚcifiÚ est introuvable)
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 brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:445)
... 3 more
C:\APK_JB_MANAGER-By-BroLee\other>apktool.bat if C:\APK_JB_MANAGER-By-BroLee\oth
er\framework-res.apk
I: Framework installed to: C:\Users\Lopes Carla\apktool\framework\1.apk
C:\APK_JB_MANAGER-By-BroLee\other>apktool.bat if C:\APK_JB_MANAGER-By-BroLee\oth
er\twframework-res.apk
I: Framework installed to: C:\Users\Lopes Carla\apktool\framework\2.apk
C:\APK_JB_MANAGER-By-BroLee\other>apktool.bat if C:\APK_JB_MANAGER-By-BroLee\oth
er\wanam3.apk
I: Framework installed to: C:\Users\Lopes Carla\apktool\framework\3.apk
C:\APK_JB_MANAGER-By-BroLee\other>apktool.bat if C:\APK_JB_MANAGER-By-BroLee\oth
er\wanam4.apk
I: Framework installed to: C:\Users\Lopes Carla\apktool\framework\4.apk
C:\APK_JB_MANAGER-By-BroLee\other>apktool.bat if C:\APK_JB_MANAGER-By-BroLee\oth
er\wanam5.apk
I: Framework installed to: C:\Users\Lopes Carla\apktool\framework\5.apk
C:\APK_JB_MANAGER-By-BroLee\other>apktool d lidroid-res.apk C:\APK_JB_MANAGER-By
-BroLee\other\lidroid
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Lopes Carla\apktool\framework\1.ap
k
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
C:\APK_JB_MANAGER-By-BroLee\other>apktool b C:\APK_JB_MANAGER-By-BroLee\other\li
droid
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.an
droid.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas
.android.com/apk/res/android); using existing value in manifest.
I: Building apk file...
C:\APK_JB_MANAGER-By-BroLee\other>
Click to expand...
Click to collapse
Help please
hi
i want to change some stuff into lidroid-res.apk
Step:
installed dependencies no error occured
decompiled lidroid-res.apk no error
edited apktool.yml no error
done my changes
recompile lidroid-res no error
signed lidroid-res.apk
push in system/framework
fix permissions to rw-r-r
reboot
SystemUI CRASH!!!!!!!!
What's my bad?
Thanks in advance
i'm on LS2 for gt-n7000
i attached my modded
lidroid-res.apk
Anyone can help me?
Please
Ofeliax said:
hi
i want to change some stuff into lidroid-res.apk
Step:
installed dependencies no error occured
decompiled lidroid-res.apk no error
edited apktool.yml no error
done my changes
recompile lidroid-res no error
signed lidroid-res.apk
push in system/framework
fix permissions to rw-r-r
reboot
SystemUI CRASH!!!!!!!!
What's my bad?
Thanks in advance
i'm on LS2 for gt-n7000
i attached my modded
lidroid-res.apk
Click to expand...
Click to collapse
Why do you sign it?
Hi wanam
You mean that i just push in system/framework the lidroid-res.apk from /dist folder , right?
But at apktool.yml i must add until to -4 or -5?
Thanks for support!!!!!!
Ofeliax said:
Hi wanam
You mean that i just push in system/framework the lidroid-res.apk from /dist folder , right?
But at apktool.yml i must add until to -4 or -5?
Thanks for support!!!!!!
Click to expand...
Click to collapse
No need to sign it, just add 2-3-4 resources and compile.
wanam said:
No need to sign it, just add 2-3-4 resources and compile.
Click to expand...
Click to collapse
Ok
I'll try so and I'll give you feedback
Thanks
It work perfectly
man i using apktool the lastest one. and im am using a note 2 and trying to color the toggle mod and its not sticking nothing is showing up as far as my color changes. any idea? thing compile just find and enter the steps installed the 3 .apks and still nothing

[TOOL]CM Theme to XThemeEngine Converter / Porter

You can stop F5-ing.
What's that all about? Didn't that exist already?
This tool converts an CM10 / AOKP / ... theme to an XThemeEngine (showthread.php?t=2240180 , I'm still "too new to add links" I guess).
The second post of that thread is just an instruction post. It tells you how to port the theme manually. I've made the script on base of that tutorial and then ported it to Java code so it's cross-platform.
The MAIN PROS:
- Easier with graphical user interface!
- Generates the missing redirections.xml for you!
- Doesn't need the SampleTheme.apk and doesn't need any IDE like Eclipse!
One-Time Set-Up:
1. Download apktool with signapk and testkeys in the same folder.
2. Download the .jar
I've removed the instructions for the shell script - the .sh itself is still inside the upload.zip.
Everytime you run it:
Select all the needed files. The GUI will help you.
Also, if aapt isn't inside of your $PATH, use the optional file chooser for that.
The folder containing aapt is usually platform-tools in the SDK folder.
WARNING: Any damage to your device is NOT MY FAULT. Any damage to any of the apks is NOT MY FAULT. Any damage to the Linux, NT or GNU Kernel is NOT MY FAULT. Any usage of Chuck Norris in this post is NOT MY FAU~~~~UU~~ IT'S MY FAULT!
WARNING: The output is A RAW PORT (except the generated redirections if missing) that may not work on some devices. Please port the .apk manually if needed.
When you encounter any problems, please reply with device, Android version and input theme (link to thread and APK if possible). Thanks!
Known problems (legend: p- problem c-- cause w--- workaround f--- fix) :
p- Applying theme failed.
c-- It's not my fault if the themers use separate xml files and / or forgett redirections.xml .
w--- Create one on your own and modify the code inside the .sh file (you can't overlook it...). It's easier than it sounds. Just replace ./tmpst/res/xml/redirections.xml with the path to your own one.
f--- Update to 2.0+
c-- The theme needs a device-specifiic redirections.xml due to Samsungs / Sonys / ... package and resource stuff.
w--- Port the theme on your own. That's really sad - that's why I've added it to my TODO list.
Changelog:
1.0: Initial release
1.1: Added missing zipalign
1.2: Added code snippet that copy-pastes the sampletheme apk's redirections.xml if there is no one. Unfournately it only has an entry for SystemUI so the code should be modified by the user easily to load a custom redirections.xml instead.
2.0: Ported to Java (.jar) for cross-platform support; removed zipalign for some time; added auto-generation of redirections.xml
ToDo: (* = focused, + = added)
+ Autogenerate redirections.xml if missing (aka Fix failed applying theme).
+ Fix failed applying theme. Some debug options in XThemeEngine would be helpfull... :/ (Edit: See the problem "Applying theme failed.")
+ Make more efficient
+ Add missing zipalign (if requested by too many users) (Edit: Just. Do. It.)
+ Make thread "first post" more user-friendly
+ Port it to a commandline .jar or GUI .jar (Edit: I prefer GUI .jar)
* Find device-specifiic redirections.xml and implement an option to choose from them. Yes, I mean you, Samsung and Sony!
- Add images to the first post
- Re-addd the zipaligning
AngelDE98 said:
I am verry sorry if this post is in the wrong place. I tought it would fit the "Themes" subforum because it's a theme converter and I've seen some ideas for it here, too. I'm just another dumb user, I know so just correct me. :/
What's that all about? Didn't that exist already?
This tool converts an CM10 / AOKP / ... theme to an XThemeEngine (showthread.php?t=2240180 , I'm still "too new to add links" I guess).
The second post of that thread is just an instruction post. It tells you how to port the theme manually. I've made the script on base of that.
One-Time Set-Up (notice that file / folder names are caps-sensitive on Linux!):
1. Download the convert.sh and make it runnable (I won't tell you how to do it because it's basic )
2. Make a new folder named "apktool" next to the .sh
3. Download apktool + signapk .jars (I won't tell you because I've seen some removed links from mods here and there ). Put apktool + signapk .jars into the apktool folder.
4. Download the sampletheme.apk and NAME IT "sampletheme.apk".. wow. Place it next to the .sh and apktool folder.
Now:
1. (Re)Place your input.apk (must be named so, if I've got time or help for making it load from arguments I'll implemt that) next to the .sh
2. Run the .sh script in Terminal
3. ....?
4. Profit. A new file named output.apk appeared. You may want to install it as normal app.
WARNING: Any damage to your device is NOT MY FAULT. Any damage to any of the apks is NOT MY FAULT. Any damage to the Linux Kernel is NOT MY FAULT. Any usage of Chuck Norris in this post is NOT MY FAU~~~~UU~~ IT'S MY FAULT!
WARNING: The output.apk is A RAW PORT that may not work on some devices. Please port the .apk manually if needed.
When you encounter any problems, please reply with device, Android version and input theme (link to thread and APK if possible). Thanks!
Known problems (legend: p- problem c-- cause w--- workaround f--- fix) :
p- Applying theme failed.
c-- It's not my fault if the themers use separate xml files and / or forgett redirections.xml .
w--- Create one on your own and modify the code inside the .sh file (you can't overlook it...). It's easier than it sounds. Just replace ./tmpst/res/xml/redirections.xml with the path to your own one.
Changelog:
1.0: Initial release
1.1: Added missing zipalign
1.2: Added code snippet that copy-pastes the sampletheme apk's redirections.xml if there is no one. Unfournately it only has an entry for SystemUI so the code should be modified by the user easily to load a custom redirections.xml instead.
ToDo: (* = focused, + = added)
- Autogenerate redirections.xml if missing (aka Fix failed applying theme).
+ Fix failed applying theme. Some debug options in XThemeEngine would be helpfull... :/ (Edit: See the problem "Applying theme failed.")
- Make more efficient
+ Add missing zipalign (if requested by too many users) (Edit: Just. Do. It.)
- Make thread "first post" more user-friendly
- If possible and apktool and signapk do exist for Android (otherwise decompile and port to Android), create "mobile version" of this tool (possibly without rooting needed)
* Port it to a commandline .jar or GUI .jar (Edit: I prefer GUI .jar)
Click to expand...
Click to collapse
Thnks but maybe u need add some images
to see how to use this (much people cant understood all on this post) and if u add some screens are more friendly
cheers
TeamMex said:
Thnks but maybe u need add some images
to see how to use this (much people cant understood all on this post) and if u add some screens are more friendly
cheers
Click to expand...
Click to collapse
I will add images after I've released the .jar file which is cross-platform. Yesterday some testing went wrong (aapt not found, mysterious .xml after package name in code-made redirections.xml). I hope I'll be able to upload the .jar today.
AngelDE98 said:
I will add images after I've released the .jar file which is cross-platform. Yesterday some testing went wrong (aapt not found, mysterious .xml after package name in code-made redirections.xml). I hope I'll be able to upload the .jar today.
Click to expand...
Click to collapse
F5...F5...F5... :fingers-crossed:
BoilerDroid said:
F5...F5...F5... :fingers-crossed:
Click to expand...
Click to collapse
Stop F5-ing.
AngelDE98 said:
Stop F5-ing.
Click to expand...
Click to collapse
Radiance_Gold by @IND190
Converted, installed, but won't apply theme...
I'm trying to convert: http://forum.xda-developers.com/showthread.php?t=2057131
d2vzw running Jelly Bean's 15
-------------------------
-------------------------
Version 2.0 by AngelDE98
-------------------------
[FILE:INAPK] C:\Users\_\Desktop\SGS3\Apktool JB 4.2.2_Signed_By Rizal Lovins Sundanesse\com.ind190.theme.radiance_gold.apk
[FILEUTAPK] C:\Users\_\Desktop\SGS3\Apktool JB 4.2.2_Signed_By Rizal Lovins Sundanesse\GoldTheme-2.apk
[FILE:APKTOOL] C:\Users\_\Desktop\SGS3\Apktool JB 4.2.2_Signed_By Rizal Lovins Sundanesse
[FILE:TMPDIR] C:\Users\_~1\AppData\Local\Temp\CMTXTE
[OS:ID] WINDOWS
[OS:SHELL] cmd
-------------------------
Beginning conversion...
Clearing tmpdir
Decompiling inapk into tmpdir
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\_\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
Removing the public.xml
redirections.xml exists: NO
Creating new redirections.xml
Adding permission into AndroidManifest.xml
Recompiling / bulding new apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
I: Building apk file...
Signing new apk
Done!
BoilerDroid said:
Radiance_Gold by @IND190
Converted, installed, but won't apply theme...
I'm trying to convert: http://forum.xda-developers.com/showthread.php?t=2057131
d2vzw running Jelly Bean's 15
Click to expand...
Click to collapse
Can you please give me your logcat log and device? Maybe you have got one of the Sony or Samsung devices that need special device-dependent redirections :/
I was able to apply the theme. On ICS.
There are no errors in the conversion log.
-------------------------
-------------------------
Version 2.0 by AngelDE98
-------------------------
[FILE:INAPK] C:\Users\klozz\Desktop\Themes speciales para stock roms\ChromeOS.V.2.1.apk
[FILEUTAPK] C:\Users\klozz\Desktop\Themes speciales para stock roms\themes\Chromeosported
[FILE:APKTOOL] C:\Users\klozz\Desktop\Themes speciales para stock roms\apktool\Apk_Manager_UOT\other
[FILE:TMPDIR] C:\Users\klozz\AppData\Local\Temp\CMTXTE
[OS:ID] WINDOWS
[OS:SHELL] cmd
-------------------------
Beginning conversion...
Clearing tmpdir
Decompiling inapk into tmpdir
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x02020000 drawable/com_android_browser_geolocation_permissions_prompt_background, config=-xhdpi-v13
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:105)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)
Removing the public.xml
redirections.xml exists: NO
Creating new redirections.xml
Something went wrong - look at STDOUT
D:
U can give me how to add manualy dependent directions on Sony device?
Aww... the ToDo list already contains that. I'll work on that today I guess...
Thanks for the log. Two resources and 1 id? How that?
Sent from my FWS710EU using xda app-developers app
BoilerDroid said:
Radiance_Gold by @IND190
Converted, installed, but won't apply theme...
I'm trying to convert: http://forum.xda-developers.com/showthread.php?t=2057131
d2vzw running Jelly Bean's 15
-------------------------
-------------------------
Version 2.0 by AngelDE98
-------------------------
[FILE:INAPK] C:\Users\_\Desktop\SGS3\Apktool JB 4.2.2_Signed_By Rizal Lovins Sundanesse\com.ind190.theme.radiance_gold.apk
[FILEUTAPK] C:\Users\_\Desktop\SGS3\Apktool JB 4.2.2_Signed_By Rizal Lovins Sundanesse\GoldTheme-2.apk
[FILE:APKTOOL] C:\Users\_\Desktop\SGS3\Apktool JB 4.2.2_Signed_By Rizal Lovins Sundanesse
[FILE:TMPDIR] C:\Users\_~1\AppData\Local\Temp\CMTXTE
[OS:ID] WINDOWS
[OS:SHELL] cmd
-------------------------
Beginning conversion...
Clearing tmpdir
Decompiling inapk into tmpdir
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\_\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
Removing the public.xml
redirections.xml exists: NO
Creating new redirections.xml
Adding permission into AndroidManifest.xml
Recompiling / bulding new apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
I: Building apk file...
Signing new apk
Done!
Click to expand...
Click to collapse
I'm getting this error too! when it gets towards the end you can see the apk in the folder and by the time its done it simply disappears. any ideas why that is? Im sure this tool just needs some more work and in time everything will work out but as it sits right now its a total dud. But Ill keep watch on this. Oh yeah by the way Im running an sgs4 with stock 4.2.2
thatsupnow said:
I'm getting this error too! when it gets towards the end you can see the apk in the folder and by the time its done it simply disappears. any ideas why that is? Im sure this tool just needs some more work and in time everything will work out but as it sits right now its a total dud. But Ill keep watch on this. Oh yeah by the way Im running an sgs4 with stock 4.2.2
Click to expand...
Click to collapse
Maybe it's a problem with the signing... The temporary apk you see gets signed and replaced. Have you got the signer and test keys in the apktool folder? Maybe I'll include the signer and test keys.
Sent from my Nexus 7 using xda app-developers app
AngelDE98 said:
Maybe it's a problem with the signing... The temporary apk you see gets signed and replaced. Have you got the signer and test keys in the apktool folder? Maybe I'll include the signer and test keys.
Sent from my Nexus 7 using xda app-developers app
Click to expand...
Click to collapse
Yeah I made sure to grab everything that was needed
Sent from my SGH-I337M using xda premium
Here's my log:
-------------------------
-------------------------
Version 2.0 by AngelDE98
-------------------------
[FILE:INAPK] D:\hololight.apk
[FILEUTAPK] d:\holoconverted.apk
[FILE:APKTOOL] D:\apktool
[FILE:TMPDIR] C:\Users\Admin\AppData\Local\Temp\CMTXTE
[OS:ID] WINDOWS
[OS:SHELL] cmd
-------------------------
Beginning conversion...
Clearing tmpdir
Decompiling inapk into tmpdir
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Admin\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x0a03007c
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:58)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:54)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:62)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:46)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResScalarValue.java:44)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:48)
at brut.androlib.res.data.value.ResBagValue.serializeToResValuesXml(ResBagValue.java:40)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:418)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:241)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:99)
at brut.apktool.Main.cmdDecode(Main.java:141)
at brut.apktool.Main.main(Main.java:72)
Removing the public.xml
redirections.xml exists: YES
Adding permission into AndroidManifest.xml
Recompiling / bulding new apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:164)
at brut.androlib.Androlib.build(Androlib.java:181)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:214)
at brut.apktool.Main.main(Main.java:74)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:160)
... 4 more
Signing new apk
java.io.FileNotFoundException: d:\holoconverted.apk (O sistema n ̄o pode encontrar o arquivo especificado)
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.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.android.signapk.SignApk.main(SignApk.java:437)
Done!
this tools is awesome
i hope the dev can get many help to get this tools works perfect
i got some problem here, when im start converting and the log said:
Code:
Version 2.0 by AngelDE98
-------------------------
[FILE:INAPK] D:\Kev\Application\Android\maxc\Sense5.apk
[FILE:eek:UTAPK] D:\Kev\Application\Android\maxc\Apktool JB 4.2.2_Signed_By Rizal Lovins Sundanesse\kam.apk
[FILE:APKTOOL] D:\Kev\Application\Android\maxc\Apktool JB 4.2.2_Signed_By Rizal Lovins Sundanesse
[FILE:TMPDIR] C:\Users\RYFK\AppData\Local\Temp\CMTXTE
[OS:ID] WINDOWS
[OS:SHELL] cmd
-------------------------
Beginning conversion...
Clearing tmpdir
Decompiling inapk into tmpdir
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\RYFK\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
Removing the public.xml
redirections.xml exists: NO
Creating new redirections.xml
Adding permission into AndroidManifest.xml
Recompiling / bulding new apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 9, --target-sdk-version, 15, -F, C:\Users\RYFK\AppData\Local\Temp\APKTOOL8117237803851350007.tmp, -x, -I, C:\Users\RYFK\apktool\framework\1.apk, -S, C:\Users\RYFK\AppData\Local\Temp\CMTXTE\res, -M, C:\Users\RYFK\AppData\Local\Temp\CMTXTE\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:355)
at brut.androlib.Androlib.buildResources(Androlib.java:280)
at brut.androlib.Androlib.build(Androlib.java:203)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:214)
at brut.apktool.Main.main(Main.java:74)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 9, --target-sdk-version, 15, -F, C:\Users\RYFK\AppData\Local\Temp\APKTOOL8117237803851350007.tmp, -x, -I, C:\Users\RYFK\apktool\framework\1.apk, -S, C:\Users\RYFK\AppData\Local\Temp\CMTXTE\res, -M, C:\Users\RYFK\AppData\Local\Temp\CMTXTE\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:335)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:333)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 9, --target-sdk-version, 15, -F, C:\Users\RYFK\AppData\Local\Temp\APKTOOL8117237803851350007.tmp, -x, -I, C:\Users\RYFK\apktool\framework\1.apk, -S, C:\Users\RYFK\AppData\Local\Temp\CMTXTE\res, -M, C:\Users\RYFK\AppData\Local\Temp\CMTXTE\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:93)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:333)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:84)
... 7 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more
Signing new apk
java.io.FileNotFoundException: D:\Kev\Application\Android\maxc\Apktool JB 4.2.2_Signed_By Rizal Lovins Sundanesse\kam.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.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.android.signapk.SignApk.main(SignApk.java:437)
Done!
What the hell i must do ?
ApkTool has got problems running. Guessing it doesn't even work when running in cmd / terminal:
ApkTool needs the Android SDK tools installed to function properly (actually only aapt but it's still wiser to install the whole toolset).
And with installed I mean installed and inside the $PATH.
There should be tutorials about installing the Android SDK tools (or just aapt).
Another thing I would try (guessing it WORKS in cmd / terminal): Just place the aapt binary next to the ApkTool.jar / converting tool .jar as Java's exec default path should check for files in the working directory (where you run the .jars from), too.
When these don't work, just tell me.
Sent from my Nexus 7 using xda app-developers app
so it's necessary to install Android SDK ??
Unfortunately, yes. You should've been noticed about that when downloading ApkTool as it's not my fault but ApkTool's fault.
Sent from my Nexus 7 using xda app-developers app
Is this still active?
Are you able to create a stand alone jar where you can just drop package xmls into a folder, run the jar and it creates a redirections.xml from the package xmls in the folder ?
Yeah, I could do it when I find some more free time. I've been busy with another project.
Also, I'll try to make the project open-source by putting it on GitHub. Maybe other people would want to help me.
Sent from my Nexus 7 using xda app-developers app

Just published ---> DexPatcher: Modify APKs at source-level using Java

we interrupt your scheduled programming to announce... DexPatcher
it might interest...
apktool / baksmali / smali users: like said tools it lets you patch APKs, but coding in java instead of smali.
Xposed developers: like Xposed it lets you mod APKs using java, but ahead of runtime and producing a standalone APK.
just published now, visit the project here...
[TOOL] DexPatcher: Modify Android DEX/APK files at source-level using Java
http://forum.xda-developers.com/android/software/tool-dexpatcher-modify-android-dex-apk-t3060854
​
thanks for your time!
Public service announcement: DexPatcher grew in scope and now bundles Apktool and dex2jar...
THE ALL-NEW DEXPATCHER PREVIEW IS UP !!!
Come take a look !
​

[GUIDE][INDEX]How to modify an apk

How to modify an apk​
Intro:
I’ve done several threads about how to theme and other similar topics but the info is sparse, so this ultimate guide/index will seat proudly in the theme section of XDA and will be updated when new things come, and as I learn more. This isn’t a beginners guide, I’m here trying to be as complete as possible, with links, references, ...
This initial version of the thread isn't here to stay, if you could contribute to this thread, it would mean the world to me, and would clearly help the community (of course I'll mention you for your contribution )
And keep at mind that I’m just an enthusiast, nothing more, and that this thread has been made only by me, so it's far from perfect. If I made any mistakes or if you want to add something please let me know.
Legal aspect:
Using this knowledge to infringe copyright is not only illegal, it’s detrimental to the community. The only legal case, and the only usage of this info condoned, is using it to theme OPEN SOURCE apps (because most of the time, commercial apps forbid reverse engineering in their policies). So don’t worry, theming AOSP is legal. You can always ask the permission of the devs for an authorization to customize their apps, make sure to ask before modding, and distributing the result.
Now I’m not a lawyer, but you can learn more on the legal aspect of reverse engineering on this Stackexchange post.
Summary of this thread:
I-Requirements
II-Download APKs
III-Decompile
IV-What and how to modify
V-Recompile
VI-Sign and Zipalign
VII-Installing the apk
VIII-Other ways to theme your device
IX-Theming related topics
X-Not covered topics
XI-Mods Center
XII-Reserved​
I-Requirements​
A)Java:
It's essential, almost mandatory, the Java Development Kit (JDK) and Java Runtime Environment (JRE) must be installed to use java based tools.
How to install the JDK and JRE
(download and follow the instructions, it’s pretty simple)​
Then, set the path to "java home", you need to do that in order to use java properly within your terminal:
Here’s a tutorial I found​
To check if everything is okay, open a terminal anywhere and enter java --version. If it returns the version of the JDK and JRE you’re good.
B)Android SDK:
Unfortunately we aren’t able to download the Android SDK alone anymore, I used to consider it as a requirement, but now I don’t because some people don’t have the space to install the whole Android Studio IDE just to use the Android SDK.
C)Others:
I suppose that list is going to expand, those two above are the main ones, but if there's something else you need, I'll make sure to put it here
II-Download APKs​
This sounds stupid to take one whole post for that, but sometimes it’s a drag, so here are some ways you can grab the apk you want to modify.
A)APKs form your phone:​Every app you installed from the playstore is under /data/app. With a root explorer like the excellent MiXplorer, you can browse to it and see the icons representing the apps on your phone.
There is an apk called base.apk, that’s the one you want.
Sometime there might be parts called split_....apk along with base.apk, for the excraction of those you’ll need tools like the amazing app called SAI (Split APK Installer), it’s a graphical interface so I’ll assume you’ll figure out how to use it yourself
SAI on the Play Store​
B)From internet:​My two trusted sources I use: APK Mirror, XDA Labs (gone for now)
I also use this chrome module, it has simplified my life sooooo much, it’s provided by the APKmirror team: Toolbox for Google Play Store™
C)Your Sources:​If I missed any good and trusted website, let me know
III-Decompile​This is getting serious now.
If you want to modify the apk, you need to have what’s inside: the code.
A)Resources: Decompile Binary XMLs to Human-Readable XMLs:​We use APKtool for that, it decompiles the resources.arsc file to the res folder, and decodes binary XMLs to human-readable XMLs.
1-How to install APKtool:​How to install APKtool​
2-How to use APKtool:​There are 3 main commands you need to know about:
apktool d [nameoftheapk].apk​Used to decompile the apk. There are several options you can use with that command, they're specified in APKtool's documentation (in the credits).
apktool if [nameoftheframework].apk​Used to set the framework files to decompile properly APKs. Usually some OEMs add framework APKs into Android for their apps to work, so we need to find and copy them, then “install” them with the apktool if command to APKtool. You can learn more about that on APKtool's website (in the credits).
apktoool b [nameoftheapk].apk​Used to recompile the apk. The final apk can be found inside the decompiled apk’s folder, in a subfolder named dist. You can also use various options with that command (listed in the documentation, link in the credits).
B) Decompile Classes.dex to smali:​APKtool also convert classes.dex files to .smali files, but keep at mind that you won’t be able to see the java source code in those files.
The .dex extention is for Dalvik Executable, which is very self-explanatory, and is also a binary format. APKtool turn them into .smali files, which are Human-readable files, not in java, but still! And if you want to modify the code, you’ll have to learn smali. (covered in the next part, good luck with that lol)
C)Read java source code :​There’s actually a way to see the java source code of an Android app, using some tools:
JD-GUI (or any other java decompiler)
Dex2jar
First turn the classes.dex files into .jar files with this command using Dex2jar:
./d2j-dex2jar.sh -f -o output_jar.jar apk_to_decompile.apk​
(Execute the .bat if you’re on windows)
Quick explanation:
./d2j-dex2jar.sh: execute the dex2jar script
-f: replace the previous jar file named the same as output_jar.jar
-o output_jar.jar : set a name to the output jar file
apk_to_decompile.apk: name of the apk file you’re taking care of
Then read the jar file using JD-GUI (or any other java decompiler). It’s a quite simple software, lite weight, and you can download and run the java version without installing anything else.
Dex2jar isn’t updated anymore (since 2015), so there are errors when decompiling. You’ll be able to get a .jar file but it’ll be incomplete or not identical to the original one, that’s why this tool doesn’t allow one to modify java source directly. But you can get a great understanding of how this app works.
C) Nice tools from the XDA community:​• Tickle My Android (TMA) by @Ticklefish
A tool that ease the work with APKtool, amazing one!
• APK Easy Tool by @evildog1
Also works with APKtool, I don’t use it often, but it is great!
• Other tools:
Let me know
Credits, links for this part:
Stack Overflow Post
Documentation for APKtool
Another SO Post
@Rizal Lovins ’
" [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar "
@A_U ’s
" [GUIDE][HOW-TO] Decompile and Compile apps using Apktool in 5 Simple Steps "
IV-What and how to modify​This part is gigantic, I'll try to include as much link as I can, this part isn't supposed to stay like that very long, as it contains very few of the hundreds of guide about theming in XDA. Help me out by suggesting some links.
​A)Resources (XML):​​1-Tools​To edit XMLs you can use whatever text editor you want, but I’d recommend Visual Studio Code. It has solid plug-ins that may come handy to avoid mistakes when editing.
You can also sort of visualize XMLs with Android Studio's Layout Inspector.
You have to open the apk’s folder in Android Studio and browse to the desired xml. Opening the resource manager will aslo allow you to visualize the XML files to a certain extent, but it's not cristal clear (see the screenshot) so I don’t use that very often, but it’s good to know.
Spoiler: Screenshot
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2-What’s xml​This subject is very long, you can learn a lot of things. Here are some links (increasingly detailed) to learn about XML:
A Post in [GUIDE] Want to learn how to theme? by @theimpaler747
Google’s "Guide" (very complete): that google link is about resources in general, so it explains XMLs but not only XMLs
A Reference for Codenames in XMLs
3-Modifications:​You can modify deeply the UI by editing XMLs, here are some guides to make you familiar with some techniques. Again this is a very vast field, it deserve a thread itself, and this list clearly isn"t finished. Here are my favourites ones:
XML 101 by @Ticklefish
[GUIDE][RES] Android Animation XML resources for Activity Transition by @niranjan94
Find the code you want to modify by @Raiz (Me lol)
[TUTORIAL] Where to find the colors for making a theme by @KBanause
[TUT][JB] HOW TO THEME SystemUI.apk for TOTALLY newbie! by @joehanh88
[Reference] Interactive Phone Modification [GUIDE] by @pstevep , this is AN ABSOLUTE UNIT OF INDEX!
[Tutorial][APP] PinP Shortcuts | How to Implement Picture in Picture Mode [API 26+] by @Geeks Empire
[Overlay] Enable Night Light, Auto-Brightness, Ambient Display & more on Treble ROM by @MishaalRahman
Let me know
4-Precaution:​When modifying apks, some errors can be very frustrating, yet very easy to fix. Here are some usual cause of struggle:
Not properly set JAVA_HOME
The tools used (like apktool.jar) aren’t chmod +x (aren’t allowed to be executed)
You have to add java -jar [command] before every .jar tools commands for it to run
Tell me, don't be shy
For every tool related bug, please refer to their GitHubs, sometimes you’ll find a solution by searching. And XDA threads are also plenty of answers! (and if you’re really not lucky maybe stack overflow can help).
B)Smali:​That’s a tough one. First, if you want my advice, editing them with Visual Studio Code and the smali plugin is way easier to find mistakes. There’s also a smali plugin for Android studio (and IntelliJ based IDE) made by Jesus-Freke, it is called smalidea.
Now I found one reaaallllyy awesome thread here on XDA about smali:
[GUIDE][SMALI]Understanding and Creating Smali Mods & General Smali Questions by @Goldie
Something else maybe? Tell me
This is my reference, I’m still learning smali tho, this list may be updated, but this thread is pure gold, go check it out!
Credit for this part:
Resources:
@Ticklefish , for XML 101 (but also for TMA), this is really one of my favourite thread on XDA
All the other members mentioned in the above list
Smali:
@Jesus-Freke , for his work on smali, baksmali (integrated in APKtool) and smalidea
@Goldie , for the amazing thread explaining smali
V-Recompile​You've done the hardest part, now what's left is repacking that thing together.
A)How to recompile:​It’s pretty simple, do it with apktool with this command:
apktool b [nameoftheapk].apk​You can add several options, here’s the full list.
The -c option to me is the most useful, because it allows to leave the signature unchanged for system apks. It’ll be deprecated soon (APKtool v2.6.0), so you’ll have to do the trick manually.
What -c (--copy-orginal) does: “Copies original AndroidManifest.xml and META-INF folder into built apk. Scheduled for deprecation.”
A bit of details, good to know:
“META-INF contains apk signatures. After modifying the apk it is no longer signed. You can use -c / --copy-original to retain these signatures. However, using -c uses the original AndroidManifest.xml file, so changes to it will be lost.”
And
“After [d]ecode, there will be new folders (original / unknown) in the decoded apk folder
original = META-INF folder / AndroidManifest.xml, which are needed to retain the signature of apks to prevent needing to resign. Used with -c / --copy-original on build
unknown = Files / folders that are not part of the standard AOSP build procedure. These files will be injected back into the rebuilt APK.”
Apktool uses aapt2, the tool used in Android Studio to compile your app. You can learn more on what it is here.
B)Troubleshooting:​First, remember that you can use aapt1 (used by default) and aapt2 when recompiling, try both if you run into some issues with the first.
If you have an issue with APKtool's dummy values, go on the Github Issue I opened, the problem is now solved.
Most common error, and simple to solve are the following:
-Name of the file not written correctly:​
Code:
brut.directory.DirectoryException: java.nio.file.NoSuchFileException: Firefoxr
Solution: The correct name is Firefox not Firefoxr, how dumb can I be?
​-Aapt errors: (here a folder isn’t recognized):​
Code:
W:invalid resource directory name: /Users/Raiz/Desktop/apktool/Firefox/res navigation
Solution: Use aapt2, the folders not recognized are because aapt1 (used by default) is older than aapt2, so if you see an error like this, use the option “—use-aapt2”
​-Xml Errors:​
Code:
W: /Users/Raiz/Desktop/apktool/framework-res/res/values/styles.xml:1185: error: Resource entry Theme.Holo already has bag item textEditSuggestionItemLayout.
Solution: These errors are quite easy to fix, just go to the file at the line mentioned then fix the error. Usually it a doubled line, a synthax error, …
Unfortunately APKtool isn’t able to correct string typos, it’s up to you to write in correct English (definitely struggling with that on my side lol).
For other more specific errors, copy/pasting the error message in the google search bar will most certainly redirect you to a Github error, or a post in The Official APKtool XDA Thread. You can find answers by searching, so search thoroughly before asking, it’ll save you some time.
And what is troubleshooting without
[UNIVERSAL][LOGCAT]How to get & read a logcat/ Troubleshoot your own issues!
by @Stryke_the_Orc​
Credit for this part:
APKtool issues on Github
The APKtool documentation
@iBotPeaches for this amazing tool
VI-Sign and Zipalign​
We must sign an app after having modified it, so it can be installed properly on our devices. System Apps MUST keep the same signature they had before modifying, or else the app will continuously force close, and it may even result in bootloops and other bad things.
To keep the signature take the META-INF folder from the not decompiled apk (browse it as a zip file) and put it in the newly recompiled apk (browse it as a zip file too, if there is already a META-INF folder, just replace it)
Links to build and platform tool:
Platform-tools: https://developer.android.com/studio/releases/platform-tools​Build-tools: Have to be downloaded from sdk manager in android studio​
A)Official way:​Tool used in the correct order:
1)keytool (included inside java)
2)zipalign from build tools (29.0.2 here, but use the latest )
3)apksigner from build tools (29.0.2 here, but use the latest) (+the lib folder containing apksigner.jar)
Where are build tools?
Mac: ~/Library/Android/sdk/build-tools/[your buld-tool version]/
Linux: ~/Android/sdk/build-tools/[your buld-tool version]/
Windows: C:/User/yourusername/AppData/Local/Android/sdk/build-tools/[your buld-tool version]/
Disclaimer: Using jarsigner is also possible (tool natively included in java jdk), if you use it, make sure you zipalign AFTER signing.
Make sure that apksigner (and lib) as well as zipalign are in the folder you’re apk is in.
Make sure they’re all executable (check that using chmod) and on mac os, make sure your terminal has full disk access (I had a hard time figuring this out lol).
​1-Generate keystore:​This is pretty simple, we’ll use keytool, at tool antively included in java jdk. We’ll need only one thing before using apksigner : the keystore.jks file (or a separate certificate and private key, but that’s more complicated)
keytool -genkey -v -keystore ~/Desktop/apktool/keystore.jks -alias Raiz -keyalg RSA -keysize 2048 -validity 10000​
Just replace the alias (here Raiz) by a familiar name, you have to remember it! (here’s why)
Also replace the name of the jks file (but not it’s extension, even though it can be .keystore, I had less issues with .jks)
Quick explanation of what does what in the command:
keytool : the command to use keytool obviously
-genkey : generate the keystore
-v : display verbose
-keystore : set the path to the future file
~/Desktop/apktool/keystore.jks : Path and name of the future file, you can call the keystore whatever you want to.
-alias Raiz : specify the alias used, it can be whatever you want, but remember it, it’s like a publisher name
-keyalg RSA : specify the algorithm used for the key, here it’s RSA (here’s a bit of history)
-keysize 2048: the size of the key in bits
-validity 10000: validity in days, here 10000 days
1*- Generate key.pk8 and cert.pem:​This is a quote from another thread (by @wilskywalker), this isn't necessary, but can come handy when signing zip, so I'll leave that here anyway.
You will need the following download:
OpenSSL [LINK]
[...]
Code:
openssl genrsa -out key.pem 1024
openssl req -new -key key.pem -out request.pem
openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem
openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8
Click to expand...
Click to collapse
2- Zipalign:​​./zipalign -v 4 firfox-mod.apk firefox-aligned.apk​Quick explanation:
-v : verbose
4 : align on 4 bits, putting another value will align the wrong way, just keep 4
firefox-mod.apk: name of the input apk, can be anything
firefox-mod-aligned.apk: name of the output apk, can be anything too
3-Sign the apk with apksigner:​
./apksigner sign --ks keystore.jks firefox-mod-aligned.apk​
Quick explanation:
sign: the command use to sign
--ks keystore.jks : specify the keystore file (the same one we generated seconds ago)
firefox-mod-aligned: the input apk (the one we just aligned), note that the apk will be signed and there won’t be any output apk this time
And you’re done, you can check that it has been properly signed with this command:
./apksigner verify firefox-mod-aligned​
Where firefox-mod-aligned is the apk signed we want to check
​3*-Sign the apk with apksigner using .pk8 and .pem files:​
./apksigner sign ---key key.pk8 --cert certificate.pem firefox-mod-aligned.apk​
Credits, links for this part:
How to sign an app (by Google)
apksigner documentation
keytool documentation
zipalign documentation
Stack Overflow post
@Rizal Lovins ’ Guide
B) Unofficial ways:​Some amazing devs and contributors at xda provided us with tools to sign with ease APKs (without having to think about all of that),I didn’t fully tested every one fo them, but you can try them as an alternative if the “official way” didn’t worked out well.
Here they are:
APK easy tool by @evildog1
APK Sign/Zipalign/Install by @aureljared
Uber APK signer (Github)
VII-Installing the apk​Your theme should be ready by now, but how do you want to install it?
There are several ways to get an apk inside your phone, I’ll go over the ones I think are the most common.
A)Regular apk install:​Just install it duh… (here you go if you need a little help).
B)Flashable zip:​I do recommend making flashable zips, because they’re pretty useful when installing modded system apps. So what is it?
1-Folders:​A flashable zip contains 2 folders: META-INF and a folder which will mimic the path to the apk we want to install. Inside that succession of folders, we’ll put our modified apk, and when flashing, the modded apk (inside the zip) will replace the original one inside your phone.
E.g: create system/priv-app/systemUI/systemUI.apk to install a modified systemUI.apk file by replacing the original one
Click to expand...
Click to collapse
E.g: create data/data/com.mixplorer/databases/data.db to replace the original data.db file inside this folder
Click to expand...
Click to collapse
Once you get those folders done (and the apk inside of it), it’s time to write the edify script that’ll flash the zip file.
2-Edify Script:​Edify is the language the script will be written in.
The file containing the script is located in /META-INF/com/google/android/updater-script (the name of the file is updater-script, naming it something else would make it ignored by your custom recovery)
Open this document with a text editor, and start coding!
We want to copy/paste the content of our zips onto the system (and replace files), so here’s the precise things we’ll do:
a-(OPTIONAL)Your “intro”:
Using the ui_print(" "); command, we can make some really cool looking ASCII art. You can write comments at whatever steps you want with this command, it’s pretty handy!
ui_print("Your Message here");​b-Mount the system partition:
​run_program("/sbin/busybox", "mount", "/system");​
c-Extract the content of the zip to /system:
package_extract_dir("system", "/system");​d-Unmount the system partition:
unmount("/system");​This is very basic, you can do so much more with edify script! Set the progress bar progress, set permissions to certain files, delete folders and/or files,...
3-Sign your zip:​You need to sign your zip after compressing it! The process looks like the one with key.pk8 and certificate.pem files, so I'll refere again to the same thread for that. (In the Credits)
I've covered the basics, now it's index time, you can go further with the links in the credits, and you can suggest me more!
Credits:
[WIP] How to Write an Updater-Script with Edify Code by @Karadorde
That one covers how to sign your zip:
[TUTORIAL] Making Flashable ZIPs, EDIFY Script, ZIP Signing & Key Creation [19.01.13] by @wilskywalker
My Very Own Script by Me
More Links:
[GUIDE] Create your own Flashable ZIP with custom updater-script and addon.d script by @Primokorn
[TUTORIAL] The updater-script completely explained by @KINGbabasula
Spoiler: Bonus
4-How to make a working progress bar​First “create” the progress bar that can go up to 100%
show_progress(1.000000, 0);​Then set the progress after each steps: (here I set it at 10%)
Code: set_progress(0.100000)​
C)ADB sideload:​Adb allows one to flash zips through command line using a custom recovery.
How to install adb​Now how to sideload an apk using adb:
Make sure your phone is plugged, and your PC allowed to use adb on your device. (the last steps of the guide I linked on how to install adb on your pc)
Reboot to recovery
For TWRP : Advanced → ADB Sideload For CWM : Install → Install Zip from Sideload
Code: adb sideload path/to/flashable.zip
And that’s it, congrats
D)Aroma Installer:​They’re very cool, yet I’m not really familiar with those.
This concept origins from XDA Inactive Recognized Developer @amarullz , and is used by the OpenGApps team for their Aroma package. Needless to say its work eased the task for many others, feel free to leave a thank on the threads:
Q’n’A about Aroma Installers: [Q&A] AROMA Installer - [Dev Move To DevDB]
Q’n’A about Edify and Aroma: (by @Dblfstr) Aroma, Edify, updater script Question and Answer thread
A tool to create them: [TOOL][3-10-13] Aroma App Package Creator v1.3.2 (by @commandersafi)
VIII-Other ways to theme your device​Making the whole apk is often long, and doesn’t leave much control over the theme to the user, alternative ways of theming let users control how they want the theme to be applied. Those 2 ways won’t be covered by me (as I don’t know enough about them yet), that's why, for this part, every input in welcomed
A)Magisk Modules:​This is now a pretty common and convenient way to distribute APKs and mods, so I had to cover it. Here’s a link to an official developer guide, it covers a good part of it, if you have an input, it is welcome!
https://topjohnwu.github.io/Magisk/guides.html​
B)Substratum Themes:​I don’t even need to tell you what is substratum, as it is pretty famous (along with Magisk), but let’s say you’re totally new.
Substratum is a theme engine that allows you to control what element of your system you want to be themed, and apply themes with the possibility of disabling theme at some point in time. So how to make a substratum theme ?
Links:
Video from the XDA chanel on YT
Another one from XDA on YT
Theme template form the official Substratum Github
IX-Theming related topics​All of the things I couldn't fit in the previous sections are here, make an input, I'll make sure to add it if it's relevant
A)Design Basics:​Now I don’t have especially fine taste in terms of designing, but I’m trying to learn!
Here are some links:
The Android Design Resources Forum in XDA
XDA Article about icon design
Material.io
Matrial.io YT channel
B)Boot Animations:​Here are some helpful threads and links:
[TUTORIAL]How to make your own boot animations (with sound if you want) by @despotovski01
[GUIDE] How To Make Bootanimation by @jackeagle
[GUIDE][TUT]make/Port any bootanimation|||USING VIDEO/FRAMES by @deathviper
C)Icon Packs:​[GUIDE]How to create icon packs for Go/Nova/Apex/Holo/ADW/LauncherPro/XperiaHome by @iamareebjamal
D)Port OEM Apps:​[GUIDE/TIPS] How to Port OEM Apps / Vendor Apps to Your Current ROM by @Rizal Lovins , this one is a wealth of information! really good and unique
D)Build.prop:​[Tweaks][Guide]Build.prop Tweaks by @bravonova
X-Not covered topics​Why don’t you talk about … ? That’s theming tho! And what about … and …? What is this thread!
I understand, these are legit claims, but I can’t cover everything. That’s where YOU come in play, you certainly know things that I don’t, so please, if you have any knowledge about something I didn’t mentioned above, please let me know!
I’m trying to make this thread as complete as possible, so I’d be very grateful if you could share a little about your knowledge .
Thank a bunch!
I know I already said that 10000000 times, but really, it would be awesome to have inputs!
XI-Mods and Wallpapers:​Let me take a tangent from the original purpose of this thread. This was supposed to be all about guides, but I thought about that twice and I think that's a good idea.
Basically, this here will list some of the amazing mods and themes around xda.
The goal here is to crack open those and see how they work, this would represent an immense work that I'm not able to take on right now, so I may leave links here, and you'll do the jobs of understanding how they work. Maybe at some point I'll write some here (with the credits of the OP of course!), but certainly not now.
Links:
Offline Google LLC App Wallpapers by @[email protected]
XII-Changelog:
For each update I'll bump this thread, so that you can enjoy latest links​04-01-2021 Update:
Happy new year! I went through my long list of watched threads, and found the gems I kept selfishly, they're yours now !
Added:
[GUIDE] Create your own Flashable ZIP with custom updater-script and addon.d script
[UNIVERSAL][LOGCAT]How to get & read a logcat/ Troubleshoot your own issues!
[GUIDE/TIPS] How to Port OEM Apps / Vendor Apps to Your Current ROM
[Tweaks][Guide]Build.prop Tweaks
[GUIDE]How to create icon packs for Go/Nova/Apex/Holo/ADW/LauncherPro/XperiaHome
[TUTORIAL] The updater-script completely explained
[TUT][JB] HOW TO THEME SystemUI.apk for TOTALLY newbie
[Reference] Interactive Phone Modification [GUIDE]
[Tutorial][APP] PinP Shortcuts | How to Implement Picture in Picture Mode [API 26+]
Offline Google LLC App Wallpapers
[Overlay] Enable Night Light, Auto-Brightness, Ambient Display & more on Treble ROM
Thanks for this, useful for sure. This is mostly on Windows. There's a way to do this directly on the phone ( most of it anyway).
I use an app called: Apkeditorpro.
I use version 1.9.10 cause i don't like the ui in the newer version.
In it you can :
-edit xmls directly.
-decode the smali and edit them, and view the java code and edit it with no extra tools.
-extract or replace files
-and rebuild the apk when finished. It'll show you a list of compile errors if any when building to review. If the build works it signs it and offers to remove old app and reinstall the new apk.
I found it very useful in editing theme overlays or add fonts in fonts tab in settings.
I am like you an enthusiast in all things modding. Still learning smali/ java editing. Hope we can learn together and from each other
Merry Christmas
Hi is it also valid for Xiaomi apk?
Braain said:
Hi is it also valid for Xiaomi apk?
Click to expand...
Click to collapse
Yep, it's valid for almost anything (any apk at least), feel free to ask here if you encounter problem, I'll do my best to help
Hi I started working with Riru-Enhanced mode for Storage Isolation and some mistakes I made now it's oky now I want to try to modify the handset apk because Xiaomi Redmi 7 is andro system android carefully
Raiz said:
04-01-2021 Update​
Click to expand...
Click to collapse
The First Update of this thread is out!, check out the post I quoted to see the list of threads I added, I also integrated them to the main guide (with proper credits), but I think making a list for each update more convenient for you readers.
I recommend to bookmark those thread or to watch them, because some are really amazing!
[QUOTE = "Raiz, post: 84227321, membro: 8020437"]
Il primo aggiornamento di questo thread è uscito !, controlla il post che ho citato per vedere l'elenco dei thread che ho aggiunto, li ho anche integrati nella guida principale (con i crediti appropriati), ma penso che fare un elenco per ogni aggiornamento più conveniente per voi lettori.
Consiglio di aggiungere quei thread ai preferiti o di guardarli, perché alcuni sono davvero fantastici!
[/CITAZIONE]
Great gems, indeed. Let me add this to the collection:
[Samsung only]How to modify stock font app (SamsungOne.apk, SamsungSans.apk, or Fondation.apk)
This post describes it using ApkEditorPro directly on the phone. It could work on other devices if you know what your stock font app is. It's a simple drag and drop your custom files in the right place.

Categories

Resources