Need help with porting a TW package - Android Q&A, Help & Troubleshooting

Hi guys!
I'm trying to port some package from Samsung ROM to CM following this guide and I'm stuck.
I decompiled the package, removed TW dependency from the manifest and now I'm adding additional classes from TW framework into this package. Everything was smooth so far as I was getting rid of "class not found" and similar messages in logcat by adding the missing class and recompiling the package.
But now I'm facing an issue, which I don't know how to fix:
When I try to run the app, I get the following message in logcat:
Code:
I/dalvikvm(30301): Could not find method com.sec.android.touchwiz.widget.TwAbsListView.isInDialog, referenced from method com.sec.android.touchwiz.widget.TwAbsListView.onHoverDrawableState
W/dalvikvm(30301): VFY: unable to resolve virtual method 9561: Lcom/sec/android/touchwiz/widget/TwAbsListView;.isInDialog ()Z
D/dalvikvm(30301): VFY: replacing opcode 0x74 at 0x006c
TwAbsListView class derives from TwAdapterView (from TwAbsListView.smali):
Code:
.super Lcom/sec/android/touchwiz/widget/TwAdapterView;
TwAdapterView derives from android.view.ViewGroup, which derives from android.view.View, which has a definition for "isInDialog". This what I found when decompiled framework.jar from the stock ROM:
smali\android\view\View.smali
Code:
.method public isInDialog()Z
However, based on official documentation this method does not exist in this class.
If I try to add android.view.ViewGroup and android.view.View from stock framework.jar into the package explicitly, I start getting "multiple definition" messages in logcat, and isInDialog still can't be resolved.
So, I'm currently stuck. Please advise. Is there something I'm doing wrong or not doing?

I guess with my last edit, I answered my own question.
It looks like Samsung decided to change implementation of android.view.View class to include isInDialog() method.
I just tried moving the definition of this method into com.sec.android.touchwiz.widget.TwAdapterView class, which derives from android.view.ViewGroup, and it looks like I no longer getting the message about missing isInDialog method.
There are still a gazillion other methods like this, but at least it's clear now what needs to be done.

Related

[WIP] Open source RTL support for Android

I am working on an open source RTL support for Android and I need help testing...
I have attached a normal app (that should work on any Android 1.5 and up) that runs my method before calling drawText.
The purpose is to make drawText call to it so it will support BiDi.
It reads a file called /sdcard/test.txt from which it gets the test string.
It does not support newlines.
Try it and tell me what you think.
The reason I don't publish the source yet is because knowing how it works would prevent it from being tested properly.
I hope I'm putting this in the right forum...
Hebrew Supported...
Is it also, support the font for Hebrew?
Because in ver 2.1, the have Hebrew but sometimes you see square or ? signs.
TheAgent1982 said:
Is it also, support the font for Hebrew?
Because in ver 2.1, the have Hebrew but sometimes you see square or ? signs.
Click to expand...
Click to collapse
The fonts exist, there's no work necessary on them, you have to push them to the device and that's it...
biditest with Android 2.2 FroYo (FRF50) Arabic test.txt
I tested with Android 2.2 FroYo (FRF50)
without /sdcard/test.txt and with my own text
I don't know about the Hebrew, the Arabic text are not joined (re-shaped) correctly
dudyk said:
The fonts exist, there's no work necessary on them, you have to push them to the device and that's it...
Click to expand...
Click to collapse
I have TP2 running Android 2.1 .
So, any idea how to do it?
Thanks for writing an open source BiDi support.
I did a very short test:
1. It did not render the whole line of text.
2. It looks like it has problems when switching from one language to another. E.g. the closing bracket after the hebrew word is rendered as open.
I attached the original text files and screen shots.
In addition I attache a screen shot of TxtPad Light and how it is rendered there.
TheAgent1982 said:
Is it also, support the font for Hebrew?
Because in ver 2.1, the have Hebrew but sometimes you see square or ? signs.
Click to expand...
Click to collapse
This might be a problem of character encoding.
I did a test with a UTF-8 file and a Hebrew ISO 8859-8. The first rendered the letters correct but the second showed only question marks. (See picture)
As alternative keyboard I recommend using either AnySoftKeyboard or SmartKeyboard.
It is in CM-5.0.8, with a fix on the issue list.
Dear Dudy,
Will your fix work for 2.1 as well? Can you give directions how to apply it to other ROMs? I own an HTC Desire, and would love to implement the fix. So far I just have the common StaticLayout fix.
Thanks,
Ron
EDIT: More specifically, it would be great if you can tell us which files to take from the CM update with the help of baksmali and smali in order to graft them into other distros. That's the way I implanted StaticLayout.smali in MoDaCo roms.
CM 5.0.8 is 2.1. It should apply to any 2.1/2.2 rom, just take my 4 commits from CM's git from framework base repository.
dudyk said:
CM 5.0.8 is 2.1. It should apply to any 2.1/2.2 rom, just take my 4 commits from CM's git from framework base repository.
Click to expand...
Click to collapse
Thanks for the reply, Dudy. I'll be more specific about what I am trying to do: I am trying to pull the files with your patches from the CM-5.0.8 ROM without compiling anything.
With the StaticLayout fix, I used baksmali and smali to disassemble the classes.dex from framework.jar and replace StaticLayout.smali. This worked.
When I look at the page github.com/dudyk/android_frameworks_base/commit/1b0aca31c3e03a5a323276cd15a8df4203a1792c - the one with your commits (is that the right one?) I cannot figure out all the files that I would need to replace. Sorry, I am not a programmer...
I can pretty much figure out that all the files preceeded by core/java/android/ will be found with their exact names in the classes.dex from framework.jar. But I have no idea where to locate the compiled files that resulted from AndroidGraphics2D, the three Canvas files and the ResourceTypes.
If you can point me at the right direction I'll be able to convert a script that was used for the StaticLayout fix so that anyone with a Mac or Linux would be able to easily implement your fix to any none-odexed distro.
Thanks so much in advance!
you didn't add U+0600 support in your Canvas.java @ cyanogen's git
PapaDocta said:
you didn't add U+0600 support in your Canvas.java @ cyanogen's git
Click to expand...
Click to collapse
Why do you say that? I tested for U0590 to U07B1, isn't that enough?
my bad.. i don't know how i overlooked the U07B1.... it's more than enough
Dear Dudy, I really need your help.
Back in the old days (a month ago), before your wonderful work, the best fix we had was Omri Baumer's StaticLayout fix. I was able to use the baksmali and the smali utilities to extract the smali file from framework.jar of CM, and graft it into ANY phone. Another user on the iAndroid forums created a script that automated everything.
I wanted to do the same with your fix. So I compiled a vanilla 2.1 and then applied only your patches, manually, and recompiled. I used baksmali to disassemble all the framework files, and discovered that the changed files were:
android/graphics/Canvas.smali
android/graphics/Canvas$EdgeType.smali
android/graphics/Canvas$VertexMode.smali
android/text/Layout.smali
android/text/SpannableStringBuilder.smali
android/text/Styled.smali
android/widget/TextView$CharWrapper.smali
The two additional Canvas files were tagged as changed, but no textual difference is evident. So altogether we are talking about 5 files that ideally would be easily grafted into ANY device running 2.1, without recompilation.
The problem was that the new Canvas.smali file caused boot loops on my HTC Desire. Logcat caught this:
Code:
D/AndroidRuntime( 103): --- registering native functions ---
W/dalvikvm( 103): Unable to register: not native: Landroid/graphics/Canvas;.drawText (Ljava/lang/String;FFLandroid/graphics/Paint;)V
E/JNIHelp ( 103): RegisterNatives failed for 'android/graphics/Canvas'
E/AndroidRuntime( 103): Unable to register all android natives
This did NOT happen when I tried the vanilla Canvas.smali. So it must be something in your patches. If you can help me figure out how to fix this, your fix will be easily implemented into any un-odexed 2.1 device. The script is all reworked and ready... Just this problem needs ironing out.
Thanks so much - for your wonderful work, and for taking the time to read this.
Ron
ClassicalDude said:
I wanted to do the same with your fix. So I compiled a vanilla 2.1 and then applied only your patches, manually, and recompiled. I used baksmali to disassemble all the framework files, and discovered that the changed files were:
android/graphics/Canvas.smali
android/graphics/Canvas$EdgeType.smali
android/graphics/Canvas$VertexMode.smali
android/text/Layout.smali
android/text/SpannableStringBuilder.smali
android/text/Styled.smali
android/widget/TextView$CharWrapper.smali
The two additional Canvas files were tagged as changed, but no textual difference is evident. So altogether we are talking about 5 files that ideally would be easily grafted into ANY device running 2.1, without recompilation.
The problem was that the new Canvas.smali file caused boot loops on my HTC Desire. Logcat caught this:
Code:
D/AndroidRuntime( 103): --- registering native functions ---
W/dalvikvm( 103): Unable to register: not native: Landroid/graphics/Canvas;.drawText (Ljava/lang/String;FFLandroid/graphics/Paint;)V
E/JNIHelp ( 103): RegisterNatives failed for 'android/graphics/Canvas'
E/AndroidRuntime( 103): Unable to register all android natives
This did NOT happen when I tried the vanilla Canvas.smali. So it must be something in your patches. If you can help me figure out how to fix this, your fix will be easily implemented into any un-odexed 2.1 device. The script is all reworked and ready... Just this problem needs ironing out.
Thanks so much - for your wonderful work, and for taking the time to read this.
Ron
Click to expand...
Click to collapse
My changes add a native method (a C++ one) to the sources, from what I know, it is in the dex file, but maybe smali's files do not extract it, or extract it differently.
I never tried to disassemble files in android and reassemble them, so I have no idea how to help you besides describing the changes to you.
P.S.
Do you think that HebVillian is using my fix this way? I believe that I'm the first to fix this for ROMs above 2.0 (BTW, it's in the froyo branch of CM as well).
I don't know about HebVillain. The maker of the rom was made aware of the way I patched StaticLayout, so it may well be. Perhaps he also read your thread and applied the actual patches...
I noticed that in one of your commits:
http://github.com/dudyk/android_fra...0aca31c3e03a5a323276cd15a8df4203a1792c#diff-5
You added "native" to drawText. It is exactly the function in that line that is throwing the error on boot - about not being native. I tried recompiling with that particular change reversed, but it did not make a difference. Can you investigate the matter? Perhaps the way the Nexus 1 boots is different than that of other devices, and the checks are not as strict. If this is indeed a code problem, perhaps it needs to be addressed for the patch to be viable for other devices.
Take everything I say with a grain of salt - I am no programmer. Just following what I read and understand.
I have no idea if this helps, but googling the words
android registernatives
results in quite a few technical posts complaining about similar problems...
I am sorry for being a nag. But I hope I am getting closer to the source of the problem.
The Android emulator was able to boot up just fine with the patches applied. The logcat stated at the beginning of the runtime:
Code:
D/AndroidRuntime( 29): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 29): CheckJNI is ON
I/ ( 30): ServiceManager: 0xad08
D/AudioHardwareInterface( 30): setMode(NORMAL)
I/CameraService( 30): CameraService started: pid=30
The very same smali files, when applied to the HTC Desire's framework, generated the native error I quoted before. But logcat shows that the beginning of its runtime is indeed different:
Code:
D/AndroidRuntime( 197): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 197): CheckJNI is OFF
D/dalvikvm( 197): Precise GC configured ON
D/dalvikvm( 197): creating instr width table
I/dalvikvm( 197): mlock: /data/dalvik-cache/[email protected]@[email protected], fd=7
So - how do we make the Desire, or any other device, turn on CheckJNI and turn off precise GC?
EDIT: In one of CM's change logs it was written that Precise GC was turned off because of its memory consumption. I am just assuming that this is indeed the cause for my problems. How can we check it?
CheckJNI and Precise GC don't matter.
Repatched and recompiled 2.2 source. The emulator runs beautifully with or without JNI checks. My HTC desire, with a 2.2 rom, still complains about the same function not being native.
The port dudyk did to Omri Baumer's patch works partially - the numbers are not reversed, but the whole line is aligned to the left (with hebrew text appearing to the left of the number, instead of the right).
I have no idea what else to do or to check.
i tried the latest cm6 nightly build and still it won't align Arabic RTL correctly.. it aligns it as LTR and there no reshaping as well....

[Q] [Noob] Having troubles importing a project

So I found this project online that lets me use the gyroscope of a phone. It has all the required files but when I import it into my workspace I get these three errors....
1) The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project
(java problem)
2) The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class file
(java problem)
3) Unable to resolve target 'android-5' AccessGyroscope Unknown Android (Target Problem)
Thanks in advanced
EDIT: Actually I think i just fix the problem

BOOTCLASSPATH Error when Deodexing with xUltimate

Someone needs to answer this question. I have searched and searched and can find no definate answer - although lots of people having the same issue. I am trying to deodex the stock ICS 4.0.3 ROM on an SGSII i9100. I am using xUltimate have also tried with this link to the smae end - - -
http://forum.xda-developers.com/showthread.php?t=598026
I am able to fetch the APK and ODEX files from the phone. As soon as I try to deodex, the error below comes up. I have tried on multiple files.
*******************************************
Starting AccuWeatherDaemonService.odex
*****************************************
* Deodexing... *
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find int
erface Lcom/android/internal/widget/multiwaveview/MultiWaveView$OnTriggerListene
r;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadAllImplementedInte
rfaces(ClassPath.java:867)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
692)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:282
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:111)
at org.jf.baksmali.main.main(main.java:297)
Error while loading class Lcom/android/internal/policy/impl/LockScreen$MultiWave
ViewMethods; from file .\origi_frame\android.policy.zip
Error while loading ClassPath class Lcom/android/internal/policy/impl/LockScreen
$MultiWaveViewMethods;
******************************************************************
My BOOTCLASSPATH in init.rc is
core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:framework2.jar:android.policy.jar:services.jar:apache-xml.jar:filterfw.jar
but i'm not sure what to do with this.
Any help is appreciated as lots of others struggling with the same issue.
I will report back if I find anything.
Peace - ArkozE
Please!
arkoze said:
Someone needs to answer this question. I have searched and searched and can find no definate answer - although lots of people having the same issue. I am trying to deodex the stock ICS 4.0.3 ROM on an SGSII i9100. I am using xUltimate have also tried with this link to the smae end - - -
http://forum.xda-developers.com/showthread.php?t=598026
I am able to fetch the APK and ODEX files from the phone. As soon as I try to deodex, the error below comes up. I have tried on multiple files.
*******************************************
Starting AccuWeatherDaemonService.odex
*****************************************
* Deodexing... *
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find int
erface Lcom/android/internal/widget/multiwaveview/MultiWaveView$OnTriggerListene
r;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadAllImplementedInte
rfaces(ClassPath.java:867)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
692)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:282
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:111)
at org.jf.baksmali.main.main(main.java:297)
Error while loading class Lcom/android/internal/policy/impl/LockScreen$MultiWave
ViewMethods; from file .\origi_frame\android.policy.zip
Error while loading ClassPath class Lcom/android/internal/policy/impl/LockScreen
$MultiWaveViewMethods;
******************************************************************
My BOOTCLASSPATH in init.rc is
core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:framework2.jar:android.policy.jar:services.jar:apache-xml.jar:filterfw.jar
but i'm not sure what to do with this.
Any help is appreciated as lots of others struggling with the same issue.
I will report back if I find anything.
Peace - ArkozE
Click to expand...
Click to collapse
Having this identical issue with my SGH-I777 SGSII
Verbatim! i really need to get this fixed!
Check This Post
Check This Post .. http://forum.xda-developers.com/showpost.php?p=46368707&postcount=3

[Q] Android Proguard ERROR: Unknown verificatification type[10]

I am trying to build an apk file for release. My application lib contains a jar (probably obfuscated) from a third party vendor of one of my company's hard-wares. When I build the apk in debug mode it is successful, but when I try to do it in release mode using "ant release" it throws the following error.
Code:
BUILD FAILED
C:\adt-bundle-windows-x86_64\sdk\tools\ant\build.xml:868: Can't read [D:\Workspace\MyProject\libs\ThirdPartyJarV3.1.jar] (Can't process class [g.class] (Unknown verification type [10] in stack map frame))
I have successfully built apks in release mode for other projects (which doesn't have this jar file.)
It seems to be an issue around proguard not being able to read this class in the jar. I have looked through ProGuard's trouble shooting manual and also on google and found no help with this particular error:
Code:
(Unknown verification type [10] in stack map frame)
I also updated proguard from V4.7 to 4.10, but it still encounters the same error.
To my little mind it seems to be a problem with the jar itself and if so how do I fix it? Any help would be appreciated. TIA!
[P.S: I'm new to android]

[Project] HuamiWatchfaces based custom watchfaces [Pace/Stratos] (APK not WFZ) v0.1

Custom Watchfaces for the Amazfit Pace/Stratos
Spun off from this thread New watchface for the Amazfit watch
So I wanted to fix the custom watchfaces that were looking really cool and don't work with the WFZ system so here is how to do it.
Disclaimers:
I am not an Android or Java developer, so expect some rookie mistakes (I usually do C#)
If you do this it is at your own risk!
I do not provide the original Huami APK/odex files. You will have to source them your self.
I also do not have a Pace, only a Stratos so this is not tested on the Pace.
Credit where credit is due
I did not come up with any of this, I just fixed it to work with the latest HuamiWatchFaces code.
Most of the credit goes to Manual Alvarez (manvel7650) whose code is here.
And the original thread at XDA Developers here
The other watchfaces come from Fabio Barbon(DrBourbon) whose code is here
Known Issues
Fixed for now!!!
Prerequisites
Currently you will need to be able to build this code and have the original Huami code to build against.
Android Studio
Android SDK version 21 (Android Studio should prompt you)
ADB (should come with Android Studio)
The HuamiWatchFaces.odex or HuamiWatchFaces2.odex from you watch (read below)
An older HuamiWatchFaces.odex (read below)
oat2dex (here)
dex2jar (here
This repo
Getting the HuamiWatchFaces files
To get the odex files needed for your watch, connect it via USB.
Then use a terminal/console to:
For Pace
adb pull /system/app/HuamiWatchFaces/mips/HuamiWatchFaces.odex
To streamline the instructions further rename the downloaded file to HuamiWatchFaces2.odex
For Statos
adb pull /system/app/HuamiWatchFaces/mips/HuamiWatchFaces2.odex
Then you will need an older one, i suggest downloading the APK from here. The link is below the image.
Converting the files to jars
You will need to convert the odex and dex files in to JAR files so the code can build against it.
java -jar oat2dex.jar -a 22 odex HuamiWatchFaces2.odex
d2j-dex2jar.sh HuamiWatchFaces2.dex
You should see some GLITCH: zero-width instruction messages
One of them is HardwareList, this is a problem and we will fix it.
Make sure the result is named HuamiWatchFaces2.jar (rename if not)
Now get the older HuamiWatchFaces file. Open the APK with something like 7Zip and extract the classes.dex and then:
d2j-dex2jar.sh classes.dex
Now you should have 2 jar files, the HuamiWatchFaces2.jar and probably classes-dex2jar.jar.
Open both of them with something like 7Zip again don’t extract them, just open and go to com\ingenic\iwds in both.
In your target jar (HuamiWatchFaces2) delete the HardwareList.class, and in your donor (classes-dex2jar) extract the HardwareList.class.
NEW In your target jar (HuamiWatchFaces2) also delete com\huami\watch\watchface\slpt\Lock\LowPowerClock.class
Now place the HardwareList.class in your target jar so it looks the same as before but now with the HardwareList.class from your donor.
Great! You should now have a working HuamiWatchFaces2.jar.
Building the repo
If you haven’t already, clone the repo to your PC.
Now take your HuamiWatchFaces2.jar and place it in app\src\main\java\es\malvarez\mywatchfaces\libs.
Open the project with Android Studio and build the project with gradle (click the hammer icon in the top left bar).
This should complete with no errors.
You should now have the APK in app\build\outputs\apk.
Installing the APK
adb install app/build/outputs/apk/debug/app-debug.apk
Or you can take the release one.
After installing you should have these watchfaces
{
"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"
}
Reserved.
I don't mean to sound like a noob, but is there an easier method to doing this?
I have 0 knowledge of android studio and coding in general and I'm struggling with this a little bit. I got to converting the odex to dex file and gave up haha.
I really like your watchface though and I appreciate the effort
@x3malex
I completely understand and it is in the plans. The biggest issue is that I can only make it for Windows easily at the moment and it is a bit dependent on 7zip.
It would be a powershell script in the first version.
The reason it's not high on the priority list right now is the lockscreen issue. I want to fix that first.
Currently it is a bit one step forward, two steps backwards as it is a bit of a hassle to debug because the watch won't lock when connect via usb to logcat.
When that is fixed I will start working on a more automated solution.
So, I fixed the lockscreen issue finally (at least I think I did this time). It seems to work nicely now.
The bad news is I had to add a (slightly) modified file from the original assemblies, I don't like that and hopefully fix that soon. This also means you need to remove that from the JAR file, the same as with HardwareList.
The next step is automate most of the procedure, but the first version will be Windows only. Sorry about that.
Edit: My github readme.md is being difficult. The enters after most of the important text are not showing. Strange thing is that it works in my local text editors (including Android Studio) and dillinger.io... So if anyone knows how to fix that, please.
LOTG said:
So, I fixed the lockscreen issue finally (at least I think I did this time). It seems to work nicely now.
The bad news is I had to add a (slightly) modified file from the original assemblies, I don't like that and hopefully fix that soon. This also means you need to remove that from the JAR file, the same as with HardwareList.
The next step is automate most of the procedure, but the first version will be Windows only. Sorry about that.
Click to expand...
Click to collapse
Just to let you know, I've had no DMCA requests (or any complaints at all) for uploading reversed and repackaged JAR files for the launcher to create homescreen pages, so I doubt they'd do it for watchfaces either
You can also remove unused classes from the JAR file, which makes any watchfaces created with it smaller
And if you use powershell, it means you use dotnet.
Did you know that with dotnet core 2 you can write sw that runs on Windows,Linux and mac?
If you need help with that, just contact me
@Quinny899
I'l think about it, and I'll look into unneeded files. Any easy way to check? Android Studio was pretty sure that LowPowerClock was not needed, but it disagreed with that while trying to run it. The dependency chain is not great.
I think the best solution overall would be to ditch the whole Huami system and build a new watch face system on top of the low-level stuff. This also leaves the door open for a new XML based watch face system. However, that is quite time-consuming (and who has time nowadays) and to do that I would rather use a language and environment I'm more familiar with.
@fzelle
Yes, I've build some software in .net core 2.0, but the problem is you will need to install the runtime for it. Not a big issue for Windows (I think it get's pushed through Windows Update), but Mac/Linux users might not be as enthusiastic. So I'm thinking about trying to create a bash variant. I'll need to look into a test setup for that though.
@Quinny899
I'l think about it, and I'll look into unneeded files. Any easy way to check? Android Studio was pretty sure that LowPowerClock was not needed, but it disagreed with that while trying to run it. The dependency chain is not great.
I think the best solution overall would be to ditch the whole Huami system and build a new watch face system on top of the low-level stuff. This also leaves the door open for a new XML based watch face system. However, that is quite time-consuming (and who has time nowadays) and to do that I would rather use a language and environment I'm more familiar with.
@fzelle
Yes, I've build some software in .net core 2.0, but the problem is you will need to install the runtime for it. Not a big issue for Windows (I think it get's pushed through Windows Update), but Mac/Linux users might not be as enthusiastic. So I'm thinking about trying to create a bash variant. I'll need to look into a test setup for that though.
LOTG said:
@Quinny899
I'l think about it, and I'll look into unneeded files. Any easy way to check? Android Studio was pretty sure that LowPowerClock was not needed, but it disagreed with that while trying to run it. The dependency chain is not great.
I think the best solution overall would be to ditch the whole Huami system and build a new watch face system on top of the low-level stuff. This also leaves the door open for a new XML based watch face system. However, that is quite time-consuming (and who has time nowadays) and to do that I would rather use a language and environment I'm more familiar with.
@fzelle
Yes, I've build some software in .net core 2.0, but the problem is you will need to install the runtime for it. Not a big issue for Windows (I think it get's pushed through Windows Update), but Mac/Linux users might not be as enthusiastic. So I'm thinking about trying to create a bash variant. I'll need to look into a test setup for that though.
Click to expand...
Click to collapse
I checked manually but there aren't a huge amount of classes required for the pages. Use jd-gui to view the jar and note down which classes are used, delete those that aren't
@LOTG
I don't think that it's that hard to install on linux or mac, did the same for a modified AmazfitExporter ( the phone db, not the pace db ).
https://github.com/FZelle/Amazfit_CoreExporter
Could not find below step
unable to find the lowpowerclock.class in the step "NEW In your target jar (HuamiWatchFaces2) also delete com\huami\watch\watchface\slpt\Lock\LowPowerClock. class "
but i tried with the jar and the code base given. I am getting below error
Information:Gradle tasks [:app:assembleDebug]
Warning:The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.1.
Android SDK Build Tools 26.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\com\ravenliquid\watchfaces\Utility.java
Error3, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error4, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error5, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error6, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error16, 52) error: cannot find symbol class SlptLayout
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\es\malvarez\mywatchfaces\widget\HasSlptViewComponent.java
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\es\malvarez\mywatchfaces\AbstractWatchFace.java
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\es\malvarez\mywatchfaces\AbstractWatchFaceSlpt.java
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\es\malvarez\mywatchfaces\data\MultipleWatchDataListenerAdapter.java
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\es\malvarez\mywatchfaces\MalvarezWatchFace.java
Error3, 33) error: package com.huami.watch.watchface does not exist
Error24, 31) error: cannot find symbol class AbstractSlptClock
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\es\malvarez\mywatchfaces\MalvarezWatchFaceSplt.java
Error3, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\es\malvarez\mywatchfaces\widget\CirclesWidget.java
Error11, 38) error: package com.huami.watch.watchface.util does not exist
Error12, 38) error: package com.ingenic.iwds.slpt.view.arc does not exist
Error13, 38) error: package com.ingenic.iwds.slpt.view.arc does not exist
Error14, 38) error: package com.ingenic.iwds.slpt.view.arc does not exist
Error15, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error16, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error17, 40) error: package com.ingenic.iwds.slpt.view.sport does not exist
Error18, 40) error: package com.ingenic.iwds.slpt.view.sport does not exist
Error19, 40) error: package com.ingenic.iwds.slpt.view.sport does not exist
Error20, 40) error: package com.ingenic.iwds.slpt.view.utils does not exist
Error253, 17) error: cannot find symbol class SlptViewComponent
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\es\malvarez\mywatchfaces\widget\HeartRateWidget.java
Error9, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error10, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error11, 40) error: package com.ingenic.iwds.slpt.view.sport does not exist
Error67, 17) error: cannot find symbol class SlptViewComponent
C:\Users\DELL\Desktop\Build APK 15 march\amazfit-watchfaces-Development\app\src\main\java\es\malvarez\mywatchfaces\widget\MalvarezClock.java
Error9, 38) error: package com.huami.watch.watchface.util does not exist
Error10, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error11, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error12, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error13, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error14, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error15, 39) error: package com.ingenic.iwds.slpt.view.core does not exist
Error16, 42) error: package com.ingenic.iwds.slpt.view.digital does not exist
Error17, 42) error: package com.ingenic.iwds.slpt.view.digital does not exist
Error18, 42) error: package com.ingenic.iwds.slpt.view.digital does not exist
Error19, 42) error: package com.ingenic.iwds.slpt.view.digital does not exist
Error20, 42) error: package com.ingenic.iwds.slpt.view.digital does not exist
Error21, 42) error: package com.ingenic.iwds.slpt.view.digital does not exist
Error22, 42) error: package com.ingenic.iwds.slpt.view.digital does not exist
Error23, 42) error: package com.ingenic.iwds.slpt.view.digital does not exist
Error24, 42) error: package com.ingenic.iwds.slpt.view.digital does not exist
Error25, 40) error: package com.ingenic.iwds.slpt.view.sport does not exist
Error26, 40) error: package com.ingenic.iwds.slpt.view.utils does not exist
Error109, 17) error: cannot find symbol class SlptViewComponent
........ deleted last few error lines .........
@suryateja8
Could you provide me with some info about the files you are using? ( Pace/Stratos, firmware version).
@LOTG to use both libraries is only for stratos? Or pace need too?
LOTG said:
@suryateja8
Could you provide me with some info about the files you are using? ( Pace/Stratos, firmware version).
Click to expand...
Click to collapse
@LOTG, Till the step of getting the Jar file i was able to do exactly as mentioned by you. But the step you mentioned to remove the com\huami\watch\watchface\slpt\Lock\LowPowerClock. class, i did not find the path.
So I ignored that and continued to build the APK file. Then i got the attached error.
I am using Pace with ROM Version 1.3.6d
@suryateja8 It seems like the later Pace versions are different from the one I have (I don't have a Pace watch, only a Stratos). I'll try to get the files and see what needs to change for the Pace.
You need the file huamiwatchfaces.odex for latest versions of pacefield versions. But stockfield remains in old file.
LOTG said:
@suryateja8 It seems like the later Pace versions are different from the one I have (I don't have a Pace watch, only a Stratos). I'll try to get the files and see what needs to change for the Pace.
Click to expand...
Click to collapse
I was able to manage the build and compiled the apk successfully( need to fix some errors in the code though).
I have also updated the Time Text watch face to display like how we read time.
suryateja8 said:
I was able to manage the build and compiled the apk successfully( need to fix some errors in the code though).
I have also updated the Time Text watch face to display like how we read time.
Click to expand...
Click to collapse
If you need me to include something just let me know.
I've had a shortage of free time this last week, and I found out that the CN files do not play nice with the US FW for Stratos.
I hope to get all that fixed this week.
suryateja8 said:
I was able to manage the build and compiled the apk successfully( need to fix some errors in the code though).
I have also updated the Time Text watch face to display like how we read time.
Click to expand...
Click to collapse
I've compiled my version of the APK a few days ago but there is a bug in the FuzzyText watchface. It displays the fuzzy text only when the watch is unlocked ("Four o'clock"), then reverts back to a Numbers Text ("Zero Four Zero Zero") when the watch is locked.
Did you fix this issue?

Categories

Resources