Skip to content

Commit

Permalink
fix: minor fixes, clarify upgrade procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed May 14, 2024
1 parent 086524d commit 38ccda5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId = "com.octo4a"
minSdk = 17
targetSdk = 28
versionName = "1.2.6"
versionCode = 1002006
versionName = "1.3.0"
versionCode = 1003000
multiDexEnabled = true

ndk {
Expand Down
17 changes: 6 additions & 11 deletions app/app/src/main/java/com/octo4a/repository/BootstrapRepository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,14 @@ class BootstrapRepositoryImpl(
runCommand("ls").waitAndPrintOutput(logger)
logger.log(this) { "Bootstrap extracted, setting it up..." }

// if (shouldUsePre5Bootstrap()) {
// runCommand(
// "rm -r root && mv root-pre5 root",
// prooted = false
// ).waitAndPrintOutput(logger)
// }

runCommand("cp -r /home/octoprint/extensions /mnt/external/extensions").waitAndPrintOutput(
runCommand("chmod -R 755 /mnt/external/").waitAndPrintOutput(
logger
)
runCommand("chmod -R 755 /mnt/external/").waitAndPrintOutput(

runCommand("cp -rf /home/octoprint/extensions /mnt/external/").waitAndPrintOutput(
logger
)

runCommand("chown root:root /mnt/external/").waitAndPrintOutput(
logger
)
Expand Down Expand Up @@ -225,8 +220,8 @@ class BootstrapRepositoryImpl(
logger.log(this) {filesPath}
pb.environment()["EXTRA_BIND"] =
"-b ${filesPath}:/mnt/external -b /data/data/com.octo4a/files/serialpipe:/dev/ttyOcto4a"
pb.environment()["PATH"] =
"/sbin:/system/sbin:/product/bin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin"
// pb.environment()["PATH"] =
// "/sbin:/system/sbin:/product/bin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin"
pb.directory(File("$FILES/bootstrap"))
var user = "root"
if (!root) user = "octoprint"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import io.ktor.http.*

data class GithubAsset(val name: String, val url: String, val browserDownloadUrl: String)

data class GithubRelease(val tagName: String, val zipballUrl: String, val body: String, val assets: List<GithubAsset>, val htmlUrl: String, val name: String)
data class GithubRelease(val tagName: String, val zipballUrl: String, val body: String, val assets: List<GithubAsset>, val htmlUrl: String, val name: String, val prerelease: Boolean)

interface GithubRepository {
suspend fun getNewestRelease(repository: String): GithubRelease
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ class InstallationViewModel(context: Application, private val octoPrintHandlerRe
withIO {
try {
// Fetch releases from octo4a-bootstrap-builder
val newestReleases = githubRepository.getNewestReleases("feelfreelinux/octo4a-bootstrap-builder")
val newestReleases = githubRepository.getNewestReleases("feelfreelinux/octo4a-bootstrap-builder").filter { !it.prerelease }
_bootstrapReleases.value = newestReleases

// TODO: handle this with picker
bootstrapRepository.selectReleaseForInstallation(newestReleases.first())
} catch (e: Exception) {
e.printStackTrace()
Expand Down
2 changes: 1 addition & 1 deletion app/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<string name="disable_battery_optimization_msg">For stability reasons it is necessary to disable battery optimizations for this app in the system settings</string>
<string name="legacy_bootstrap">Legacy installation detected</string>
<string name="pre1_legacy_bootstrap_msg">Upgrading from legacy releases is not supported. Proceeding with installation will delete all existing octoprint data.</string>
<string name="legacy_bootstrap_msg">Upgrading from legacy releases is not supported. Proceeding with installation will delete all existing octoprint data.</string>
<string name="legacy_bootstrap_msg">Upgrading from a legacy release will require a reinstall of previously-installed plugins. All other data and configuration should be kept intact. Alternatively, you can downgrade to octo4a 1.2.6, and prepare a backup in OctoPrint\'s settings.</string>
<string name="clear_and_install">Clear data</string>
<string name="status_shutting_down">OctoPrint is shutting down…</string>
<string name="status_shutting_down_subtitle">this could take a couple of seconds</string>
Expand Down

0 comments on commit 38ccda5

Please sign in to comment.