[HOWTO] Sign and sideload Tizen applications to the Gear Fit2 (from Windows)

Search This thread

LeJay

Senior Member
Apr 5, 2011
303
335
Intro
This howto will explain how to sideload *.tpk and *.wgt applications on your Gear Fit2. It'll also cover how to re-sign the application with your own certificates. This can be required if the application does not include a signature that's valid for your particular Gear Fit2. For example, this would be the case for applications that haven't been accepted to the Galaxy Apps store.

Warning
Unless we get people to develop and share their applications for the Gear Fit2, essentially all applications will have been developed for a different device. This means you'll run into varying degrees of incompatibility. Even if the application installs, there's no guarantee it will run. And even if it does run, it may be a terrible experience. And please show some caution regarding what you attempt to install, I don't take responsibility if you break anything following the guide.

Getting your own author and distributor certificates for your Gear Fit2
In order to sign applications, you need an author and distributor certificate for our Gear Fit2 device. For applications on the Galaxy Apps store, Samsung would be the one who signs applications with a distributor certificate. Since you will be sideloading applications, there's no guarantee they contain a valid signature from Samsung. You there need your own distributor certificate. This certificate will only be valid for signing applications for your particular Gear Fit2, which is why I can't make one for you. However you'll only have to do this once and can uninstall Tizen Studio after you're done. Unless you want to develop applications for the Gear Fit2, of course.

Things to download
Tizen Studio setup
To install, simply accept the software licence agreement and install both the Tizen SDK and data in their default locations.
After installation, Tizen Studio Package Manager should automatically launch. If not, launch Tizen Studio and choose Tools->Package Manager. In the Package Manager you choose the Extension SDK tab and install Samsung Certificate Extension. When it has been installed, close the window and launch Tizen Studio. Press OK for default workspace location.

Connect Gear Fit2 to Tizen Studio
On your Gear Fit2: Got to Settings->Gear info and turn on Debugging. Then go to Settings->Connections. Here you make sure Wi-Fi is turned on and logged on to the same Wi-Fi network as your Windows computer and that Bluetooth is turned off. The Gear Fit2 tend to automatically log off Wi-Fi networks if its connected through Bluetooth. While you can have both on if you're quick, simply turning off Bluetooth leads to much less frustration. You may have to restart your Gear Fit2 at this point to get everything working.

In Tizen Studio, you should see a drop-down list in the tool bar saying No Target. Open the drop-down list and choose Launch remote device manager. Here you press Scan and wait for your device's IP address to appear. You'll only see Tizen devices, so unless you have multiple, there will only be one result. If it doesn't appear, repeat the process above. On the toggle under Connect, turn it from off to on. On your Gear Fit2 it should say RSA key fingerprint: .... You accept on the device and should now be connected. Close down the Remote Device Manager window. The drop-down list should now say SM-R360 ....

Now you choose the menu item Tools->Certificate Manager. Add a new certificate profile by pressing the "+" sign up to the right and then select SAMSUNG as the type for your certificate profile. Go through the 4 tabs as follows
  1. Device Type
    Choose Mobile/Wearable and press next.
  2. Certificate Profile
    Choose Create a new certificate profile and type any name you want. Press next.
  3. Author Certificate
    Choose Create a new author certificate and press next.
    Type in an author name and password. Make sure you remember the password as it will be needed for signing applications later on.
    You'll now be asked to sign in to your Samsung account. If you don't have one, choose Create new account and follow instructions.
    After you've signed in you should get a Congratulations! notice. Take note of the location of the author certificate and press next
  4. Distributor Certificate
    Choose Create new distributor certificate and press next.
    For Privilege choose Partner. This defines how much of the Tizen API the applications you'll be signing are allowed to access. The three levels are Public, Partner and Platform with Platform being the highest level of access. Unfortunately that's not available to us, so we choose Partner.
    IMPORTANT: Leave the password as it is.
    Under the section Add individual DUIDs you should find the first entry contains something that starts with 2.0#.... That's your Gear Fit2's DUID. If you don't see it, press cancel (sorry) and go back to the Connect Gear Fit2 to Tizen Studio section above. If you do see, it press next. Make a note of the location of the distributor certificate. This should be the same as the author certificate from above. Then press Finish and you're done.

Signing and installing applications on your Gear Fit2
Things to download (See attachments to the post)
  • Fit2Installer
  • PacMan
    We'll use PacMan as an example. It's a modified version of the PacMan application found in this xda post. Some of the other applications in that link work on the Gear Fit2, some don't.
Using Fit2Installer
Download and extract the Fit2Installer. The folder contains the following.
  • sdb.exe: Smart Development Bridge for Tizen devices. This allows us to connect to the device and install applications. See tizen.developer.org's sdb section for more information on what you can do with it.
  • 7zipcli: The open source a command-line archiver from 7-zip. Used to package applications.
  • tizen: A very stripped down version of Tizen Studio that only contains the required files for signing and packaging applications.
  • cert: Empty folder where you're supposed to place your own certificates.
  • sign_me: Empty folder where you place applications you want to be signed.
  • install_me: Empty folder where you place applications you want to be installed on your device.
  • sign.bat: Batch script that will sign the applications put in sign_me
  • sign.bat: Batch script that will connect your Gear Fit2 to your computer, allowing you to install applications.
  • install.bat: Batch script that will install the applications put in install_me
  • connect.bat: Batch script that will connect to your Gear Fit2.
  • disconnect.bat: Batch script that will disconnect from your Gear Fit2.

Setting up your certificates
Go to the location of the certificates you generated with the Certificate Manager. The standard location is in your user folder under ~\SamsungCertificate\<name of cert profile>. The folder should contain 9 files. Copy all those directly into the .\Fit2Installer\cert\ folder. Eg, distributor.p12 should be placed as .\Fit2Installer\cert\distributor.p12.

Signing applications
There are two ways of using the sign.bat script.

  1. Place a *.tpk or *.wgt file directly in the sign_me folder. Run the sign.bat script and type in the password you chose for your certificate earlier. If successful, this will produce a *.tpk or *.wgt file in the install_me folder.
  2. If you don't have the package file, but rather just a folder containing the files for the application you'll have to place that folder in sign_me. For *.tpk files, this means the path will be .\Fit2Installer\sign_me\<application_folder>\tizen-manifest.xml. For *wgt files it will be .\Fit2Installer\sign_me\<application_folder>\config.xml. Now, run the sign.bat script and type in your certificate password.
As an example, I've attached PacMan. PacMan is a web-app that was packaged for the Gear S2. In order to get it to fit the Gear Fit2 screen, I had to extract the PacMan.wgt file and make a few changes to the code. Changes to the files invalidates the signature, so I had to resign it using my own certificates. If you've everything set up correctly, this should be fairly simple for you to do too.
Extract the PacMan.zip archive and place the content in the folder .\Fit2Installer\sign_me\PacMan\ and run the sign.bat script. Look in the install_me folder to check there's a *.wgt file for PacMan.

Installing applications
As in the earlier section Connect Gear Fit2 to Tizen Studio, make sure you're on Wi-Fi, bluetooth is off and debugging in turned on. Also, make sure you only have one Tizen device connected to your computer (this includes Tizen emulators).

Run the connect.bat script and type in the IP address of your Gear Fit2. If you do not know the IP address, you can find it on the device under Settings->Connections->Wi-Fi->Wi-Fi networks-><wifi_name> and at the bottom of the list. Make sure you allow sdb.exe through your firewall.
Important responses are:
  • error: failed to connect to remote target <ip address>
    Make sure you've set up your device correctly. Try turning Wi-Fi off and on. Or even a reboot of the device.
  • device unauthorized. Please approve on your device.
    This may mean you have to accept the RSA key fingerprint on your Gear Fit2. However, there appears to be a bug in the sdb that causes this to happen regardless. Try to run the script twice and see if you get the message below:
  • <ip address>:26101 is already connected
    Now you know for sure your device is connected.

After you've connected, you can safely turn Bluetooth back on. Remember to run disconnect.bat when you're done installing applications. Your Gear Fit2 will otherwise stay connected and drain a lot of battery.

Similarly to using the sign.bat script, there are two ways of using the install.bat script. Both of them require the application to already have a valid signature.
  1. Place a *.tpk or *.wgt file directly in the install_me folder. Run the install.bat script.
  2. If you don't have the package file, but rather just a folder containing the application you'll have to place that folder in install_me. For *.tpk files, this means the path will be .\Fit2Installer\install_me\<application_folder>\tizen-manifest.xml. For *wgt files it will be .\Fit2Installer\install_me\<application_folder>\config.xml.. Run the install.bat script.

Since PacMan should already be signed and placed correctly in the install_me folder, you can now run the install.bat script to install it on your Gear Fit2.
 

Attachments

  • Fit2Installer.zip
    19.4 MB · Views: 5,654
  • PacMan.zip
    773.6 KB · Views: 1,244
Last edited:

PTHugo

Senior Member
Jul 13, 2015
245
70
Intro
This howto will explain how to sideload *.tpk and *.wgt applications on your Gear Fit2. It'll also cover how to re-sign the application with your own certificates. This can be required if the application does not include a signature that's valid for your particular Gear Fit2. For example, this would be the case for applications that haven't been accepted to the Galaxy Apps store.

Warning
Unless we get people to develop and share their applications for the Gear Fit2, essentially all applications will have been developed for a different device. This means you'll run into varying degrees of incompatibility. Even if the application installs, there's no guarantee it will run. And even if it does run, it may be a terrible experience. And please show some caution regarding what you attempt to install, I don't take responsibility if you break anything following the guide.

Getting your own author and distributor certificates for your Gear Fit2
In order to sign applications, you need an author and distributor certificate for our Gear Fit2 device. For applications on the Galaxy Apps store, Samsung would be the one who signs applications with a distributor certificate. Since you will be sideloading applications, there's no guarantee they contain a valid signature from Samsung. You there need your own distributor certificate. This certificate will only be valid for signing applications for your particular Gear Fit2, which is why I can't make one for you. However you'll only have to do this once and can uninstall Tizen Studio after you're done. Unless you want to develop applications for the Gear Fit2, of course.

Things to download
Tizen Studio setup
To install, simply accept the software licence agreement and install both the Tizen SDK and data in their default locations.
After installation, Tizen Studio Package Manager should automatically launch. If not, launch Tizen Studio and choose Tools->Package Manager. In the Package Manager you choose the Extension SDK tab and install Samsung Certificate Extension. When it has been installed, close the window and launch Tizen Studio. Press OK for default workspace location.

Connect Gear Fit2 to Tizen Studio
On your Gear Fit2: Got to Settings->Gear info and turn on Debugging. Then go to Settings->Connections. Here you make sure Wi-Fi is turned on and logged on to the same Wi-Fi network as your Windows computer and that Bluetooth is turned off. The Gear Fit2 tend to automatically log off Wi-Fi networks if its connected through Bluetooth. While you can have both on if you're quick, simply turning off Bluetooth leads to much less frustration. You may have to restart your Gear Fit2 at this point to get everything working.

In Tizen Studio, you should see a drop-down list in the tool bar saying No Target. Open the drop-down list and choose Launch remote device manager. Here you press Scan and wait for your device's IP address to appear. You'll only see Tizen devices, so unless you have multiple, there will only be one result. If it doesn't appear, repeat the process above. On the toggle under Connect, turn it from off to on. On your Gear Fit2 it should say RSA key fingerprint: .... You accept on the device and should now be connected. Close down the Remote Device Manager window. The drop-down list should now say SM-R360 ....

Now you choose the menu item Tools->Certificate Manager. Add a new certificate profile by pressing the "+" sign up to the right and then select SAMSUNG as the type for your certificate profile. Go through the 4 tabs as follows
  1. Device Type
    Choose Mobile/Wearable and press next.
  2. Certificate Profile
    Choose Create a new certificate profile and type any name you want. Press next.
  3. Author Certificate
    Choose Create a new author certificate and press next.
    Type in an author name and password. Make sure you remember the password as it will be needed for signing applications later on.
    You'll now be asked to sign in to your Samsung account. If you don't have one, choose Create new account and follow instructions.
    After you've signed in you should get a Congratulations! notice. Take note of the location of the author certificate and press next
  4. Distributor Certificate
    Choose Create new distributor certificate and press next.
    For Privilege choose Partner. This defines how much of the Tizen API the applications you'll be signing are allowed to access. The three levels are Public, Partner and Platform with Platform being the highest level of access. Unfortunately that's not available to us, so we choose Partner.
    IMPORTANT: Leave the password as it is.
    Under the section Add individual DUIDs you should find the first entry contains something that starts with 2.0#.... That's your Gear Fit2's DUID. If you don't see it, press cancel (sorry) and go back to the Connect Gear Fit2 to Tizen Studio section above. If you do see, it press next. Make a note of the location of the distributor certificate. This should be the same as the author certificate from above. Then press Finish and you're done.

Signing and installing applications on your Gear Fit2
Things to download (See attachments to the post)
  • Fit2Installer
  • PacMan
    We'll use PacMan as an example. It's a modified version of the PacMan application found in this xda post. Some of the other applications in that link work on the Gear Fit2, some don't.
Using Fit2Installer
Download and extract the Fit2Installer. The folder contains the following.
  • sdb.exe: Smart Development Bridge for Tizen devices. This allows us to connect to the device and install applications. See tizen.developer.org's sdb section for more information on what you can do with it.
  • 7zipcli: The open source a command-line archiver from 7-zip. Used to package applications.
  • tizen: A very stripped down version of Tizen Studio that only contains the required files for signing and packaging applications.
  • cert: Empty folder where you're supposed to place your own certificates.
  • sign_me: Empty folder where you place applications you want to be signed.
  • install_me: Empty folder where you place applications you want to be installed on your device.
  • sign.bat: Batch script that will sign the applications put in sign_me
  • sign.bat: Batch script that will connect your Gear Fit2 to your computer, allowing you to install applications.
  • install.bat: Batch script that will install the applications put in install_me
  • connect.bat: Batch script that will connect to your Gear Fit2.
  • disconnect.bat: Batch script that will disconnect from your Gear Fit2.

Setting up your certificates
Go to the location of the certificates you generated with the Certificate Manager. The standard location is in your user folder under ~\SamsungCertificate\<name of cert profile>. The folder should contain 9 files. Copy all those directly into the .\Fit2Installer\cert\ folder. Eg, distributor.p12 should be placed as .\Fit2Installer\cert\distributor.p12.

Signing applications
There are two ways of using the sign.bat script.

  1. Place a *.tpk or *.wgt file directly in the sign_me folder. Run the sign.bat script and type in the password you chose for your certificate earlier. If successful, this will produce a *.tpk or *.wgt file in the install_me folder.
  2. If you don't have the package file, but rather just a folder containing the files for the application you'll have to place that folder in sign_me. For *.tpk files, this means the path will be .\Fit2Installer\sign_me\<application_folder>\tizen-manifest.xml. For *wgt files it will be .\Fit2Installer\sign_me\<application_folder>\config.xml. Now, run the sign.bat script and type in your certificate password.
As an example, I've attached PacMan. PacMan is a web-app that was packaged for the Gear S2. In order to get it to fit the Gear Fit2 screen, I had to extract the PacMan.wgt file and make a few changes to the code. Changes to the files invalidates the signature, so I had to resign it using my own certificates. If you've everything set up correctly, this should be fairly simple for you to do too.
Extract the PacMan.zip archive and place the content in the folder .\Fit2Installer\sign_me\PacMan\ and run the sign.bat script. Look in the install_me folder to check there's a *.wgt file for PacMan.

Installing applications
As in the earlier section Connect Gear Fit2 to Tizen Studio, make sure you're on Wi-Fi, bluetooth is off and debugging in turned on. Also, make sure you only have one Tizen device connected to your computer (this includes Tizen emulators).

Run the connect.bat script and type in the IP address of your Gear Fit2. If you do not know the IP address, you can find it on the device under Settings->Connections->Wi-Fi->Wi-Fi networks-><wifi_name> and at the bottom of the list. Make sure you allow sdb.exe through your firewall.
Important responses are:
  • error: failed to connect to remote target <ip address>
    Make sure you've set up your device correctly. Try turning Wi-Fi off and on. Or even a reboot of the device.
  • device unauthorized. Please approve on your device.
    This may mean you have to accept the RSA key fingerprint on your Gear Fit2. However, there appears to be a bug in the sdb that causes this to happen regardless. Try to run the script twice and see if you get the message below:
  • <ip address>:26101 is already connected
    Now you know for sure your device is connected.

After you've connected, you can safely turn Bluetooth back on. Remember to run disconnect.bat when you're done installing applications. Your Gear Fit2 will otherwise stay connected and drain a lot of battery.

Similarly to using the sign.bat script, there are two ways of using the install.bat script. Both of them require the application to already have a valid signature.
  1. Place a *.tpk or *.wgt file directly in the install_me folder. Run the install.bat script.
  2. If you don't have the package file, but rather just a folder containing the application you'll have to place that folder in install_me. For *.tpk files, this means the path will be .\Fit2Installer\install_me\<application_folder>\tizen-manifest.xml. For *wgt files it will be .\Fit2Installer\install_me\<application_folder>\config.xml.. Run the install.bat script.

Since PacMan should already be signed and placed correctly in the install_me folder, you can now run the install.bat script to install it on your Gear Fit2.
It may work on gear s? Tizen is linux kernel isn't it? I starting my little steps on code thanks for your explanetion...

Sent from my SM-G955F using Tapatalk
 

adfree

Senior Member
Jun 14, 2008
9,146
5,396
Few months tooo late...

Somebody tested this solution successfully?
:confused:


I wish to insert the Certs for Public, Partner and Platform...
https://forum.xda-developers.com/showpost.php?p=76472787&postcount=509
:angel:


I am using since years my SM-Z130H, RD-PQ and now SM-Z300H for signing easily...

But as Windows Fan Boy maybe Windows solution would be nice. :angel:

I will later add info where I have problems... maybe only path wrong...

Best Regards
 

adfree

Senior Member
Jun 14, 2008
9,146
5,396
Code:
D:\Fit2Installer>sign.bat
Enter certificate password: test
Setting configuration is succeeded....

No exist the default path of security profiles.
[COLOR="Red"][B]Specified file not found: ..\..\..\..\..\cert\author.p12[/B][/COLOR]

7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
Scanning

Creating archive ..\PacMan_zip.zip

Compressing  audio\die.mp3
Compressing  audio\die.ogg
Compressing  audio\eatghost.mp3
Compressing  audio\eatghost.ogg
Compressing  audio\eating.mp3
Compressing  audio\eating.ogg
Compressing  audio\eating.short.mp3
Compressing  audio\eating.short.ogg
Compressing  audio\eatpill.mp3
Compressing  audio\eatpill.ogg
Compressing  audio\extra lives.mp3
Compressing  audio\extra lives.ogg
Compressing  audio\intermission.mp3
Compressing  audio\intermission.ogg
Compressing  audio\opening_song.mp3
Compressing  audio\opening_song.ogg
Compressing  audio\siren.mp3
Compressing  audio\siren.ogg
Compressing  audio\vcs_90.mp3
Compressing  audio\vcs_90.ogg
Compressing  BD_Cartoon_Shout-webfont.ttf
Compressing  config.xml
Compressing  icon.png
Compressing  index.html
Compressing  jquery-1.9.1.js
Compressing  LICENSE
Compressing  modernizr-1.5.min.js
Compressing  pacman.js
Compressing  screenshots\pacman1.png
Compressing  screenshots\pacman2.png
Compressing  screenshots\pacman3.png
Compressing  screenshots\pacman4.png

Everything is Ok
        1 Datei(en) verschoben.
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/osgi/util/NLS
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.tizen.ncli.subcommands.sign.SignCLICommand.validateProfilesPath(SignCLICommand.java:120)
        at org.tizen.ncli.subcommands.sign.SignCLICommand.call(SignCLICommand.java:63)
        at org.tizen.ncli.subcommands.sign.SignCLICommand.call(SignCLICommand.java:48)
        at org.tizen.ncli.subcommands.AbstractSubCommand.runCommand(AbstractSubCommand.java:85)
        at org.tizen.ncli.ide.shell.PackageCLI.doRepackageForWgt(PackageCLI.java:470)
        at org.tizen.ncli.ide.shell.PackageCLI.doPackageForWgt(PackageCLI.java:715)
        at org.tizen.ncli.ide.shell.PackageCLI.execute(PackageCLI.java:1056)
        at org.tizen.ncli.ide.shell.AbstractCLI.execute(AbstractCLI.java:92)
        at org.tizen.ncli.ide.shell.Main.run(Main.java:144)
        at org.tizen.ncli.ide.shell.Main.main(Main.java:78)
Caused by: java.lang.ClassNotFoundException: org.eclipse.osgi.util.NLS
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 22 more
Drücken Sie eine beliebige Taste . . .

Will try to set Path manually...
Maybe my fault...

Best Regards
 

stakoz

Member
Dec 21, 2007
38
12
Code:
D:\Fit2Installer>sign.bat
Enter certificate password: test
Setting configuration is succeeded....

No exist the default path of security profiles.
[COLOR="Red"][B]Specified file not found: ..\..\..\..\..\cert\author.p12[/B][/COLOR]

7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
Scanning

Creating archive ..\PacMan_zip.zip

Compressing  audio\die.mp3
Compressing  audio\die.ogg
Compressing  audio\eatghost.mp3
Compressing  audio\eatghost.ogg
Compressing  audio\eating.mp3
Compressing  audio\eating.ogg
Compressing  audio\eating.short.mp3
Compressing  audio\eating.short.ogg
Compressing  audio\eatpill.mp3
Compressing  audio\eatpill.ogg
Compressing  audio\extra lives.mp3
Compressing  audio\extra lives.ogg
Compressing  audio\intermission.mp3
Compressing  audio\intermission.ogg
Compressing  audio\opening_song.mp3
Compressing  audio\opening_song.ogg
Compressing  audio\siren.mp3
Compressing  audio\siren.ogg
Compressing  audio\vcs_90.mp3
Compressing  audio\vcs_90.ogg
Compressing  BD_Cartoon_Shout-webfont.ttf
Compressing  config.xml
Compressing  icon.png
Compressing  index.html
Compressing  jquery-1.9.1.js
Compressing  LICENSE
Compressing  modernizr-1.5.min.js
Compressing  pacman.js
Compressing  screenshots\pacman1.png
Compressing  screenshots\pacman2.png
Compressing  screenshots\pacman3.png
Compressing  screenshots\pacman4.png

Everything is Ok
        1 Datei(en) verschoben.
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/osgi/util/NLS
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.tizen.ncli.subcommands.sign.SignCLICommand.validateProfilesPath(SignCLICommand.java:120)
        at org.tizen.ncli.subcommands.sign.SignCLICommand.call(SignCLICommand.java:63)
        at org.tizen.ncli.subcommands.sign.SignCLICommand.call(SignCLICommand.java:48)
        at org.tizen.ncli.subcommands.AbstractSubCommand.runCommand(AbstractSubCommand.java:85)
        at org.tizen.ncli.ide.shell.PackageCLI.doRepackageForWgt(PackageCLI.java:470)
        at org.tizen.ncli.ide.shell.PackageCLI.doPackageForWgt(PackageCLI.java:715)
        at org.tizen.ncli.ide.shell.PackageCLI.execute(PackageCLI.java:1056)
        at org.tizen.ncli.ide.shell.AbstractCLI.execute(AbstractCLI.java:92)
        at org.tizen.ncli.ide.shell.Main.run(Main.java:144)
        at org.tizen.ncli.ide.shell.Main.main(Main.java:78)
Caused by: java.lang.ClassNotFoundException: org.eclipse.osgi.util.NLS
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 22 more
Drücken Sie eine beliebige Taste . . .

Will try to set Path manually...
Maybe my fault...

Best Regards

yes, i also had to change the paths manually in the sign.bat file; and then it works - on gear s3, tizen 3.0.0.2
 
Last edited:
  • Like
Reactions: adfree

stakoz

Member
Dec 21, 2007
38
12
Hi adfree

I have placed the unzipped "Fit2Installer" folder in the main tree C:\Fit2Installer
(this is Windows 10 on a Virtual Machine on a Mac)

As per the instructions have already copy pasted the certificates made with Tizen Studio in C:\Fit2Installer\cert

Below is the contents of my "sign.bat" file relating to above path

And further below is also the output window of cmd.exe having run the "sign.bat" file for "waldo_transl.wgt" that was placed in the "sign_me" subfolder

There is something about security profile.xml path, which i also tried to address by editing the default profile path in the "tizen cli-config" file, but it always comes back as before, so left it as it was, as it still works.

Finally I also shared with all my PC users the read/write rights for the "Fit2Installer" folder just in case, as described in the instructions for the "Tizen Studio" folder too

Hope this helps

+++
contents of my modified "sign.bat" :
+++

@Echo off
set /p pass="Enter certificate password: "
call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat cli-config -- .\tizen "default.profiles.path=..\..\..\..\profiles.xml"
call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat security-profiles add -- .\tizen -f -n MyProfile -a C:\Fit2Installer\cert\author.p12 -p %pass% -d C:\Fit2Installer\cert\distributor.p12 -dp %pass%

for %%f in (.\sign_me\*.tpk) do (
call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat package -t tpk -s MyProfile -- "%%f" -o C:\Fit2Installer\install_me\
)

for %%f in (.\sign_me\*.wgt) do (
call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat package -t wgt -s MyProfile -- "%%f" -o C:\Fit2Installer\install_me\
)

for /D %%d in (.\sign_me\*) do (
IF EXIST %%d\config.xml (
cd %%d
call "C:\Fit2Installer\7zipcli\7za.exe" a "..\%%~nd_zip.zip" *
cd ..
move "%%~nd_zip.zip" "%%~nd_wgt.wgt"
cd ..
call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat package -t wgt -s MyProfile -- ".\sign_me\%%~nd_wgt.wgt" -o C:\Fit2Installer\install_me\
del ".\sign_me\%%~nd_wgt.wgt"
) ELSE (
IF EXIST %%d\tizen-manifest.xml (
cd %%d
call "C:\Fit2Installer\7zipcli\7za.exe" a "..\%%~nd_zip.zip" *
cd ..
move "%%~nd_zip.zip" "%%~nd_tpk.tpk"
cd ..
call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat package -t tpk -s MyProfile -- ".\sign_me\%%~nd_tpk.tpk" -o C:\Fit2Installer\install_me\
del ".\sign_me\%%~nd_tpk.tpk"
)
)
)

pause

+++
contents of the output window of cmd.exe having run above sign.bat file :
+++
Enter certificate password: password
Setting configuration is succeeded....

Loaded in 'C:\Fit2Installer\tizen\profiles.xml'.
Security profiles have a specified profile. Will be overwritten.
author path: C:\Fit2Installer\cert\author.p12
author password: *********
distributor1 path: C:\Fit2Installer\cert\distributor.p12
distributor1 password: *********

Wrote to 'C:\Fit2Installer\tizen\profiles.xml'.
Succeed to add 'MyProfile' profile.
If want to sign by this, add the file of security profiles in CLI configuration
like 'tizen cli-config "profiles.path=C:\Fit2Installer\tizen\profiles.xml"'.
Author certficate: C:\Fit2Installer\cert\author.p12
Distributor1 certificate : C:\Fit2Installer\cert\distributor.p12
Package( C:\Fit2Installer\install_me\waldo_transl.wgt ) is created successfully.
Press any key to continue . . .
+++
 
  • Like
Reactions: t3chg33k and adfree

t3chg33k

Senior Member
Jan 6, 2011
314
157
The query I had is resolved after going through the complete thread, so this post is irrelevant. However, I might as well use this opportunity to thank those who have contributed to this as the guide works fine.
 
Last edited:
  • Like
Reactions: adfree

Namenlos55555

Member
Feb 3, 2017
20
3
Hey, i would like to take this opportunity and thank you for this really useful guide. Everything works fine, but I would like to ask you about the changes you did to the .wgt in order to get the screen shape right, because most of the apps are either cut in half or really small.
 

adfree

Senior Member
Jun 14, 2008
9,146
5,396
Code:
Enter certificate password: topsecret
Setting configuration is succeeded....

Loaded in 'C:\Fit2Installer\tizen\profiles.xml'.
Security profiles have a specified profile. Will be overwritten.
author path: C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\..\..\..\..\..\cert\author.p12
author password: ****
distributor1 path: C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\..\..\..\..\..\cert\distributor.p12
distributor1 password: ****

Wrote to 'C:\Fit2Installer\tizen\profiles.xml'.
Succeed to add 'MyProfile' profile.
If want to sign by this, add the file of security profiles in CLI configuration
  like 'tizen cli-config "profiles.path=C:\Fit2Installer\tizen\profiles.xml"'.
Author certficate: C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\..\..\..\..\..\cert\author.p12
Distributor1 certificate : C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\..\..\..\..\..\cert\distributor.p12
Package( C:\Fit2Installer\install_me\publicTEST_fake_v12.tpk ) is created successfully.
Drücken Sie eine beliebige Taste . . .

I am using this solution since few days... without Modification. :good: :good: :cool:

With Tizen 4 Firmware on SM-R760... and Certs from Tizen Studio 3.1.
Windows 7


Thank you very much. :good: :good:

Best Regards
 
  • Like
Reactions: ecompton59

nadastry

Senior Member
Oct 16, 2012
136
9
Hello,

I cannot sign anything, I get errors in cli.log.
Could you help me fixing these?

Cli.log:
2019-02-24 10:56:51,523 [TRACE] Main.java(90) - Start running Tizen CLI Main class...
2019-02-24 10:56:51,526 [TRACE] Main.java(91) - Argument count:6
2019-02-24 10:56:51,533 [TRACE] ConfigCLI.java(52) - setConfigProperty default.profiles.path=..\..\..\..\profiles.xml
2019-02-24 10:56:51,533 [TRACE] ConfigCLI.java(78) - Execute configCLI...
2019-02-24 10:56:52,034 [TRACE] Main.java(90) - Start running Tizen CLI Main class...
2019-02-24 10:56:52,037 [TRACE] Main.java(91) - Argument count:17
2019-02-24 10:56:52,049 [TRACE] SecurityProfilesCLI.java(56) - Begin SecuriyProfilesCLI...
2019-02-24 10:56:52,741 [TRACE] SecurityProfilesCLI.java(66) - Finish SecuriyProfilesCLI...
2019-02-24 10:56:53,196 [TRACE] Main.java(90) - Start running Tizen CLI Main class...
2019-02-24 10:56:53,198 [TRACE] Main.java(91) - Argument count:11
2019-02-24 10:56:53,209 [TRACE] PackageCLI.java(981) - Execute PackageCLI...
2019-02-24 10:56:53,212 [TRACE] PackageCLI.java(983) - getRealWorkingPath: C:\Users\Hex\Desktop\S3Watchfaces\appswgt\Fit2Installer_freedials\sign_me\pilot.wgt
2019-02-24 10:56:53,213 [TRACE] PackageCLI.java(452) - Re-packaging wgt file C:\Users\Hex\Desktop\S3Watchfaces\appswgt\Fit2Installer_freedials\sign_me\pilot.wgt
2019-02-24 10:56:53,530 [ERROR] AbstractCLI.java(94) - java.util.zip.ZipException: invalid entry size (expected 61948 but got 61958 bytes)
java.lang.IllegalStateException: java.util.zip.ZipException: invalid entry size (expected 61948 but got 61958 bytes)
at org.tizen.common.core.command.policy.UncaughtExceptionHandlingPolicy.uncaughtException(UncaughtExceptionHandlingPolicy.java:84)
at org.tizen.common.core.command.Executor.execute(Executor.java:179)
at org.tizen.common.core.command.Executor.execute(Executor.java:150)
at org.tizen.ncli.ide.shell.PackageCLI.doRepackageForWgt(PackageCLI.java:463)
at org.tizen.ncli.ide.shell.PackageCLI.doPackageForWgt(PackageCLI.java:715)
at org.tizen.ncli.ide.shell.PackageCLI.execute(PackageCLI.java:1056)
at org.tizen.ncli.ide.shell.AbstractCLI.execute(AbstractCLI.java:92)
at org.tizen.ncli.ide.shell.Main.run(Main.java:144)
at org.tizen.ncli.ide.shell.Main.main(Main.java:78)
Caused by: java.util.zip.ZipException: invalid entry size (expected 61948 but got 61958 bytes)
at java.util.zip.ZipInputStream.readEnd(Unknown Source)
at java.util.zip.ZipInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at org.tizen.common.util.IOUtil.redirect(IOUtil.java:149)
at org.tizen.common.file.StandardFileHandler.write(StandardFileHandler.java:283)
at org.tizen.common.core.command.zip.ZipExtrCommand.run(ZipExtrCommand.java:116)
at org.tizen.common.core.command.Executor.execute(Executor.java:164)
... 7 more
2019-02-24 10:56:53,532 [ERROR] Main.java(152) - java.util.zip.ZipException: invalid entry size (expected 61948 but got 61958 bytes)
 
Last edited:
  • Like
Reactions: adfree

adfree

Senior Member
Jun 14, 2008
9,146
5,396
:confused:

Need solution to create Distributor Cert with Platform Privilege...

Tizen Studio only shows:
Code:
Public
Partner

Maybe via Command Line?
:confused:


My old trick at the moment not work anymore in Tizen 3... 4...

Because DUID required to be written into Cert... :rolleyes: :rolleyes:

Please help. :angel:

Best Regards
 

adfree

Senior Member
Jun 14, 2008
9,146
5,396
I am using Platform Cert"s" from Hash-Signer... so at the moment only usefull in Combination Firmware... for me...
https://forum.xda-developers.com/showpost.php?p=79416572&postcount=751

But I made 2 new edited Batch Files for me...

1 can handle 2 different Passwords... for athor and Distributor Cert... the second Batch contains the Passwords... :D

Code:
@echo off
set /p pass="Enter Author certificate password: "
set /p pass2="Enter Distributor certificate password: "
call tizen\tizen-studio\tools\ide\bin\tizen.bat cli-config -- .\tizen "default.profiles.path=..\..\..\..\profiles.xml"
call tizen\tizen-studio\tools\ide\bin\tizen.bat security-profiles add -- .\tizen -f -n MyProfile -a ..\..\..\..\..\cert\author.p12 -p %pass% -d ..\..\..\..\..\cert\distributor.p12 -dp %pass2%

for  %%f in (.\sign_me\*.tpk) do (
call tizen\tizen-studio\tools\ide\bin\tizen.bat package -t tpk -s MyProfile -- "%%f" -o .\install_me\
)

for  %%f in (.\sign_me\*.wgt) do (
call tizen\tizen-studio\tools\ide\bin\tizen.bat package -t wgt -s MyProfile -- "%%f" -o .\install_me\
)

for /D %%d in (.\sign_me\*) do (
IF EXIST %%d\config.xml (
   cd %%d
   call "..\..\7zipcli\7za.exe" a "..\%%~nd_zip.zip" *
   cd ..
   move "%%~nd_zip.zip" "%%~nd_wgt.wgt"
   cd ..
   call tizen\tizen-studio\tools\ide\bin\tizen.bat package -t wgt -s MyProfile --  ".\sign_me\%%~nd_wgt.wgt" -o .\install_me\
   del ".\sign_me\%%~nd_wgt.wgt"
) ELSE ( 
IF EXIST %%d\tizen-manifest.xml (
   cd %%d
   call "..\..\7zipcli\7za.exe" a "..\%%~nd_zip.zip" *
   cd ..
   move "%%~nd_zip.zip" "%%~nd_tpk.tpk"
   cd ..
   call tizen\tizen-studio\tools\ide\bin\tizen.bat package -t tpk -s MyProfile --  ".\sign_me\%%~nd_tpk.tpk" -o .\install_me\
   del ".\sign_me\%%~nd_tpk.tpk"
)
)
)

pause

and

Code:
@echo off
call tizen\tizen-studio\tools\ide\bin\tizen.bat cli-config -- .\tizen "default.profiles.path=..\..\..\..\profiles.xml"
call tizen\tizen-studio\tools\ide\bin\tizen.bat security-profiles add -- .\tizen -f -n MyProfile -a ..\..\..\..\..\cert\author.p12 -p tizenauthor -d ..\..\..\..\..\cert\distributor.p12 -dp tizenpkcs12passfordsigner

for  %%f in (.\sign_me\*.tpk) do (
call tizen\tizen-studio\tools\ide\bin\tizen.bat package -t tpk -s MyProfile -- "%%f" -o .\install_me\
)

for  %%f in (.\sign_me\*.wgt) do (
call tizen\tizen-studio\tools\ide\bin\tizen.bat package -t wgt -s MyProfile -- "%%f" -o .\install_me\
)

for /D %%d in (.\sign_me\*) do (
IF EXIST %%d\config.xml (
   cd %%d
   call "..\..\7zipcli\7za.exe" a "..\%%~nd_zip.zip" *
   cd ..
   move "%%~nd_zip.zip" "%%~nd_wgt.wgt"
   cd ..
   call tizen\tizen-studio\tools\ide\bin\tizen.bat package -t wgt -s MyProfile --  ".\sign_me\%%~nd_wgt.wgt" -o .\install_me\
   del ".\sign_me\%%~nd_wgt.wgt"
) ELSE ( 
IF EXIST %%d\tizen-manifest.xml (
   cd %%d
   call "..\..\7zipcli\7za.exe" a "..\%%~nd_zip.zip" *
   cd ..
   move "%%~nd_zip.zip" "%%~nd_tpk.tpk"
   cd ..
   call tizen\tizen-studio\tools\ide\bin\tizen.bat package -t tpk -s MyProfile --  ".\sign_me\%%~nd_tpk.tpk" -o .\install_me\
   del ".\sign_me\%%~nd_tpk.tpk"
)
)
)

pause

Now I still need way to create Platform Cert with f%&ing DUID for Stock Firmware... :rolleyes:

Best Regards
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Intro
    This howto will explain how to sideload *.tpk and *.wgt applications on your Gear Fit2. It'll also cover how to re-sign the application with your own certificates. This can be required if the application does not include a signature that's valid for your particular Gear Fit2. For example, this would be the case for applications that haven't been accepted to the Galaxy Apps store.

    Warning
    Unless we get people to develop and share their applications for the Gear Fit2, essentially all applications will have been developed for a different device. This means you'll run into varying degrees of incompatibility. Even if the application installs, there's no guarantee it will run. And even if it does run, it may be a terrible experience. And please show some caution regarding what you attempt to install, I don't take responsibility if you break anything following the guide.

    Getting your own author and distributor certificates for your Gear Fit2
    In order to sign applications, you need an author and distributor certificate for our Gear Fit2 device. For applications on the Galaxy Apps store, Samsung would be the one who signs applications with a distributor certificate. Since you will be sideloading applications, there's no guarantee they contain a valid signature from Samsung. You there need your own distributor certificate. This certificate will only be valid for signing applications for your particular Gear Fit2, which is why I can't make one for you. However you'll only have to do this once and can uninstall Tizen Studio after you're done. Unless you want to develop applications for the Gear Fit2, of course.

    Things to download
    Tizen Studio setup
    To install, simply accept the software licence agreement and install both the Tizen SDK and data in their default locations.
    After installation, Tizen Studio Package Manager should automatically launch. If not, launch Tizen Studio and choose Tools->Package Manager. In the Package Manager you choose the Extension SDK tab and install Samsung Certificate Extension. When it has been installed, close the window and launch Tizen Studio. Press OK for default workspace location.

    Connect Gear Fit2 to Tizen Studio
    On your Gear Fit2: Got to Settings->Gear info and turn on Debugging. Then go to Settings->Connections. Here you make sure Wi-Fi is turned on and logged on to the same Wi-Fi network as your Windows computer and that Bluetooth is turned off. The Gear Fit2 tend to automatically log off Wi-Fi networks if its connected through Bluetooth. While you can have both on if you're quick, simply turning off Bluetooth leads to much less frustration. You may have to restart your Gear Fit2 at this point to get everything working.

    In Tizen Studio, you should see a drop-down list in the tool bar saying No Target. Open the drop-down list and choose Launch remote device manager. Here you press Scan and wait for your device's IP address to appear. You'll only see Tizen devices, so unless you have multiple, there will only be one result. If it doesn't appear, repeat the process above. On the toggle under Connect, turn it from off to on. On your Gear Fit2 it should say RSA key fingerprint: .... You accept on the device and should now be connected. Close down the Remote Device Manager window. The drop-down list should now say SM-R360 ....

    Now you choose the menu item Tools->Certificate Manager. Add a new certificate profile by pressing the "+" sign up to the right and then select SAMSUNG as the type for your certificate profile. Go through the 4 tabs as follows
    1. Device Type
      Choose Mobile/Wearable and press next.
    2. Certificate Profile
      Choose Create a new certificate profile and type any name you want. Press next.
    3. Author Certificate
      Choose Create a new author certificate and press next.
      Type in an author name and password. Make sure you remember the password as it will be needed for signing applications later on.
      You'll now be asked to sign in to your Samsung account. If you don't have one, choose Create new account and follow instructions.
      After you've signed in you should get a Congratulations! notice. Take note of the location of the author certificate and press next
    4. Distributor Certificate
      Choose Create new distributor certificate and press next.
      For Privilege choose Partner. This defines how much of the Tizen API the applications you'll be signing are allowed to access. The three levels are Public, Partner and Platform with Platform being the highest level of access. Unfortunately that's not available to us, so we choose Partner.
      IMPORTANT: Leave the password as it is.
      Under the section Add individual DUIDs you should find the first entry contains something that starts with 2.0#.... That's your Gear Fit2's DUID. If you don't see it, press cancel (sorry) and go back to the Connect Gear Fit2 to Tizen Studio section above. If you do see, it press next. Make a note of the location of the distributor certificate. This should be the same as the author certificate from above. Then press Finish and you're done.

    Signing and installing applications on your Gear Fit2
    Things to download (See attachments to the post)
    • Fit2Installer
    • PacMan
      We'll use PacMan as an example. It's a modified version of the PacMan application found in this xda post. Some of the other applications in that link work on the Gear Fit2, some don't.
    Using Fit2Installer
    Download and extract the Fit2Installer. The folder contains the following.
    • sdb.exe: Smart Development Bridge for Tizen devices. This allows us to connect to the device and install applications. See tizen.developer.org's sdb section for more information on what you can do with it.
    • 7zipcli: The open source a command-line archiver from 7-zip. Used to package applications.
    • tizen: A very stripped down version of Tizen Studio that only contains the required files for signing and packaging applications.
    • cert: Empty folder where you're supposed to place your own certificates.
    • sign_me: Empty folder where you place applications you want to be signed.
    • install_me: Empty folder where you place applications you want to be installed on your device.
    • sign.bat: Batch script that will sign the applications put in sign_me
    • sign.bat: Batch script that will connect your Gear Fit2 to your computer, allowing you to install applications.
    • install.bat: Batch script that will install the applications put in install_me
    • connect.bat: Batch script that will connect to your Gear Fit2.
    • disconnect.bat: Batch script that will disconnect from your Gear Fit2.

    Setting up your certificates
    Go to the location of the certificates you generated with the Certificate Manager. The standard location is in your user folder under ~\SamsungCertificate\<name of cert profile>. The folder should contain 9 files. Copy all those directly into the .\Fit2Installer\cert\ folder. Eg, distributor.p12 should be placed as .\Fit2Installer\cert\distributor.p12.

    Signing applications
    There are two ways of using the sign.bat script.

    1. Place a *.tpk or *.wgt file directly in the sign_me folder. Run the sign.bat script and type in the password you chose for your certificate earlier. If successful, this will produce a *.tpk or *.wgt file in the install_me folder.
    2. If you don't have the package file, but rather just a folder containing the files for the application you'll have to place that folder in sign_me. For *.tpk files, this means the path will be .\Fit2Installer\sign_me\<application_folder>\tizen-manifest.xml. For *wgt files it will be .\Fit2Installer\sign_me\<application_folder>\config.xml. Now, run the sign.bat script and type in your certificate password.
    As an example, I've attached PacMan. PacMan is a web-app that was packaged for the Gear S2. In order to get it to fit the Gear Fit2 screen, I had to extract the PacMan.wgt file and make a few changes to the code. Changes to the files invalidates the signature, so I had to resign it using my own certificates. If you've everything set up correctly, this should be fairly simple for you to do too.
    Extract the PacMan.zip archive and place the content in the folder .\Fit2Installer\sign_me\PacMan\ and run the sign.bat script. Look in the install_me folder to check there's a *.wgt file for PacMan.

    Installing applications
    As in the earlier section Connect Gear Fit2 to Tizen Studio, make sure you're on Wi-Fi, bluetooth is off and debugging in turned on. Also, make sure you only have one Tizen device connected to your computer (this includes Tizen emulators).

    Run the connect.bat script and type in the IP address of your Gear Fit2. If you do not know the IP address, you can find it on the device under Settings->Connections->Wi-Fi->Wi-Fi networks-><wifi_name> and at the bottom of the list. Make sure you allow sdb.exe through your firewall.
    Important responses are:
    • error: failed to connect to remote target <ip address>
      Make sure you've set up your device correctly. Try turning Wi-Fi off and on. Or even a reboot of the device.
    • device unauthorized. Please approve on your device.
      This may mean you have to accept the RSA key fingerprint on your Gear Fit2. However, there appears to be a bug in the sdb that causes this to happen regardless. Try to run the script twice and see if you get the message below:
    • <ip address>:26101 is already connected
      Now you know for sure your device is connected.

    After you've connected, you can safely turn Bluetooth back on. Remember to run disconnect.bat when you're done installing applications. Your Gear Fit2 will otherwise stay connected and drain a lot of battery.

    Similarly to using the sign.bat script, there are two ways of using the install.bat script. Both of them require the application to already have a valid signature.
    1. Place a *.tpk or *.wgt file directly in the install_me folder. Run the install.bat script.
    2. If you don't have the package file, but rather just a folder containing the application you'll have to place that folder in install_me. For *.tpk files, this means the path will be .\Fit2Installer\install_me\<application_folder>\tizen-manifest.xml. For *wgt files it will be .\Fit2Installer\install_me\<application_folder>\config.xml.. Run the install.bat script.

    Since PacMan should already be signed and placed correctly in the install_me folder, you can now run the install.bat script to install it on your Gear Fit2.
    2
    Hi adfree

    I have placed the unzipped "Fit2Installer" folder in the main tree C:\Fit2Installer
    (this is Windows 10 on a Virtual Machine on a Mac)

    As per the instructions have already copy pasted the certificates made with Tizen Studio in C:\Fit2Installer\cert

    Below is the contents of my "sign.bat" file relating to above path

    And further below is also the output window of cmd.exe having run the "sign.bat" file for "waldo_transl.wgt" that was placed in the "sign_me" subfolder

    There is something about security profile.xml path, which i also tried to address by editing the default profile path in the "tizen cli-config" file, but it always comes back as before, so left it as it was, as it still works.

    Finally I also shared with all my PC users the read/write rights for the "Fit2Installer" folder just in case, as described in the instructions for the "Tizen Studio" folder too

    Hope this helps

    +++
    contents of my modified "sign.bat" :
    +++

    @Echo off
    set /p pass="Enter certificate password: "
    call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat cli-config -- .\tizen "default.profiles.path=..\..\..\..\profiles.xml"
    call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat security-profiles add -- .\tizen -f -n MyProfile -a C:\Fit2Installer\cert\author.p12 -p %pass% -d C:\Fit2Installer\cert\distributor.p12 -dp %pass%

    for %%f in (.\sign_me\*.tpk) do (
    call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat package -t tpk -s MyProfile -- "%%f" -o C:\Fit2Installer\install_me\
    )

    for %%f in (.\sign_me\*.wgt) do (
    call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat package -t wgt -s MyProfile -- "%%f" -o C:\Fit2Installer\install_me\
    )

    for /D %%d in (.\sign_me\*) do (
    IF EXIST %%d\config.xml (
    cd %%d
    call "C:\Fit2Installer\7zipcli\7za.exe" a "..\%%~nd_zip.zip" *
    cd ..
    move "%%~nd_zip.zip" "%%~nd_wgt.wgt"
    cd ..
    call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat package -t wgt -s MyProfile -- ".\sign_me\%%~nd_wgt.wgt" -o C:\Fit2Installer\install_me\
    del ".\sign_me\%%~nd_wgt.wgt"
    ) ELSE (
    IF EXIST %%d\tizen-manifest.xml (
    cd %%d
    call "C:\Fit2Installer\7zipcli\7za.exe" a "..\%%~nd_zip.zip" *
    cd ..
    move "%%~nd_zip.zip" "%%~nd_tpk.tpk"
    cd ..
    call C:\Fit2Installer\tizen\tizen-studio\tools\ide\bin\tizen.bat package -t tpk -s MyProfile -- ".\sign_me\%%~nd_tpk.tpk" -o C:\Fit2Installer\install_me\
    del ".\sign_me\%%~nd_tpk.tpk"
    )
    )
    )

    pause

    +++
    contents of the output window of cmd.exe having run above sign.bat file :
    +++
    Enter certificate password: password
    Setting configuration is succeeded....

    Loaded in 'C:\Fit2Installer\tizen\profiles.xml'.
    Security profiles have a specified profile. Will be overwritten.
    author path: C:\Fit2Installer\cert\author.p12
    author password: *********
    distributor1 path: C:\Fit2Installer\cert\distributor.p12
    distributor1 password: *********

    Wrote to 'C:\Fit2Installer\tizen\profiles.xml'.
    Succeed to add 'MyProfile' profile.
    If want to sign by this, add the file of security profiles in CLI configuration
    like 'tizen cli-config "profiles.path=C:\Fit2Installer\tizen\profiles.xml"'.
    Author certficate: C:\Fit2Installer\cert\author.p12
    Distributor1 certificate : C:\Fit2Installer\cert\distributor.p12
    Package( C:\Fit2Installer\install_me\waldo_transl.wgt ) is created successfully.
    Press any key to continue . . .
    +++
    2
    signing TPK on mac / OSX

    I was able to re-sign a tpk using tizen studio installed on my mac. The approach is the same, you will need to set up your certificates and have a samsung developer account. Use the device manager to connect to your watch after placing it in developer mode. Then run the following command to re-sign a tpk.

    Code:
    ~/tizen-studio/tools/ide/bin/tizen package -t tpk -s <profile_name> -- <package_name>.tpk

    After that you can use sdb to install the package.

    Code:
    ~/tizen-studio/tools/sdb install BP.tpk

    Note that I have tizen-studio installed in my home directory, you may have it installed in a different location. In that case adjust the path accordingly. I believe these commands may also work on Linux but I have not tried.
    1
    Code:
    D:\Fit2Installer>sign.bat
    Enter certificate password: test
    Setting configuration is succeeded....
    
    No exist the default path of security profiles.
    [COLOR="Red"][B]Specified file not found: ..\..\..\..\..\cert\author.p12[/B][/COLOR]
    
    7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
    Scanning
    
    Creating archive ..\PacMan_zip.zip
    
    Compressing  audio\die.mp3
    Compressing  audio\die.ogg
    Compressing  audio\eatghost.mp3
    Compressing  audio\eatghost.ogg
    Compressing  audio\eating.mp3
    Compressing  audio\eating.ogg
    Compressing  audio\eating.short.mp3
    Compressing  audio\eating.short.ogg
    Compressing  audio\eatpill.mp3
    Compressing  audio\eatpill.ogg
    Compressing  audio\extra lives.mp3
    Compressing  audio\extra lives.ogg
    Compressing  audio\intermission.mp3
    Compressing  audio\intermission.ogg
    Compressing  audio\opening_song.mp3
    Compressing  audio\opening_song.ogg
    Compressing  audio\siren.mp3
    Compressing  audio\siren.ogg
    Compressing  audio\vcs_90.mp3
    Compressing  audio\vcs_90.ogg
    Compressing  BD_Cartoon_Shout-webfont.ttf
    Compressing  config.xml
    Compressing  icon.png
    Compressing  index.html
    Compressing  jquery-1.9.1.js
    Compressing  LICENSE
    Compressing  modernizr-1.5.min.js
    Compressing  pacman.js
    Compressing  screenshots\pacman1.png
    Compressing  screenshots\pacman2.png
    Compressing  screenshots\pacman3.png
    Compressing  screenshots\pacman4.png
    
    Everything is Ok
            1 Datei(en) verschoben.
    Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/osgi/util/NLS
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(Unknown Source)
            at java.security.SecureClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.access$100(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at org.tizen.ncli.subcommands.sign.SignCLICommand.validateProfilesPath(SignCLICommand.java:120)
            at org.tizen.ncli.subcommands.sign.SignCLICommand.call(SignCLICommand.java:63)
            at org.tizen.ncli.subcommands.sign.SignCLICommand.call(SignCLICommand.java:48)
            at org.tizen.ncli.subcommands.AbstractSubCommand.runCommand(AbstractSubCommand.java:85)
            at org.tizen.ncli.ide.shell.PackageCLI.doRepackageForWgt(PackageCLI.java:470)
            at org.tizen.ncli.ide.shell.PackageCLI.doPackageForWgt(PackageCLI.java:715)
            at org.tizen.ncli.ide.shell.PackageCLI.execute(PackageCLI.java:1056)
            at org.tizen.ncli.ide.shell.AbstractCLI.execute(AbstractCLI.java:92)
            at org.tizen.ncli.ide.shell.Main.run(Main.java:144)
            at org.tizen.ncli.ide.shell.Main.main(Main.java:78)
    Caused by: java.lang.ClassNotFoundException: org.eclipse.osgi.util.NLS
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            ... 22 more
    Drücken Sie eine beliebige Taste . . .

    Will try to set Path manually...
    Maybe my fault...

    Best Regards

    yes, i also had to change the paths manually in the sign.bat file; and then it works - on gear s3, tizen 3.0.0.2
    1
    hmm, i am stuck at this point :

    In Tizen Studio, you should see a drop-down list in the tool bar saying No Target. Open the drop-down list and choose Launch remote device manager. Here you press Scan and wait for your device's IP address to appear. You'll only see Tizen devices, so unless you have multiple, there will only be one result. If it doesn't appear, repeat the process above. On the toggle under Connect, turn it from off to on. On your Gear Fit2 it should say RSA key fingerprint: .... You accept on the device and should now be connected. Close down the Remote Device Manager window. The drop-down list should now say SM-R360 ....

    i can see my gear S3 listed, i see the IP address, i can click on connect, but i never see hat "RSA fingerprint" message on my watch, i dont see any kind of nofitication on it ... so the device is not lsited when i close the "remote device manager"

    what am i missing?

    edit: fixed! seems BT was still connected also, after turning it off, the RSA prompt came
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone