Giter Club home page Giter Club logo

g730_myanmar_font_installer's Introduction

G730_Myanmar_Font_Installer

Myanmar font installer for Huawei G730-U00 which have a problem with simple zawgyi font embedded apps. If you want a prebuilt, it is recommended to download it from here. For more details about what this app for and what it actually does, take a look at here and here.

Checking out the source

You'll need support v7. You can git clone it from this repository or get it using gradle/maven.

  • $ mkdir /path/to/src/
  • $ cd /path/to/src/
  • $ git clone git://github.com/TAD-Dev-Team/G730_Myanmar_Font_Installer

Make sure the SDK Platform for API 19 is installed, through the Android SDK Manager. Install NDK Revision 9b from here.

Eclipse

In Eclipse, import appcompat_v7 and TADG730MMFI. In your Package Explorer, right click on TADG730MMFI project -> Properties -> Android -> Add -> appcompat_v7. Now you're good to go with eclipse.

Building the restore binary

Make sure you have the android-ndk downloaded with the tool "ndk-build" in your path.

  • $ cd /path/to/src/
  • $ cd TADG730MMFI
  • $ ndk-build

The restore binary will built into TADG730MMFI/libs/armeabi/restore.

Modifying the framework.odex

  1. Pull all files from system/framework directory of your device.
  2. Decompile framework.odex.
  3. Edit "createFromAssets" method located in android/graphics/Typeface.smali. Codes to be editted are shown below.
  4. SMALI the decompiled folder of framework.odex in a classes.dex file and pack it into framework.jar to make it deodexed.
  5. Push it to somewhere on your device and odex it. (sign it only while installation)
  6. Now, this modded framework.odex will return only typeface of /system/framework/Roboto-Regular.ttf to Typface.createFromAssets(AssetManager mgr, String path) used in application. So that, fonts from assets of any custom font embedded apps will not take effect anymore.
References for decompiling & recompiling odex files

Orginal "createFromAssets" method

.method public static createFromAsset(Landroid/content/res/AssetManager;Ljava/lang/String;)Landroid/graphics/Typeface;
    .registers 4
    .param p0, "mgr"    # Landroid/content/res/AssetManager;
    .param p1, "path"    # Ljava/lang/String;

    .prologue
    .line 164
    new-instance v0, Landroid/graphics/Typeface;

    invoke-static {p0, p1}, Landroid/graphics/Typeface;->nativeCreateFromAsset(Landroid/content/res/AssetManager;Ljava/lang/String;)I

    move-result v1

    invoke-direct {v0, v1}, Landroid/graphics/Typeface;-><init>(I)V

    return-object v0
.end method

Modded "createFromAssets" method

.method public static createFromAsset(Landroid/content/res/AssetManager;Ljava/lang/String;)Landroid/graphics/Typeface;
    .registers 4
    .param p0, "mgr"    # Landroid/content/res/AssetManager;
    .param p1, "path"    # Ljava/lang/String;

    .prologue
    .line 164
    new-instance v0, Landroid/graphics/Typeface;

    const-string p1, "Patched By Aung Thiha"

    const-string p0, "/system/fonts/Roboto-Regular.ttf"

    invoke-static {p0}, Landroid/graphics/Typeface;->nativeCreateFromFile(Ljava/lang/String;)I

    move-result v1

    invoke-direct {v0, v1}, Landroid/graphics/Typeface;-><init>(I)V

    return-object v0
.end method

g730_myanmar_font_installer's People

Contributors

aungthiha avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.