Skip to content

Commit

Permalink
feat: tizenbrew updater for desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
reisxd committed Jun 28, 2024
1 parent 98b31c4 commit 53d27c6
Show file tree
Hide file tree
Showing 8 changed files with 771 additions and 28 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build-new-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ jobs:
- name: Install modules and build standalone service
working-directory: tizenbrew-app/TizenBrew/service
run: |
sudo apt install -y expect zip coreutils
sudo apt install -y expect zip coreutils
sudo curl -Lo /usr/bin/ldid https://github.com/ProcursusTeam/ldid/releases/download/v2.1.5-procursus7/ldid_linux_x86_64
sudo chmod a+rwx /usr/bin/ldid
npm install
npm install -g @vercel/ncc
npm install -g wgt-to-usb
npm install -g @vercel/ncc wgt-to-usb pkg
ncc build service.js
rm -r node_modules
Expand Down Expand Up @@ -113,6 +114,11 @@ jobs:
run: |
wgt-to-usb release/TizenBrewUpdater-Old.wgt
- name: Package Updater for Desktop
working-directory: tizenbrew-updater/TizenBrewUpdater
run: |
pkg -C GZip -t node18-win-x64,node18-linux-x64,node18-macos-arm64 -o dist/tizenbrew-updater service/dist/index.js
- name: Upload TizenBrew package artifact for Old Tizen
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -152,9 +158,6 @@ jobs:
with:
tag_name: ${{ env.RELEASE_VERSION }}
files: |
tizenbrew-app/TizenBrew/release/TizenBrewStandalone-Old.wgt
tizenbrew-app/TizenBrew/release/TizenBrewStandalone-New.wgt
tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-Old.wgt
tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-New.wgt
tizenbrew-app/TizenBrew/release/TizenBrewStandaloneUSBDemo.zip
tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdaterUSBDemo.zip
tizenbrew-app/TizenBrew/release/*
tizenbrew-updater/TizenBrewUpdater/release/*
tizenbrew-updater/TizenBrewUpdater/dist/*
51 changes: 48 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@ TizenBrew is a modular system, meaning you can install new modded websites and a

## Installation

To install TizenBrew, you need to have a Samsung TV (Tizen) device that has at least Tizen 3.0 (2017 or newer). There are three ways to install TizenBrew.
To install TizenBrew, you need to have a Samsung TV (Tizen) device that has at least Tizen 3.0 (2017 or newer). There are four ways to install TizenBrew.

### Using TizenBrew Updater

This method is easier than any other method and works on all Tizen versions.

1. Change the Host PC IP address to your PC's IP address by following [this](https://developer.samsung.com/smarttv/develop/getting-started/using-sdk/tv-device.html#Connecting-the-TV-and-SDK)

2. Download the latest TizenBrew Updater for your OS from the [releases page](https://github.com/reisxd/TizenBrew/releases/latest).

3. Run the TizenBrew Updater and follow the instructions.

4. Change the Host PC IP address to `127.0.0.1` by following [this](https://developer.samsung.com/smarttv/develop/getting-started/using-sdk/tv-device.html#Connecting-the-TV-and-SDK)

5. You can now launch the TizenBrew app on your TV.

Note that you may not be able to install TizenBrew to your TV if your TV is Tizen 8 or newer (2024+). You'll have to rebuild TizenBrew from source to install it on newer TVs.

### Using TizenBrew Installer

This method is easier than the USB Demo Package method, but it works only on Tizen 3.0 to 6.0 (2017 to 2021). If you have a newer TV, use the USB Demo Package method or the Command Line method.
This method is easier than the USB Demo Package method, but it works only on Tizen 3.0 to 6.0 (2017 to 2021). If you have a newer TV, use the TizenBrew Updater or the USB Demo Package method or the Command Line method.

1. Change the Host PC IP address to `127.0.0.1` by following [this](https://developer.samsung.com/smarttv/develop/getting-started/using-sdk/tv-device.html#Connecting-the-TV-and-SDK)

Expand All @@ -22,7 +38,7 @@ This method is easier than the USB Demo Package method, but it works only on Tiz

### Using USB Demo Package

Note that this method could be temporary. If you want to have TizenBrew permanently installed, use the command line method. This method is the 2nd easiest way to install TizenBrew.
Note that if you want to install TizenBrew using this method, the app will be installed for only 30 days. If you want to have TizenBrew permanently installed, use the command line method. This method is the 2nd easiest way to install TizenBrew.

1. Download the latest TizenBrew USB Demo Package from the [releases page](https://github.com/reisxd/TizenBrew/releases/latest).

Expand Down Expand Up @@ -61,3 +77,32 @@ Note that tizen is in `C:\tizen-studio\tools\ide\bin` on Windows and in `~/tizen
6. Set the Host PC IP address to `127.0.0.1` by following [this](https://developer.samsung.com/smarttv/develop/getting-started/using-sdk/tv-device.html#Connecting-the-TV-and-SDK)

7. You can now launch the TizenBrew app on your TV.


## Rebuiding TizenBrew

To rebuild TizenBrew, you need to have Node.js installed on your system. You can install Node.js from [here](https://nodejs.org/). You also need to have Tizen Studio installed on your system. You can install Tizen Studio from [here](https://developer.samsung.com/smarttv/develop/getting-started/setting-up-sdk/installing-tv-sdk.html).

1. Download the source code from the [releases page](https://github.com/reisxd/TizenBrew/releases/latest) (zip file) or clone the repository by running:
```bash
git clone https://github.com/reisxd/TizenBrew.git
```

2. Open up Tizen Studio and import the project by going to `File > Import > Tizen > Tizen Web Project` and import the `tizenbrew-app/TizenBrew` folder.

3. Open up the `tizenbrew-app/TizenBrew/service` folder in a terminal and run:

```bash
npm install
npx @vercel/ncc build service.js
```

4. Connect to your TV by following [this](https://developer.samsung.com/smarttv/develop/getting-started/using-sdk/tv-device.html#Connecting-the-TV-and-SDK)

5. Open up Certificate Manager by going to `Tools > Certificate Manager` and create a new Samsung certificate. See [this](https://developer.samsung.com/smarttv/develop/getting-started/setting-up-sdk/creating-certificates.html) for more information.

6. Now Run the project by right clicking on the project and clicking on `Run As > Tizen Web Application`.

7. Change the Host PC IP address to `127.0.0.1` by following [this](https://developer.samsung.com/smarttv/develop/getting-started/using-sdk/tv-device.html#Connecting-the-TV-and-SDK)

8. You can now launch the TizenBrew app on your TV.
5 changes: 4 additions & 1 deletion tizenbrew-updater/TizenBrewUpdater/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,15 @@

break;

case 13:
selectedItem.click();

}
};
</script>

<script>
var testWS = new WebSocket(`ws://127.0.0.1:8082`);
var testWS = new WebSocket(`ws://127.0.0.1:8083`);

testWS.onerror = () => {
var pkg_id = tizen.application.getCurrentApplication().appInfo.packageId;
Expand Down
10 changes: 6 additions & 4 deletions tizenbrew-updater/TizenBrewUpdater/js/wsClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let client;

window.connect = function() {
try {
client = new WebSocket(`ws://127.0.0.1:8082`);
client = new WebSocket(`ws://127.0.0.1:8083`);
client.onmessage = onMessage;
client.onopen = onOpen;
client.onerror = () => {
Expand Down Expand Up @@ -40,7 +40,9 @@ function onMessage(msg) {
break;
}
case 'connectedToDaemon': {
isTizen8 = document.getElementById('tizen8').checked;
if (!isTV) {
isTizen8 = document.getElementById('tizen8').checked;
}
document.getElementById('wsText').innerText = 'Connected to Daemon';
try {
if (isTV) {
Expand All @@ -49,7 +51,7 @@ function onMessage(msg) {
} else {
send({ type: 'isAppInstalled' })
}
} catch {
} catch(_) {
addButtons(false);
}
break;
Expand Down Expand Up @@ -120,5 +122,5 @@ window.manageTizenBrew = function(isUpdate) {
} else {
send({ type: 'installApp' });
}*/
send({ type: 'installApp', type: isTizen8 ? 'New' : 'Old' });
send({ type: 'installApp', installType: isTizen8 ? 'New' : 'Old' });
}
1 change: 1 addition & 0 deletions tizenbrew-updater/TizenBrewUpdater/service/filePush.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const AdbPacket = require('adbhost/lib/packet.js');
const commands = AdbPacket.commands;

module.exports = function (adb, path, fileName, data, cb) {
global.currentClient.send(JSON.stringify({ type: 'message', message: 'Pushing file...'}));
const shell = adb.createStream('sync:');
setTimeout(() => {
const statBuffer = new Buffer(8);
Expand Down
Loading

0 comments on commit 53d27c6

Please sign in to comment.