From e02503020f891581d18eb28371497f5f40a040f3 Mon Sep 17 00:00:00 2001 From: Roland Meyer Date: Wed, 18 Dec 2024 16:41:14 +0100 Subject: [PATCH] Updated changelog --- CHANGELOG.md | 15 ++++-- HTTPShortcuts/app/build.gradle.kts | 31 +++++++++-- .../app/src/main/assets/changelog.html | 52 +------------------ .../app/src/main/assets/docs/scripting.html | 5 +- 4 files changed, 41 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d830d9113..b72d6cef3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,16 @@ ## Version 3.21.0 ### Improvements +- Homescreen widgets can now be reconfigured without needing to be removed and re-added +- The size of the icon on home screen widgets can now be reduced - It is now possible to select whether IPv4 or IPv6 should be used for a shortcut's hostname (thanks [menendezeldemente](https://github.com/menendezeldemente)) +- You can now send simple HTTP requests directly from Scripting with the newly added `sendHttpRequest` function + +### Bugfixes +- The circle icon in the icon picker now has the correct aspect ratio + +### Miscellaneous +- The size of the app has been reduced ## Version 3.20.0 @@ -91,7 +100,7 @@ ### Bugfixes - Fixed a crash that would happen on some devices when deleting characters in Scripting fields or the cURL import -- Homescreen shortcuts are now properly disabled when the respective shortcut is deleted +- Home screen shortcuts are now properly disabled when the respective shortcut is deleted ## Version 3.13.0 @@ -329,7 +338,7 @@ A lot of things were added, changed and reworked in this version. It is very lik ### Removed - The app no longer supports different themes and instead just uses one default theme. -- It is no longer possible to use the homescreen's wallpaper as the background for a category. This has the advantage that the app no longer requires the permission to access the file system. +- It is no longer possible to use the home screen's wallpaper as the background for a category. This has the advantage that the app no longer requires the permission to access the file system. ## Version 2.31.0 @@ -1376,7 +1385,7 @@ as a call-to-action for translators. Help me translate everything! ## Version 1.10.1 -- Shortcuts are removed from homescreen when deleted in app +- Shortcuts are removed from home screen when deleted in app - Fixed a crash when saving shortcuts ## Version 1.10.0 diff --git a/HTTPShortcuts/app/build.gradle.kts b/HTTPShortcuts/app/build.gradle.kts index cf6d58cc3..041633f0b 100644 --- a/HTTPShortcuts/app/build.gradle.kts +++ b/HTTPShortcuts/app/build.gradle.kts @@ -340,8 +340,15 @@ dependencies { testImplementation(libs.kotlinx.coroutines.test) } -fun generateHtmlFromMarkdown(inputFile: String, outputFile: String, templateFile: String, mutate: String.() -> String = { this }) { +fun generateHtmlFromMarkdown( + inputFile: String, + outputFile: String, + templateFile: String, + processMarkdown: String.() -> String = { this }, + processHtml: String.() -> String = { this }, +) { val changelogMarkdown = File("../$inputFile").readText() + .processMarkdown() val template = File(templateFile).readText() val flavour = GFMFlavourDescriptor() val parsedTree = MarkdownParser(flavour).buildMarkdownTreeFromString(changelogMarkdown) @@ -349,7 +356,7 @@ fun generateHtmlFromMarkdown(inputFile: String, outputFile: String, templateFile .generateHtml() .removePrefix("") .removeSuffix("") - .mutate() + .processHtml() File("app/src/main/assets/$outputFile").writeText( template.replace("", html) ) @@ -357,12 +364,25 @@ fun generateHtmlFromMarkdown(inputFile: String, outputFile: String, templateFile tasks.register("syncChangeLog") { description = "copies the CHANGELOG.md file's content into the app so it can be displayed" + val maxSections = 10 doFirst { generateHtmlFromMarkdown( inputFile = "CHANGELOG.md", outputFile = "changelog.html", templateFile = "changelog_template.html", + processMarkdown = { + var sections = 0 + lineSequence() + .takeWhile { line -> + if (line.startsWith("## ")) { + sections++ + } + sections <= maxSections + } + .joinToString(separator = "\n") + .plus("\nFor older versions, check the [full changelog](https://github.com/Waboodoo/HTTP-Shortcuts/blob/develop/CHANGELOG.md).") + }, ) } } @@ -392,9 +412,10 @@ tasks.register("syncDocumentation") { inputFile = "docs/$fileName.md", outputFile = "docs/$fileName.html", templateFile = "documentation_template.html", - ) { - replace("src=\"../assets/documentation/", "src=\"file:///android_asset/docs/assets/") - } + processHtml = { + replace("src=\"../assets/documentation/", "src=\"file:///android_asset/docs/assets/") + }, + ) } } } diff --git a/HTTPShortcuts/app/src/main/assets/changelog.html b/HTTPShortcuts/app/src/main/assets/changelog.html index 178b80b74..fae3cfc09 100644 --- a/HTTPShortcuts/app/src/main/assets/changelog.html +++ b/HTTPShortcuts/app/src/main/assets/changelog.html @@ -39,56 +39,6 @@ -

Version 3.21.0

Improvements

Version 3.20.0

Improvements

Bugfixes

Miscellaneous

Version 3.19.0

Improvements

Miscellaneous

Version 3.18.0

Improvements

Bugfixes

Miscellaneous

Version 3.17.0

Improvements

Bugfixes

Miscellaneous

Version 3.16.0

Improvements

Bugfixes

Miscellaneous

Version 3.15.0

Improvements

Bugfixes

Version 3.14.0

Improvements

Bugfixes

Version 3.13.0

Improvements

Bugfixes

Miscellaneous

Version 3.12.1

Bugfixes

Version 3.12.0

Improvements

Bugfixes

Miscellaneous

Version 3.11.1

Bugfixes

Version 3.11.0

Improvements

Bugfixes

Miscellaneous

Version 3.10.0

Improvements

Bugfixes

Miscellaneous

Version 3.9.0

Improvements

Bugfixes

Miscellaneous

Version 3.8.0

Improvements

Miscellaneous

Version 3.7.0

Improvements

Bugfixes

Version 3.6.0

Improvements

Bugfixes

Version 3.5.0

Improvements

Bugfixes

Miscellaneous

Version 3.4.0

Improvements

Bugfixes

Miscellaneous

Version 3.3.0

Improvements

Bugfixes

Version 3.2.0

Improvements

Bugfixes

Miscellaneous

Version 3.1.0

Improvements

Bugfixes

Version 3.0.2

Bugfixes

Version 3.0.1

Improvements

Bugfixes

Version 3.0.0

A lot of things were added, changed and reworked in this version. It is very likely that new bugs were introduced or that things no longer work the same way they did before. If you encounter any issue, please let me know, either by contacting me (see the "Contact Developer" option on the Information screen) or by opening a GitHub issue.

Improvements

Bugfixes

Miscellaneous

Removed

Version 2.31.0

Improvements

Bugfixes

Miscellaneous

Version 2.30.0

Improvements

Bugfixes

Version 2.29.0

Improvements

Bugfixes

Miscellaneous

Version 2.28.0

Improvements

Bugfixes

Miscellaneous

Version 2.27.0

Improvements

Bugfixes

Miscellaneous

Version 2.26.0

Improvements

Bugfixes

Miscellaneous

Version 2.25.1

Bugfixes

Version 2.25.0

Improvements

Bugfixes

Miscellaneous

Version 2.24.0

Improvements

Bugfixes

Miscellaneous

Version 2.23.0

Improvements

Bugfixes

Miscellaneous

Version 2.22.0

Improvements

Bugfixes

Miscellaneous

Version 2.21.1

Improvements

Bugfixes

Miscellaneous

Version 2.21.0

Improvements

Bugfixes

Version 2.20.0

Variables

Scripting

Improvements

Bugfixes

Miscellaneous

Version 2.19.0

Scripting

Improvements

Bugfixes

Miscellaneous

Version 2.18.0

Scripting

Improvements

Bugfixes

Miscellaneous

Version 2.17.0

Improvements

Bugfixes

Version 2.16.0

Scripting

Improvements

Bugfixes

Version 2.15.1

Bugfixes

Version 2.15.0

Improvements

Bugfixes

Miscellaneous

Version 2.14.1

Bugfixes

Version 2.14.0

Custom Icons

The app now gives you more control over your custom icons. It now includes a new icon picker screen, which allows you to see all the icons you have used before and gives you the option to delete the ones you don't need anymore. In addition, you now have to open to download the favicon of a webpage and use that as the icon for your shortcut.

Improvements

Bugfixes

Version 2.13.1

Bugfixes

Version 2.13.0

This version includes a massive refactoring under the hood, so there's a good chance that some new bugs or small changes in behavior were introduced. Please let me know if you find something unusual.

Scripting

Bugfixes

Miscellaneous

Version 2.12.0

Miscellaneous

Bugfixes

Version 2.11.0

Scripting

response.headers and response.cookies now return a list of strings instead of just a string. This is a breaking change, but it allows handling the case where there are multiple headers or cookies with the same name.

For convenience, there is now a response.getHeader(headerName) and a response.getCookie(cookieName) function which can be used to retrieve a specific header or cookie by name. If there are multiple headers or cookies with the given name, the last one will be returned.

Bugfixes

Miscellaneous

Version 2.10.0

Important Changes

The minimum supported Android version is now at 5.0 (Lollipop). Going forward, older versions of Android will no longer receive updates. You can still install older versions of the app by downloading the APK directly from GitHub.

Furthermore, this version introduces a breaking change to the Scripting feature, specifically to the built-in hmac and base64decode functions. The return type of these functions is now Uint8Array (i.e., an array of bytes) instead of a hex string. See the Scripting section below for more information.

Scripting

Bugfixes:

Miscellaneous

Version 2.9.0

Improvements

Bugfixes

Miscellaneous

Version 2.8.0

Improvements

Bugfixes

Version 2.7.0

Improvements

Bugfixes

Version 2.6.0

Improvements

Bugfixes

Version 2.5.0

Miscellaneous

Bugfixes

Version 2.4.0

Important: Tasker Integration Overhaul

The integration with Tasker has been updated. It should now work more reliably, in particular in terms of passing around variables. -Unfortunately, this is a breaking change, so most likely you will need to re-configure your Tasker tasks, if you have any. Sorry for the inconvenience.

Miscellaneous

Bugfixes

Version 2.3.0

Client Certificate Authentication

There is now the option to configure a shortcut to use a client certificate for authentication. You'll find the option in the shortcut's Advanced Settings section.

Improved Import & Export

When exporting shortcuts and variables, the resulting file is now a ZIP file instead of a raw JSON file. This has the advantage that custom icons are now also exported and automatically become part of the exported bundle, and of course they can be imported again as well.

The Import and Export functionality was moved out of the general settings screen and into its own dedicated screen to make it easier to discover and use.

Miscellaneous

Bugfixes

Version 2.2.0

Miscellaneous

Bugfixes

Version 2.1.0

Miscellaneous

Bugfixes

Version 2.0.0

Response Handling

Scripting

Miscellaneous

Bugfixes

Version 1.39.0

Remote Editing

You can now edit your shortcuts and categories from the comfort of a desktop computer. Go to "Settings > Edit on Computer" to find out more.

Miscellaneous

Bugfixes

Version 1.38.0

Scripting Improvements

There is now a hash() action, which allows to apply MD5, SHA-1, SHA-256 and SHA-512.

Bugfixes

Version 1.37.0

Scripting Improvements

There is now a showSelection() action which allows showing a dialog of options to choose from, similar to the multiple-choice variable type.

Miscellaneous

Bugfixes

Version 1.36.0

Cookie Store

Shortcuts can now be configured to accept and store cookies via the "Advanced Technical Settings" section.

Miscellaneous

Version 1.35.0

Improved "Response Handling"

The "Response Handling" section of the shortcut editor was redesigned to allow for more -fine-grained control over how the HTTP response should be handled and displayed when a -shortcut is executed. For example, it is now possible to display a custom message instead of -the default "Shortcut executed." message.

Miscellaneous

Version 1.34.0

Miscellaneous

Bugfixes

Version 1.33.0

Scripting Improvements

Bugfixes

Version 1.32.0

Multi-Shortcuts

You can now create a special type of shortcut which allows you to easily trigger multiple -other shortcuts without having to write special code for it.

Scripting Improvements

There is now a special type of shortcut which makes it easier to write custom logic through -scripting without making an actual HTTP request. Additionally, it is now also easier to -set up scripting actions which interact with or modify other shortcuts (e.g. to trigger or -rename them or change their icon).

Miscellaneous

Bugfixes

Version 1.31.0

Miscellaneous

Bugfixes

Version 1.30.0

Widgets!

The app now has a (somewhat) customizable widget. This provides an alternative to regular -home screen shortcuts and has the benefit that they can be customized more freely (size, -label color, etc.).

Please note that this feature is in an early stage. More customization options will -come in a future release.

Miscellaneous

Bugfixes

Version 1.29.0

File Parameters

You can now add file parameters to your shortcuts, which allows to send one or multiple -files as part of a request. Triggering a shortcut with a file parameter will open a file -picker to select which file to send. Alternatively you can share a file from another app -to trigger a shortcut, similar to how it was already possible to share text values from -other apps to be used as a value for a variable.

Response Debugging

There is now an additional option for how to display the response of an HTTP request, which -displays the response body in a fullscreen window but also displays additional meta information -such as response headers, status code and the response time. This should make it easier to -set up or debug shortcuts.

User Interaction in Scripting

You can now use alert(), prompt() and confirm() as part of the scripting -feature to create flows that require user interaction. These 3 functions work the same way -as you'd expect from a browser.

Proxy Support

It is now possible to specify an HTTP proxy for each shortcut. Check the "Advanced Technical -Settings" section when creating or editing a shortcut.

Miscellaneous

Bugfixes

Version 1.28.0

Miscellaneous

Bugfixes

Version 1.27.0

Quick Settings Tile

The app now has a Quick Settings Tile, which can be used to trigger a shortcut without opening the app and without -going to the home screen. Simply enable the option for one or more shortcuts via the "Misc Settings" menu in the editor.

Dynamically change icons

There is now a new action "changeIcon" which can be used to change the icon of a shortcut before or after execution. So far -it only supports built-in icons.

Miscellaneous

Bugfixes

Version 1.26.0

Miscellaneous

Bugfixes

Version 1.25.0

Dark Mode

The app now has a dark theme. It can be enabled or disabled via the settings.

Miscellaneous

Bugfixes

Version 1.24.1

Bugfixes

Version 1.24.0

Redesigned Editor

The editor for creating and editing shortcuts was completely redesigned. The many different options are now separated -into their own screens to make the UI easier to navigate.

JavaScript Code Execution

Previously you were able to add specific actions to be executed before or after a shortcut runs. Now, instead of a static list -of actions, you can run arbitrary JavaScript code, which allows for much more flexibility and more advanced workflows. -On top of that, there are now 2 new actions that can be called directly from within the JavaScript code:

Miscellaneous

Bugfixes

Version 1.23.0

App Lock

It is now possible to lock the app with a password, to prevent modification of shortcuts or -app settings.

Require Confirmation

There is now a new option that allows you to mark a shortcut as requiring confirmation. -These shortcuts will prompt you with a confirmation dialog before executing, thereby -preventing accidental execution.

Miscellaneous

Bugfixes

Version 1.22.0

Shortcut Placement / Using in Other Apps

You may have encountered a problem when trying to use shortcuts in other apps (e.g. Tasker), -where it would not select or make the other app crash. There is now an alternative method of -selecting a shortcut that you may try in this case. Simply retry selecting the shortcut and -you will be prompted with a dialog that asks you to pick either the new or the old method.

Longer Timeouts

It is now possible to have request timeouts of up to 10 minutes.

Bugfixes

Version 1.21.0

Shortcut Actions

You can now define what happens before and after a shortcut is executed. This includes -things like displaying a Toast message, extracting part of the response or triggering -another shortcut. More to come in future updates!

Support for multipart/form-data

In addition to sending a custom request body and simple parameters, it is now also possible -to send form data, i.e, using the "multipart/form-data" content type.

Miscellaneous

Bugfixes

Version 1.20.0

Simplified Variable Insertion

Inserting variables into shortcuts has now become much easier. Each input field that -supports variables now has a button next to it. Clicking it opens a popup dialog with a list -of all available variables, allowing you to easily pick and insert one.

Improved Tasker Integration

When triggering shortcuts from Tasker, it is now possible to send along variables. Simply -define variables with the same name in Tasker as in your shortcut and their value will -automatically be sent from Tasker to your shortcut when triggered.

Drag & Drop Reordering

Categories & Variables, as well as options of select & toggle variables, can -now easily be reordered via drag & drop.

Improved Specification of Request Body

When specifying the request body of a shortcut, you now have the option to chose between x-www-form-urlencoded, -i.e., the body is a list of parameters, or custom text, i.e., you specify the request -body as raw text and give it a content-type.

Variables within Variables!

The constant, toggle and select variable types now support recursive -resolution of values. This means you can reference other variables from these variables. For -example, you could set up a select variable where one of the options is a -color variable.

Miscellaneous

Version 1.19.0

Version 1.18.0

Version 1.17.0

Version 1.16.0

Version 1.15.0

Version 1.14.0

Version 1.13.0

Version 1.12.0

Version 1.11.0

Version 1.10.1

Version 1.10.0

Version 1.9.2

Version 1.9.1

Version 1.8.0

Version 1.7.0

Version 1.6.1

Version 1.6.0

Version 1.5.0

Version 1.4.0

Version 1.2.0

Version 1.1.0

+

Version 3.21.0

Improvements

Bugfixes

Miscellaneous

Version 3.20.0

Improvements

Bugfixes

Miscellaneous

Version 3.19.0

Improvements

Miscellaneous

Version 3.18.0

Improvements

Bugfixes

Miscellaneous

Version 3.17.0

Improvements

Bugfixes

Miscellaneous

Version 3.16.0

Improvements

Bugfixes

Miscellaneous

Version 3.15.0

Improvements

Bugfixes

Version 3.14.0

Improvements

Bugfixes

Version 3.13.0

Improvements

Bugfixes

Miscellaneous

Version 3.12.1

Bugfixes

For older versions, check the full changelog.

diff --git a/HTTPShortcuts/app/src/main/assets/docs/scripting.html b/HTTPShortcuts/app/src/main/assets/docs/scripting.html index 88501d7f6..173b07b7c 100644 --- a/HTTPShortcuts/app/src/main/assets/docs/scripting.html +++ b/HTTPShortcuts/app/src/main/assets/docs/scripting.html @@ -227,8 +227,7 @@

For this function to work, location services need to be enabled and the app needs to be granted the permission to access the device's location. This is a technical limitation imposed by the Android OS. See also the Permissions page for details.

Wake-on-LAN

You can use the wakeOnLan function to send a magic packet to turn on another device on your network. The first parameter has to be the MAC-address of the device. As the optional second parameter, you can pass the network/broadcast address to be used, and as the third parameter you can define the port.

wakeOnLan('01-23-45-67-89-ab');
 
 wakeOnLan('01-23-45-67-89-ab', '255.255.255.255', 9);
-

Send HTTP request

The sendHttpRequest function allows you to send a simple HTTP request. The first parameter is the URL, the second (optional) parameter provides additional options. Currently, the only supported is "method", which is used to set the HTTP method. -The function returns an object which includes a status field, which has the value "success", "httpError" or "networkError". If it is "networkError", you can check the field networkError for details. Otherwise, you can check the response field for the HTTP response.

If you need more options, consider creating a dedicated HTTP Shortcut for your request and invoking it using #trigger-shortcut or #execute-shortcut instead.

const result = sendHttpRequest(
+

Send HTTP request

The sendHttpRequest function allows you to send a simple HTTP request. The first parameter is the URL, the second (optional) parameter provides additional options. Currently, the only supported option is "method", which is used to set the HTTP method.

The function returns an object which includes a status field, which has the value "success", "httpError" or "networkError". If it is "networkError", you can check the field networkError for details. Otherwise, you can check the response field for the HTTP response object. It includes fields body, headers, cookies and statusCode.

If you need more options, consider creating a dedicated HTTP Shortcut for your request and invoking it using enqueueShortcut or executeShortcut instead.

const result = sendHttpRequest(
   "https://example.com",
   {
     method: "POST",
@@ -240,7 +239,7 @@
 } else if (result.status == "httpError") {
   alert("Failed with status code " + result.response.statusCode);
 } else {
-  alert("Failed with network error: " + result.networkError;
+  alert("Failed with network error: " + result.networkError);
 }
 

Send MQTT message

The sendMqttMessages function allows you to connect to an MQTT broker, send (i.e. publish) one or more messages to it, and then disconnect again. The first parameter is the URI of the server/broker, the second (optional) parameter provides options for the connection (e.g. username and password) and the third parameter is a list of all the messages that should be sent.

sendMQTTMessages(
   "tcp://192.168.0.42:1234",