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 iOS support #757

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c357dff
it launches but server crashes
ImUrX Jun 19, 2023
d1956ec
start iOS support
ImUrX Jun 18, 2023
4e88b42
it launches but server crashes
ImUrX Jun 19, 2023
75ec5d6
apply spotless
ImUrX Jun 19, 2023
a3b6f95
fix some gradle shenanigans
ImUrX Jun 19, 2023
d7086b4
update to new snapshot
ImUrX Jun 20, 2023
9e9a430
make `SerialHandler`'s implementation platform-dependant
ImUrX Jun 22, 2023
fe46352
Use an Android 24 compatible jackson
ImUrX Jun 22, 2023
6110127
make ios look good
ImUrX Jun 22, 2023
113308c
ok no soft link then
ImUrX Jun 22, 2023
beeb454
dont use maven local
ImUrX Jul 8, 2023
c2431ec
oops solarxr
ImUrX Jul 30, 2023
6bf66da
spotless
ImUrX Jul 30, 2023
3bf4e46
include android
ImUrX Jul 30, 2023
6a479f5
Merge branch 'main' into ios-subproject
ImUrX Aug 1, 2023
e5f22fa
Merge branch 'main' into ios-subproject
ImUrX Aug 3, 2023
5eaf628
Merge branch 'main' into ios-subproject
ImUrX Aug 6, 2023
fe2c6a8
fix mixed indentation
ImUrX Aug 9, 2023
f28a356
Merge branch 'main' into ios-subproject
ImUrX Aug 13, 2023
5d79eab
Merge branch 'main' into ios-subproject
ImUrX Aug 15, 2023
3640f0c
Merge branch 'main' into ios-subproject
ImUrX Aug 31, 2023
8325489
Merge branch 'main' into ios-subproject
ImUrX Sep 17, 2023
c52a8b5
Merge branch 'main' into ios-subproject
ImUrX Sep 23, 2023
a264349
Fix problem with new xcode 15
ImUrX Sep 25, 2023
07334c0
Add reflections
ImUrX Sep 25, 2023
36bc4ed
make webview open on root instead of index.html
ImUrX Sep 25, 2023
d37a9ac
spotless apply
ImUrX Sep 25, 2023
5bb8080
Merge branch 'main' into ios-subproject
ImUrX Sep 25, 2023
a229ad9
Merge branch 'main' into ios-subproject
ImUrX Sep 26, 2023
c8b5493
Merge branch 'main' into ios-subproject
ImUrX Apr 5, 2024
e2f2c31
Merge branch 'main' into ios-subproject
ImUrX May 10, 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
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ spotlessVersion=6.25.0
shadowJarVersion=8.1.1
buildconfigVersion=5.3.5
grgitVersion=5.2.2
robovmVersion=10.2.2.2-SNAPSHOT
116 changes: 116 additions & 0 deletions gui/src-tauri/icons/ios/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"images" : [
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "AppIcon-20x20@2x 1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "AppIcon-83.5x83.5@2x 1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "AppIcon-512@2x 1.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "1x",
"size" : "20x20"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
1 change: 1 addition & 0 deletions gui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function i18nHotReload(): PluginOption {

// https://vitejs.dev/config/
export default defineConfig({
base: "./",
define: {
__COMMIT_HASH__: JSON.stringify(commitHash),
__VERSION_TAG__: JSON.stringify(versionTag),
Expand Down
5 changes: 3 additions & 2 deletions server/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ dependencies {
// and not exposed to consumers on their own compile classpath.
implementation("com.google.flatbuffers:flatbuffers-java:22.10.26")
implementation("commons-cli:commons-cli:1.5.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.1")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.1")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.5")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.5")
Comment on lines +58 to +59
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the rollback in version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i dmed you about this, its the use of some reflection that robovm didnt support


implementation("com.github.jonpeterson:jackson-module-model-versioning:1.2.2")
implementation("org.apache.commons:commons-math3:3.6.1")
Expand All @@ -68,6 +68,7 @@ dependencies {
implementation("com.melloware:jintellitype:1.+")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
implementation("it.unimi.dsi:fastutil:8.5.12")
implementation(kotlin("reflect"))

testImplementation(kotlin("test"))
// Use JUnit test framework
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package dev.slimevr.status

import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
import it.unimi.dsi.fastutil.ints.IntOpenHashSet
import solarxr_protocol.rpc.StatusDataUnion
import solarxr_protocol.rpc.StatusMessageT
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.atomic.AtomicInteger

class StatusSystem {
private val listeners: MutableList<StatusListener> = CopyOnWriteArrayList()
private val statuses: MutableMap<Int, StatusDataUnion> = Int2ObjectOpenHashMap()
private val prioritizedStatuses: MutableSet<Int> = IntOpenHashSet()
private val statuses: MutableMap<Int, StatusDataUnion> = HashMap()
private val prioritizedStatuses: MutableSet<Int> = HashSet()
private val idCounter = AtomicInteger(1)

fun addListener(listener: StatusListener) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import io.github.axisangles.ktmath.Quaternion.Companion.fromRotationVector
import io.github.axisangles.ktmath.Vector3
import org.apache.commons.lang3.ArrayUtils
import solarxr_protocol.rpc.ResetType
import java.io.IOException
import java.net.DatagramPacket
import java.net.DatagramSocket
import java.net.InetSocketAddress
Expand Down Expand Up @@ -257,7 +258,12 @@ class TrackersUDPServer(private val port: Int, name: String, private val tracker
bb.limit(bb.capacity())
bb.rewind()
parser.write(bb, conn, UDPPacket1Heartbeat)
socket.send(DatagramPacket(rcvBuffer, bb.position(), conn.address))

try {
socket.send(DatagramPacket(rcvBuffer, bb.position(), conn.address))
} catch (e: IOException) {
LogManager.warning("[TrackerServer] Failed to send package to $conn", e)
}
if (conn.lastPacket + 1000 < System.currentTimeMillis()) {
if (!conn.timedOut) {
conn.timedOut = true
Expand Down Expand Up @@ -295,7 +301,11 @@ class TrackersUDPServer(private val port: Int, name: String, private val tracker
bb.putInt(10)
bb.putLong(0)
bb.putInt(conn.lastPingPacketId)
socket.send(DatagramPacket(rcvBuffer, bb.position(), conn.address))
try {
socket.send(DatagramPacket(rcvBuffer, bb.position(), conn.address))
} catch (e: IOException) {
LogManager.warning("[TrackerServer] Failed to send package to $conn", e)
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions server/ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
robovm-build
52 changes: 52 additions & 0 deletions server/ios/Info.plist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${app.name}</string>
<key>CFBundleExecutable</key>
<string>${app.executable}</string>
<key>CFBundleIdentifier</key>
<string>${app.id}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${app.name}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${app.version}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${app.build}</string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UILaunchStoryboardName</key>
<string>Launch Screen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
47 changes: 47 additions & 0 deletions server/ios/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
plugins {
`java-library`
id("robovm")
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

allprojects {
repositories {
mavenCentral()
// mavenLocal()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
}
}

dependencies {
val robovmVersion = rootProject.properties["robovmVersion"] as String

implementation(project(":server:core"))
implementation("com.robovmx:robovm-rt:$robovmVersion")
implementation("com.robovmx:robovm-cocoatouch:$robovmVersion")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.5")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.5")
implementation("org.slf4j:slf4j-simple:2.0.7")
}

tasks.launchIPhoneSimulator {
dependsOn(tasks.build)
}
tasks.launchIPadSimulator {
dependsOn(tasks.build)
}
tasks.launchIOSDevice {
dependsOn(tasks.build)
}
tasks.robovmArchive {
dependsOn(tasks.build)
}

robovm {
isIosSkipSigning = true
}
26 changes: 26 additions & 0 deletions server/ios/resources/Base.lproj/Launch Screen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
<color key="backgroundColor" red="0.054901964960000001" green="0.109803915" blue="0.18039217590000001" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading