Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commands to rekey device and create packages #509

Merged
merged 30 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
52c6de5
Add ability to capture device screenshots
fumer-fubotv Oct 9, 2023
a564c7b
Add ability to capture device screenshots
fumer-fubotv Oct 9, 2023
323c4f1
Merge branch 'master' into ROKU-1008
fumer-fubotv Oct 9, 2023
ab5629e
Feature request: add ability to rekey/sign apps
fumer-fubotv Oct 13, 2023
a83dc75
Conflict resoluiton
fumer-fubotv Oct 13, 2023
273d71c
remove stale code
fumer-fubotv Oct 13, 2023
53ee647
remove redundent code
fumer-fubotv Oct 13, 2023
01b9ac6
TBD-126
fumer-fubotv Oct 20, 2023
b83a203
TBD-126
fumer-fubotv Oct 27, 2023
1a1320e
Update BrightScriptCommands.ts
fumer-fubotv Oct 27, 2023
ddb09fc
Merge branch 'master' of https://github.com/rokucommunity/vscode-brig…
TwitchBronBron Nov 8, 2023
6aed36a
Refined the flow a bit
TwitchBronBron Jan 29, 2024
ac5dc9b
Merge branch 'master' of https://github.com/rokucommunity/vscode-brig…
TwitchBronBron Jan 29, 2024
7255903
TBD-126:
fumer-fubotv Feb 6, 2024
c000830
Merge branch 'master' into TBD-126
TwitchBronBron Feb 6, 2024
af5fb8b
TBD-126
fumer-fubotv Feb 8, 2024
cc1d493
Merge branch 'TBD-126' of https://github.com/rokucommunity/vscode-bri…
fumer-fubotv Feb 8, 2024
18ffa58
TBD-126
fumer-fubotv Feb 12, 2024
b4c9e93
Merge branch 'master' into TBD-126
fumer-fubotv Feb 13, 2024
7e4d3bb
Update RekeyAndPackageCommand.ts
fumer-fubotv Feb 14, 2024
f1d28ed
Merge branch 'TBD-126' of https://github.com/rokucommunity/vscode-bri…
fumer-fubotv Feb 14, 2024
a9f1f6b
TBD-126
fumer-fubotv Feb 16, 2024
804c139
Use `open` to open folder instead of custom function
TwitchBronBron Mar 12, 2024
c131512
Normalize a few file paths
TwitchBronBron Mar 12, 2024
d947737
Better rekeySignedPackage handling when empty string
TwitchBronBron Mar 12, 2024
efabd97
simplify default config
TwitchBronBron Mar 12, 2024
b0ddb52
Show .pkg in summary
TwitchBronBron Mar 12, 2024
63d251c
Use correct file paths in more dialogs
TwitchBronBron Mar 12, 2024
2f75871
Merge branch 'master' of https://github.com/rokucommunity/vscode-brig…
TwitchBronBron Mar 12, 2024
c65fa35
Remove unused funcs in BrightScriptCommands.ts
TwitchBronBron Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@
"onCommand:extension.brightscript.sendRemoteText",
"onCommand:brighterscript.showPreview",
"onCommand:brighterscript.showPreviewToSide",
"onCommand:extension.brightscript.captureScreenshot"
"onCommand:extension.brightscript.captureScreenshot",
"onCommand:extension.brightscript.rekeyDevice",
"onCommand:extension.brightscript.createPackage",
"onCommand:extension.brightscript.rekeyAndPackage"
],
"contributes": {
"viewsContainers": {
Expand Down Expand Up @@ -2821,6 +2824,21 @@
"category": "BrighterScript",
"icon": "./images/icons/inspect-active.svg"
},
{
"command": "extension.brightscript.rekeyDevice",
"title": "Rekey Device",
"category": "BrightScript"
},
{
"command": "extension.brightscript.createPackage",
"title": "Create Package",
"category": "BrightScript"
},
{
"command": "extension.brightscript.rekeyAndPackage",
"title": "Rekey Device and Create Package",
"category": "BrightScript"
},
{
"command": "extension.brightscript.captureScreenshot",
"title": "Capture Screenshot",
Expand Down
53 changes: 49 additions & 4 deletions src/BrightScriptCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import BrightScriptFileUtils from './BrightScriptFileUtils';
import { GlobalStateManager } from './GlobalStateManager';
import { brighterScriptPreviewCommand } from './commands/BrighterScriptPreviewCommand';
import { captureScreenshotCommand } from './commands/CaptureScreenshotCommand';
import { rekeyAndPackageCommand } from './commands/RekeyAndPackageCommand';
import { languageServerInfoCommand } from './commands/LanguageServerInfoCommand';
import { util } from './util';
import { util as rokuDebugUtil } from 'roku-debug/dist/util';
Expand Down Expand Up @@ -37,6 +38,7 @@ export class BrightScriptCommands {
brighterScriptPreviewCommand.register(this.context);
languageServerInfoCommand.register(this.context);
captureScreenshotCommand.register(this.context, this);
rekeyAndPackageCommand.register(this.context, this, this.userInputManager);

this.registerGeneralCommands();

Expand Down Expand Up @@ -391,13 +393,13 @@ export class BrightScriptCommands {
}
}

public async getRemoteHost() {
public async getRemoteHost(showPrompt = true) {
this.host = await this.context.workspaceState.get('remoteHost');
if (!this.host) {
let config = vscode.workspace.getConfiguration('brightscript.remoteControl', null);
this.host = config.get('host');
// eslint-disable-next-line no-template-curly-in-string
if (!this.host || this.host === '${promptForHost}') {
if ((!this.host || this.host === '${promptForHost}') && showPrompt) {
this.host = await vscode.window.showInputBox({
placeHolder: 'The IP address of your Roku device',
value: ''
Expand All @@ -420,13 +422,13 @@ export class BrightScriptCommands {
return this.host;
}

public async getRemotePassword() {
public async getRemotePassword(showPrompt = true) {
this.password = await this.context.workspaceState.get('remotePassword');
if (!this.password) {
let config = vscode.workspace.getConfiguration('brightscript.remoteControl', null);
this.password = config.get('password');
// eslint-disable-next-line no-template-curly-in-string
if (!this.password || this.password === '${promptForPassword}') {
if ((!this.password || this.password === '${promptForPassword}') && showPrompt) {
this.password = await vscode.window.showInputBox({
placeHolder: 'The developer account password for your Roku device',
value: ''
Expand Down Expand Up @@ -458,6 +460,49 @@ export class BrightScriptCommands {
return this.workspacePath;
}

public async getSigningPassword(showPrompt = true): Promise<string> {
let signingPassword = '';
signingPassword = await this.context.workspaceState.get('signingPassword');
if (!signingPassword) {
let config = vscode.workspace.getConfiguration('brightscript.remoteControl', null);
signingPassword = config.get('signingPassword');
// eslint-disable-next-line no-template-curly-in-string
if (!signingPassword && showPrompt) {
signingPassword = await vscode.window.showInputBox({
placeHolder: 'Enter the signing password used for creating signed packages',
value: ''
});
}
}
if (!signingPassword) {
throw new Error('Can\'t send command: signingPassword is required.');
} else {
await this.context.workspaceState.update('signingPassword', signingPassword);
return signingPassword;
}
}

public async getSignedPackagePath() {
let signedPackagePath = await this.context.workspaceState.get('signedPackagePath');
if (!signedPackagePath) {
let config = vscode.workspace.getConfiguration('brightscript.remoteControl', null);
signedPackagePath = config.get('signedPackagePath');
// eslint-disable-next-line no-template-curly-in-string
if (!signedPackagePath) {
signedPackagePath = await vscode.window.showInputBox({
placeHolder: 'Enter the path for the signed package',
value: ''
});
}
}
if (!signedPackagePath) {
throw new Error('Can\'t send command: Signed Package Path is required.');
} else {
await this.context.workspaceState.update('signedPackagePath', signedPackagePath);
return signedPackagePath;
}
}

public registerKeypressNotifier(notifier: (key: string, literalCharacter: boolean) => void) {
this.keypressNotifiers.push(notifier);
}
Expand Down
Loading