[How-to] edit Huawei's apks

Search This thread

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Modifying Huawei's apk files is neither simple nor possible at times.

    What can we do?

    Very little... :(
    At this time, only the framework-res.apk file can be edited (only on Marshmallow).
    For all other apks we can only edit the smali files.

    Here there are some tools (Windows and Ubuntu)...


    Windows
    SuperRsKitchen
    https://xdaforums.com/apps/superr-kitchen/windows-linux-superr-s-kitchen-v3-0-0-0-t3601702
    I never tested Windows version... I use it in Ubuntu.

    Tickle My Android
    https://xdaforums.com/showthread.php?t=1633333&nocache=1
    with apktool versions 2.0.1 to 2.2.0 I'm able to install framework, decompile and recompile only framework-res.apk :)
    We can also decompile framework-res-hwext.apk ... but NOT recompile! :(
    Other apks can't be decompiled. :(

    With this tool I can also deodex system files...
    I don't know if they are perfect, but my system don't have problems! Everything works :)

    Batch ApkTool by bursoft
    http://4pda.ru/forum/index.php?showtopic=557858&view=findpost&p=30280158
    Thanks to kep2008
    Wonderful tool multilanguage.
    We can decompile (with apktool) as with TMA...
    We can Deodex, decompile and recompile smalis, convert system.new.dat, etc...
    I'm testing it.
    I use it on NOUGAT!

    Baksmali Manager
    https://xdaforums.com/showthread.php?t=2311766
    there is smali/baksmali version 2.0.2 inside ...
    with smali/baksmali versions 2.0 to 2.1.3 I'm able to decompile, edit smalis, recompile correctly.
    there is Compression Level 9 as Default... but I can't have a good SystemUI.apk with this Compression (without navbar and statusbar...and other errors).
    If I set Compression Level 0 my SystemUI is very good!
    Other apks and jar files are good with this Setting! :)

    Apktool
    https://ibotpeaches.github.io/Apktool/
    https://xdaforums.com/showthread.php?t=1755243&page=192

    smali/baksmali
    https://github.com/JesusFreke/smali/wiki


    Ubuntu
    SuperRsKitchen
    https://xdaforums.com/apps/superr-kitchen/kitchen-superr-s-kitchen-v1-1-50-v2-1-6-t3597434
    Deodex release a lot of errors.
    Kitchen makes other operations correctly...
    but at the moment I don't know if the new ROM is good or not... I only tested the operations.

    Apktool
    like above

    smali/baksmali
    like above


    All Credits to developers :)


    MODS post n. 3


    :)
    3
    Lockscreen Rotation
    with Toggle

    SOURCE

    Following the example of asc1977, now I'm able to rotate the lockscreen.
    But I have a problem... The layout is bad.
    Maybe we can correct it with a modded Theme... I hope.
    Otherwise the problem is more big... we can't edit res/layout files.

    Probable solution:
    https://xdaforums.com/showpost.php?p=73066304&postcount=11179
    I have to test it!

    The method is in Keyguard.apk
    smali/com/android/keyguard/KeyguardViewManager.smali

    Search this method
    Code:
    .method private shouldEnableScreenRotation()Z
    and replace it with
    Code:
    .method private shouldEnableScreenRotation()Z
        .locals 3
    
        const/4 v0, 0x0
    
        iget-object v1, p0, Lcom/android/keyguard/KeyguardViewManager;->mContext:Landroid/content/Context;
    
        invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v1
    
        const-string v2, "lockscreen_rotate"
    
        invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v1
    
        if-eqz v1, :cond_0
    
        const/4 v0, 0x1
    
        :cond_0
        return v0
    .end method


    To enable or disable it we can use Rom Control.


    in res/xml/ui_pref.xml (or your file name)
    Code:
            <com.wubydax.romcontrol.v2.prefs.MySwitchPreference
                android:defaultValue="false"
                android:key="lockscreen_rotate"
                android:summaryOff="@string/disabled"
                android:summaryOn="@string/enabled"
                android:title="@string/lockscreen_rotation" />

    in res/values/strings.xml (translatable in all languages)
    Code:
        <string name="disabled">Disabled</string>
        <string name="enabled">Enabled</string>
        <string name="lockscreen_rotation">Lockscreen Rotation</string>

    I'm not able to add a working switch in kangvip tools :(
    Is there a way to do that?
    3
    Alright. Can you try doing a search for "config_statusBarIcons"?

    Nougat P9 lite
    Code:
        <string-array name="config_statusBarIcons">
            <item>managed_profile</item>
            <item>ime</item>
            <item>sync_failing</item>
            <item>sync_active</item>
            <item>cast</item>
            <item>location</item>
            <item>bluetooth</item>
            <item>powersavingmode</item>
            <item>earphone</item>
            <item>nfc</item>
            <item>tty</item>
            <item>speakerphone</item>
            <item>zen</item>
            <item>mute</item>
            <item>volume</item>
            <item>wifi</item>
            <item>cdma_eri</item>
            <item>data_connection</item>
            <item>phone_evdo_signal</item>
            <item>phone_signal</item>
            <item>battery</item>
            <item>alarm_clock</item>
            <item>secure</item>
            <item>clock</item>
            <item>volte_call</item>
            <item>eyes_protect</item>
        </string-array>


    @kep2008

    framework-res.apk
    Nougat

    I'm able to install framework, decompile framework-res (with a lot of errors in log) but not recompile.
    (like Tickle My Android)

    I have to test other apktool versions

    But wonderful tool!
    I'll add it on first post!
    Thanks :)
    3
    So you have to open Original and Recompiled File...
    from Recompiled apk take resources.arsc (if you edited values folder), layout/*.xml, xml/*.xml, ecc ...

    Put resources.arsc and other modded files in Original apk (overwrite original file)...
    You can also copy from original .apk META-INF folder and AndroidManifest.xml and move them to a modified .apk (I do this with 7zip).

    Now if only I can get the comparable list from a Huawei device running Nougat.
    Huawei P9, Nougat.
    Code:
    <string-array name="config_statusBarIcons">
            <item>managed_profile</item>
            <item>ime</item>
            <item>sync_failing</item>
            <item>sync_active</item>
            <item>cast</item>
            <item>location</item>
            <item>bluetooth</item>
            <item>powersavingmode</item>
            <item>earphone</item>
            <item>nfc</item>
            <item>tty</item>
            <item>speakerphone</item>
            <item>zen</item>
            <item>mute</item>
            <item>volume</item>
            <item>wifi</item>
            <item>cdma_eri</item>
            <item>data_connection</item>
            <item>phone_evdo_signal</item>
            <item>phone_signal</item>
            <item>battery</item>
            <item>alarm_clock</item>
            <item>secure</item>
            <item>clock</item>
            <item>volte_call</item>
            <item>eyes_protect</item>
        </string-array>
    2
    Nice tool :)

    what versions of smali/baksmali and apktool do you use?

    Do you tested other versions also?
    I'm using smali-2.2.1 and apktool-2.2.3
    To install frameworks, put framework-res and framework-res-hwext in _framework folder