This is a guide to build CyanogenMOD 10.2 (Android 4.3) for the HTC One. This guide is for OS X Mountain Lion (10.8.X).
[size=+1]Pre Requirements:[/size]
1) go to App Store on your OS X and Download Xcode 4. Once that is installed, open Xcode and go to preferences. There you find a tab “DOWNLOADS”, open it and there you can find “Command line tools” and next to it click INSTALL. It will take a few minutes to download and install
2) Make sure you have the android-sdk downloaded and setup adb and fastboot, so they work. It is recommended to place the android-sdk to /usr/local/
[size=+1]Initializing the build environment[/size]
First we need to set up our OS X to be able to build Android. This needs some extra things compared to for example, building in Linux, but the main stuff is pretty much the same. So let’s get started then, shall we?
Open up Terminal and type
Code:
java
If you don’t have java installed you will get a prompt to install it.
Next we will install homebrew (you can also use macports if you like)
Code:
ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
Now make sure android-sdk and homebrew are in $PATH
Code:
touch ~/.bash_profile && echo "PATH=/usr/local/bin:/usr/local/sbin:$PATH:/usr/local/android-sdk/tools:/usr/local/android-sdk/platform-tools" >> ~/.bash_profile
I also recommend to add this edit to the .bash_profile file:
Code:
nano –w ~/.bash_profile
Code:
export BUILD_MAC_SDK_EXPERIMENTAL=1
Now run this and see if you need to update anything.
Code:
brew doctor
If you do (and you probably will once a day) type:
Code:
brew update
Now we need to get our dev packages
Code:
brew install git coreutils findutils gnu-sed gnupg pngcrush repo
Once that is done, run
Code:
brew outdated
if it shows anything, run
Code:
brew upgrade
Now run this the correct a few symlinks [Not sure if these are needed anymore]:
Code:
ln -s /usr/local/bin/gfind /usr/local/bin/find && ln -s /usr/local/bin/gsed /usr/local/bin/sed
Now to create our case sensitive image for our CM work [NOTE: the 60g can be changed to anything. It only takes up what it needs but I used 60GB]:
Code:
hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 60g -volname "android" -attach ~/Desktop/Android
Now to create our working directory
Code:
cd /Volumes/Android && mkdir cm10.2 && cd cm10.2
[size=+1]Getting the source[/size]
Now to initialize the git and to download it
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
Download the sources:
Code:
repo sync
Wait until it is finished. It will take a long time, depending on your internet connection.
[size=+1]Obtain the device build files and proprietary files:[/size]
To do this we will use CyanogenMods "tool" called roomservice. Roomservice is replacing the old local_manifest.xml file. Just run the code below to create the file directly into the folder.
Code:
nano -w /Volumes/android/cm10.2/.repo/local_manifests/roomservice.xml
Paste the following lines into the file:
Code:
<manifest>
<project name="TheMuppets/proprietary_vendor_htc.git" path="vendor/htc" remote="github" revision="cm-10.2"/>
</manifest>
It seems that nowadays you only need to have the TheMuppets repo there, the roomservice process takes care of the rest and downloads the needed mako bits automatically. And actually it doesn't matter what you name the xml file under the local_manifests directory. The process loads every xml file from there in a alphabetical order. If you still have that local_manifest.xml file in your .repo directory, i suggest you remove that, because at that case that file will be read first and after that all the other from the local_manifests folder
Save the file. And rerun the code:
Code:
repo sync
Download the necessary pre-builts:
Code:
/Volumes/android/cm10.2/vendor/cm/get-prebuilts
That is all. The sources are now ready.
[size=+1]Building CyanogenMOD[/size]
If you build now, you're probably gonna get kernel build errors regarding the missing elf.h header (this error might be device specific). Fortunately, we already have this file downloaded, so we only need to copy it to /usr/local/include:
Code:
cp /Volumes/android/cm10.2/external/elfutils/libelf/elf.h /usr/local/include
FINALLY, we are ready to build:
Code:
cd /Volumes/android/cm10.2 && source build/envsetup.sh && brunch m7ul
The upper command will start the build for the international version for the HTC One (m7ul). Just change the m7ul part to the right codename (check it from f.ex www.get.cm webpage).
Then we just let the Mac do the rest. Remember that it will take a while to do the build, and meantime you Macs fans will scream for mercy while CM punishes your system ☺
After the build is finished successfully you can find your newly created flashable zip by typing:
Code:
cd $out
Look for .zip file with a tag UNOFFICIAL
Happy building!
donk
I just might give this a try. Thanks for the tutorial!
Sent from my One using Tapatalk 4
inffy said:
Hey there!
Only Thing that comes to mind is that you forgot to get the prebuilts. Or you flashed incompatible kernel
Click to expand...
Click to collapse
Not that I'm aware of, but I must've messed something up. I nuked it all and started over.
It works fine now (and more importantly I got myself a new "theme aware" aapt that doesn't think that drawable-xxhdpi is an invalid folder name )
Thanks again for a nice guide.
i can add packages of apk github
help
thanks
packhex said:
i can add packages of apk github
help
thanks
Click to expand...
Click to collapse
What do you mean, sry
Strange error
I get this error when I try to save the manifests xml file.
[ Error writing /Volumes/android/cm10.2/.repo/local_manifests/roomservice.xml: ]
Please help me figure this out...
Okay, I figured I hade the wrong directory..
now when I try to brunch, I get this error:
Don't have a product spec for: 'cm_m7ul'
Do you have the right repo manifest?
Please help!
Hi guys,
Today because of the continuous requests of help to compile the TWRP on the developers' dedicated thread, I decided to write a guide for those who know very little about Linux and Android development but want to LEARN
Initial requirements:
1)Linux, I suggest Ubuntu 64bit
2)Willpower
3)A brain of course
Chapter 1: Setting up Build Environment
First requirement is Java. The version you need depends on what Android version you want to compile
Open the terminal and type: java -version
From Gingerbred to Kitkat you have to use openjdk 6
For Lollipop and MM you can use openjdk 7 or opendjk8
Notice: for openjdk8 before start the compilation with "make recoveryimage"
Type: export EXPERIMENTAL_USE_JAVA8=true and press enter.
Code:
If you have the wrong version type: sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Follow the on-scren instructions to remove it.
Now install the jdk you need
For Openjdk 6
Code:
Type the following commands:
sudo add-apt-repository ppa:openjdk/ppa
sudo apt-get update && sudo apt-get install openjdk-6-jdk
For Openjdk 7
Code:
Type the following commands:
sudo add-apt-repository ppa:openjdk/ppa
sudo apt-get update && sudo apt-get install openjdk-7-jdk
Next requirement are libraries and build tools
Open a fresh terminal prompt, copy and paste this:
Code:
sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng
Now let's get a copy of "repo", it is a program that lets you communicate with git servers and download the source code.
Code:
1)mkdir ~/bin -This command creates the bin folder that will contain the repo command
2) curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo -This command downloads the repo command in the bin folder
3) chmod a+x ~/bin/repo -Give the repo command right permissions
4)sudo nano ~/.bashrc At the very bottom(Use page down key) add this line: export PATH=~/bin:$PATH
Then press Ctrl+O and Enter to save and Ctrl+X to exit.
After that type: source ~/.bashrc
-With these commands you add repo to .bashrc file that allows you to call the command from every path.
Chapter 2: Repo sync Android sources
At this point you are almost ready to compile whatever you want but first you need Sources.
These are divided in:
-Android base sources
-Device sources
Let's obtain the first one
If you want to compile ROMs such as CyanogenMod you MUST repo sync the entire sources but if you want to compile only the TWRP recovery you CAN sync minimal sources
Full Sources
NOTICE: replace "BRANCH" with the version of android you want
-Omnirom Sources
Available Android branches:
android-6.0
android-5.1
android-5.0
android-4.4
android-4.3
--Open a fresh terminal and type the followng commands.
mkdir ~/NameOfTheFolder It's your choice
cd ~/NameOfTheFolder
repo init -u git://github.com/omnirom/android.git -b BRANCH
repo sync -jN N=numbers of parallel downloads, it depends on your connection Example: repo sync -j2
-CyanogenMod Sources
Available Android branches:
cm-13.0
cm-12.1
cm-12.0
cm-11.0
--Open a fresh terminal and type the followng commands.
mkdir ~/NameOfTheFolder It's your choice
cd ~/NameOfTheFolder
repo init -u git://github.com/CyanogenMod/android.git -b BRANCH
repo sync -jN N=numbers of parallel downloads, it depends on your connection Example: repo sync -j2
Minimal Sources
NOTICE: replace "BRANCH" with the version of android you want
Thanks to @lj50036 for the minimal manifests
-Omnirom Minimal Sources
Available branches:
twrp-6.0
twrp-5.1
twrp-4.4
--Open a fresh terminal and type the followng commands.
mkdir ~/NameOfTheFolder It's your choice
cd ~/NameOfTheFolder
repo init -u git://github.com/lj50036/platform_manifest_twrp_omni.git -b BRANCH
repo sync -jN N=numbers of parallel downloads, it depends on your connection Example: repo sync -j2
-CyanogenMod Minimal Sources
Available branches:
twrp-13.0
twrp-12.1
--Open a fresh terminal and type the followng commands.
mkdir ~/NameOfTheFolder It's your choice
cd ~/NameOfTheFolder
repo init -u git://github.com/lj50036/platform_manifest_twrp_cm.git -b BRANCH
repo sync -jN N=numbers of parallel downloads, it depends on your connection Example: repo sync -j2
The download of the sources will take a bit ^^
Device sources are divided in
1)Kernel
2)Device Tree
3)Vendors
Sorry, I can't help here cause every device has its own sources
For further informations consult this page: https://www.google.it/url?sa=t&rct=..._intro&usg=AFQjCNGBwIUXnLmxTMEb6ltZvbVyzW9ybw it is for CM but it is valid for almost everything.
About TWRP device tree flags this thread is very very useful, thanks to @MSF Jarvis
http://forum.xda-developers.com/android/software/twrp-flags-boardconfig-mk-t3333970
NOTICE
If you repo synced CyanogenMod Full sources you don't have TWRP sources so go here, select the branch you want and download it.
https://github.com/omnirom/android_bootable_recovery
Extract the archive in /home/username/NameOfTheFolder/bootable
Rename the folder to "recovery-twrp" without quotes ----> Warning: Be sure that in NameOfTheFolder/device/vendor/devicename/Boardconfig.mk there is RECOVERY_VARIANT := twrp
Chapter 3: TWRP compilation
I'm going to use a device as example
Once you had your sources organised as follow:
/home/username/NameOfTheFolder/device/vendor/devicename
/home/username/NameOfTheFolder/kernel/vendor/devicename
/home/username/NameOfTheFolder/vendor/vendor/devicename
{
"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"
}
Notice: You can use @lj50036 minimal device tree to compile TWRP, remember to adapt it to your phone.
https://github.com/lj50036/android_device_vendor_codename
Download and extract it in /home/username/NameOfTheFolder/device/vendor/ them rename the folder to your devicename
Open a fresh terminal and type the following commands:
Code:
[LIST=1]
[*]cd ~/NameOfTheFolder
[*]source build/envsetup.sh
[*]lunch
[*]Type the number of your device and press enter. For example in my case the number 16 is my device
[*]mka recoveryimage ---> This command will start the compilation of the recovery.
[/LIST]
I hope I have been clear, Enjoy
Reserved
@Hacker432
Maybe link my minimal device tree, for building twrp only ?
https://github.com/lj50036/android_device_vendor_codename
I need to clean it up, and add a cm based one too, I will have to start on that, is weekend.
Also we should add a section on how to use local_manifest.xml .....
Thx Josh
@lj50036, delete your branch, rename mine to master and voila! Its done
Sent from my Pixel V1 using XDA Labs
It had crossed my mind earlier today to do this, you beat me to it :good:
Good Job and Great Initiative @Hacker432
NepoRood said:
It had crossed my mind earlier today to do this, you beat me to it :good:
Good Job and Great Initiative @Hacker432
Click to expand...
Click to collapse
Thanks, I thought it too when I saw @MSF Jarvis with Pavlex4 ^^
Sent from my Y550-L01 using Tapatalk
Hacker432 said:
Thanks, I thought it too when I saw @MSF Jarvis with Pavlex4 ^^
Click to expand...
Click to collapse
How do you say 'It was hell' without actually saying it was hell?
Sent from my Pixel V1 using XDA Labs
Some Tips/Tricks...
Being a Windows user most of my life, I've adapted (and picked up from others) some stuff to Linux, it saves a lot of typing in a terminal
1) Right Click, Create New Folder
Just as quick as the "mkdir" command, but more Windowsy (<-- I made a new word) and you see immediate results
2) Right Click, Open In Terminal
Click your way through folders, when you get where you want to be, simply right click on an open space, and choose open in terminal. No need to cd ~/all/the/folder/names/to/your/device
Works in the "out" directory too, when pushing your new recovery to the device. No need to type path to recovery, as you're already there
3) Drag and Drop a Bash Script
On your desktop, create a new file, name it "build_recovery", set permissions to make it exacuteable, then use this example inside the file:
Code:
#!/usr/bin/env bash
make clean
. build/envsetup.sh
lunch cm_X10-eng
mka recoveryimage
Simply drop it on your terminal window and hit enter :good: (can also be used to "mka bacon")
4) Clone Directly into Folder
Using "Tip 2", go to empty folder (folder must be empty), open your terminal then put a . (<-- that's a dot) at the end of your clone URL, example:
Code:
path: /nepo/android/cm12.1/device/TabletExpress/X10
# Open terminal and type/paste:
git clone https://github.com/neporood/device_TabletExpress_X10.git .
This will clone everything from the repo into the empty folder, no need to download and change names
5) Use a Local Manifest
A great guide, full of information, can be found here
NOTE: if using one of the "minimal" manifests in the OP, there's no need for a local manifest
6) Ramdisk Customization
Sometimes when compiling TWRP, you will need some custom and/or stock recovery files in the ramdisk, such as: init.rc, twrp.fstab, and/or some kernel modules (ko files), just to name a few. This is easily done by creating a "recovery/root" directory in your device folder, everything in "root" will be added when you compile.
Example:
path: /nepo/android/cm12.1/device/TabletExpress/X10/recovery/root/etc/twrp.fstab
When you compile, the twrp.fstab file will be inside the "etc" folder of your ramdisk
Hope this helps other newbies like myself,
Nepo
NepoRood said:
Being a Windows user most of my life, I've adapted (and picked up from others) some stuff to Linux, it saves a lot of typing in a terminal [emoji14]
1) Right Click, Create New Folder
Just as quick as the "mkdir" command, but more Windowsy (<-- I made a new word) and you see immediate results
2) Right Click, Open In Terminal
Click your way through folders, when you get where you want to be, simply right click on an open space, and choose open in terminal. No need to cd ~/all/the/folder/names/to/your/device
Works in the "out" directory too, when pushing your new recovery to the device. No need to type path to recovery, as you're already there
3) Drag and Drop a Bash Script
On your desktop, create a new file, name it "build_recovery", set permissions to make it exacuteable, then use this example inside the file:
Code:
#!/usr/bin/env bash
make clean
. build/envsetup.sh
lunch cm_X10-eng
mka recoveryimage
Simply drop it on your terminal window and hit enter :good: (can also be used to "mka bacon")
4) Clone Directly into Folder
Using "Tip 2", go to empty folder (folder must be empty), open your terminal then put a . (<-- that's a dot) at the end of your clone URL, example:
Code:
path: /nepo/android/cm12.1/device/TabletExpress/X10
# Open terminal and type/paste:
git clone https://github.com/neporood/device_TabletExpress_X10.git .
This will clone everything from the repo into the empty folder, no need to download and change names
Hope this helps other newbies like myself,
Nepo
Click to expand...
Click to collapse
Good addition, thanks
Sent from my Y550-L01 using Tapatalk
I have problem:
1. I created empty folder and named it twrp
2. I run this command: repo init -u git://github.com/lj50036/platform_manifest_twrp_cm.git -b twrp-13.0
3. I did repo sync -j3
4. I created folder /kernel/samsung/s3ve3g and put kernel source inside it.
5. I create folder /device/samsung/s3ve3g and put device tree inside it.
6. I create folder /device/samsung/s3ve3g and put vendor files inside it.
7. I run this command: . build/envsetup.sh
8.When I run this command I get error: https://postimg.org/image/6f8f5oypt/
I fixed problem by adding this sources to /device/samsung folder:
https://github.com/CyanogenMod/andro...ce_qcom_common
https://github.com/CyanogenMod/andro...ng_qcom-common
https://github.com/MSM8226-Samsung/a...msm8226-common
I am trying to make recoveryimage for multirom.I have problem TW_THEME is not valid: https://postimg.org/image/m33wfg6nb/
@Pavlex4 can you give me source links?
Sent from my Y550-L01 using Tapatalk
Hacker432 said:
@Pavlex4 can you give me source links?
Sent from my Y550-L01 using Tapatalk
Click to expand...
Click to collapse
Source for what?
Pavlex4 said:
Source for what?
Click to expand...
Click to collapse
Your device what else?
Sent from my Y550-L01 using Tapatalk
Hacker432 said:
Your device what else?
Sent from my Y550-L01 using Tapatalk
Click to expand...
Click to collapse
https://github.com/MSM8226-Samsung/android_device_samsung_s3ve3g
https://github.com/MSM8226-Samsung/android_kernel_samsung_s3ve3g/tree/cm-13.0
https://github.com/TheMuppets/proprietary_vendor_samsung/tree/cm-13.0/s3ve3g
https://github.com/CyanogenMod/android_device_samsung_qcom-common
https://github.com/MSM8226-Samsung/android_device_samsung_msm8226-common
I am trying to make recoveryimage for multirom.I have problem TW_THEME is not valid: https://postimg.org/image/m33wfg6nb/
Pavlex4 said:
https://github.com/MSM8226-Samsung/android_device_samsung_s3ve3g
https://github.com/MSM8226-Samsung/android_kernel_samsung_s3ve3g/tree/cm-13.0
https://github.com/TheMuppets/proprietary_vendor_samsung/tree/cm-13.0/s3ve3g
https://github.com/CyanogenMod/android_device_samsung_qcom-common
https://github.com/MSM8226-Samsung/android_device_samsung_msm8226-common
Click to expand...
Click to collapse
Try use this value in Boardconfig
Pavlex4 said:
I am trying to make recoveryimage for multirom.I have problem TW_THEME is not valid: https://postimg.org/image/m33wfg6nb/
Click to expand...
Click to collapse
Because you're device tree is not adapted for TWRP
Where are TWRP's flags?
Where is the twrp.fstab? TWRP uses its own fstab format
Also, regarding Multirom, I don't see the device name, are you sure you did again source/blabla lunch(enter) then device number?
NOTICE: https://github.com/TeamWin/android_device_samsung_s3ve3g/blob/android-5.1
This could help you a lot
Hacker432 said:
Try use this value in Boardconfig
Because you're device tree is not adapted for TWRP
Where are TWRP's flags?
Where is the twrp.fstab? TWRP uses its own fstab format
NOTICE: https://github.com/TeamWin/android_device_samsung_s3ve3g/blob/android-5.1
This could help you a lot
Click to expand...
Click to collapse
I have twrp flags inside boardconfig.
I added now twrp.fstab inside recovery folder.
Do I need to change something inside boardconfig?
Pavlex4 said:
I have twrp flags inside boardconfig.
I added now twrp.fstab inside recovery folder.
Do I need to change something inside boardconfig?
Click to expand...
Click to collapse
The line I suggested regarding Recovery Partition
Try that value instead of the size
Sent from my Y550-L01 using Tapatalk
Hacker432 said:
The line I suggested regarding Recovery Partition
Try that value instead of the size
Sent from my Y550-L01 using Tapatalk
Click to expand...
Click to collapse
I cannot access site!!!
Last night I decided to decompile all the apps of our beloved amazfit, I started to look at the source to find some interesting information. (Like how to turn off the standby mode or as add new watchfaces with even the standby mode)
I found interesting information but I have to do many tests and I don't have too much time at the moment, I leave the link to download all sources divided by folders (Gradle project)
Amazfit 1.2.8 decompiled apps
Enjoy!
Cracklydisc said:
Last night I decided to decompile all the apps of our beloved amazfit, I started to look at the source to find some interesting information. (Like how to turn off the standby mode or as add new watchfaces with even the standby mode)
Amazfit 1.2.8 decompiled apps
Enjoy!
Click to expand...
Click to collapse
Hi @Cracklydisc, which toolchain are you using to decompile amazfit system apps? baksmali 2.2.0 fails to deodex:
Code:
java -jar ../tools/smali/baksmali/build/libs/baksmali.jar deodex HuamiWatchFaces.odex -b framework/
Exception in thread "main" org.jf.dexlib2.DexFileFactory$UnsupportedOatVersionException: Unsupported oat version: 45
Tried also https://github.com/pxb1988/dex2jar, which gives smali files, but they fail to re-compile with apktool:
Code:
apktool b HuamiWatchFaces
I: Using Apktool 2.2.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
HuamiWatchFaces/smali/android/support/v4/media/MediaMetadataCompat.smali[73,45] Error for input '@': Invalid text
HuamiWatchFaces/smali/android/support/v4/media/MediaMetadataCompat.smali[73,39] mismatched input 'vtable' expecting VTABLE_INDEX
[...]
Many thanks in advance!
drbourbon said:
Hi @Cracklydisc, which toolchain are you using to decompile amazfit system apps? baksmali 2.2.0 fails to deodex:
Code:
java -jar ../tools/smali/baksmali/build/libs/baksmali.jar deodex HuamiWatchFaces.odex -b framework/
Exception in thread "main" org.jf.dexlib2.DexFileFactory$UnsupportedOatVersionException: Unsupported oat version: 45
Tried also https://github.com/pxb1988/dex2jar, which gives smali files, but they fail to re-compile with apktool:
Code:
apktool b HuamiWatchFaces
I: Using Apktool 2.2.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
HuamiWatchFaces/smali/android/support/v4/media/MediaMetadataCompat.smali[73,45] Error for input '@': Invalid text
HuamiWatchFaces/smali/android/support/v4/media/MediaMetadataCompat.smali[73,39] mismatched input 'vtable' expecting VTABLE_INDEX
[...]
Many thanks in advance!
Click to expand...
Click to collapse
Project ref:
- https://forum.xda-developers.com/and...batch-t2980857
- https://github.com/skylot/jadx
i use this 2 software for extract the source code.
How?
0. Extract from Amazfit the directory /app /priv-app /framework
adb pull /app
adb pull /priv-app
adb pull /framework
1. Create dir System and put the 3 dir inside.
2. Rename all mips dir in arm (one dir for any apk and one dir for framework )
3. Use JoelDroidLollipopBatchDeodexer.exe, select dir System and click start process (the software changes original file!)
4. Use Jadx for decompile apk in source code
example
jadx.bat -e app/Alipay/Alipay.apk -d decompiledApp/Alipay
If you have any questions please ask
Thank you for your suggestions @Cracklydisc !
I ended up doing things manually with oat2dex, apktool and smali/baksmali.
My idea is to replace one existing system watch face from HuamiWatchfaces.apk (and HuamiWatchfaces.odex) by replacing the relevant smali files with my custom compiled smali classes (with same java package name) in it. For example:
Code:
SunriseDigitalSlptClock.smali
SunriseDigitalWatchFace$1.smali
SunriseDigitalWatchFace$Engine$1.smali
SunriseDigitalWatchFace$Engine$2.smali
SunriseDigitalWatchFace$Engine$3.smali
SunriseDigitalWatchFace$Engine$4.smali
SunriseDigitalWatchFace$Engine$5.smali
SunriseDigitalWatchFace$Engine.smali
SunriseDigitalWatchFace.smali
I am struggling with basic permission and signing issues that I am sure have already been solved by you guys, so that I ask you for basic directions.
Here's the steps I made to decompile and recompile back everything in order to test the process. This results in "HuamiWatchFaces stopped" after reboot .
adb pull /system/framework
adb pull /system/app
java -jar oat2dex.jar -a 22 odex HuamiWatchFaces.odex
java -jar baksmali.jar d odex/HuamiWatchFaces.dex -o Faces
apktool d -c HuamiWatchFaces.apk
cp -r Faces HuamiWatchFaces/smali
(here relevant smali files will be replaced with custom ones in HuamiWatchFaces/smali)
apktool b -c HuamiWatchFaces/
adb push HuamiWatchFaces.apk /system/app/HuamiWatchFaces/HuamiWatchFaces.apk
delete /system/app/HuamiWatchFaces/mips/HuamiWatchFaces.odex from adb shell (apk is now deodexed)
rm /data/dalvik-cache/mips/[email protected]@HuamiWatch*
adb reboot
drbourbon said:
Thank you for your suggestions @Cracklydisc !
I ended up doing things manually with oat2dex, apktool and smali/baksmali.
My idea is to replace one existing system watch face from HuamiWatchfaces.apk (and HuamiWatchfaces.odex) by replacing the relevant smali files with my custom compiled smali classes (with same java package name) in it. For example:
Code:
SunriseDigitalSlptClock.smali
SunriseDigitalWatchFace$1.smali
SunriseDigitalWatchFace$Engine$1.smali
SunriseDigitalWatchFace$Engine$2.smali
SunriseDigitalWatchFace$Engine$3.smali
SunriseDigitalWatchFace$Engine$4.smali
SunriseDigitalWatchFace$Engine$5.smali
SunriseDigitalWatchFace$Engine.smali
SunriseDigitalWatchFace.smali
I am struggling with basic permission and signing issues that I am sure have already been solved by you guys, so that I ask you for basic directions.
Here's the steps I made to decompile and recompile back everything in order to test the process. This results in "HuamiWatchFaces stopped" after reboot .
adb pull /system/framework
adb pull /system/app
java -jar oat2dex.jar -a 22 odex HuamiWatchFaces.odex
java -jar baksmali.jar d odex/HuamiWatchFaces.dex -o Faces
apktool d -c HuamiWatchFaces.apk
cp -r Faces HuamiWatchFaces/smali
(here relevant smali files will be replaced with custom ones in HuamiWatchFaces/smali)
apktool b -c HuamiWatchFaces/
adb push HuamiWatchFaces.apk /system/app/HuamiWatchFaces/HuamiWatchFaces.apk
delete /system/app/HuamiWatchFaces/mips/HuamiWatchFaces.odex from adb shell (apk is now deodexed)
rm /data/dalvik-cache/mips/[email protected]@HuamiWatch*
adb reboot
Click to expand...
Click to collapse
Why do you want to replace a native Watchface?
They have implemented the wfz engine and with the current dev version you can create both analog and digital Watchface and change shape to widgets.
Cracklydisc said:
Why do you want to replace a native Watchface?
They have implemented the wfz engine and with the current dev version you can create both analog and digital Watchface and change shape to widgets.
Click to expand...
Click to collapse
Good question
Even thought configurable watch faces are nice and powerful, coming from the Pebble world I'd like to open up the option to former Pebble developers to deliver radically custom watch faces like https://apps.getpebble.com/en_US/application/533966299820be90ed0000c5?hardware=chalk, https://apps.getpebble.com/en_US/application/52de476d6094ff6bf0000046?hardware=chalk or https://apps.getpebble.com/en_US/ap...5e1c8000118?hardware=chalk§ion=watchfaces
Thank you for the decompiled version!!
I have a question for you, on the version you decompiled, could you please guide me to the file path/method used for the GATT profile to access the raw data from the device?
Thank you again!
Best,