From 568c293a3c661ac29e664083a3d110d6026ed626 Mon Sep 17 00:00:00 2001 From: Memphiz Date: Fri, 1 Mar 2019 17:35:09 +0100 Subject: [PATCH 1/4] [ios/signing] - added old ldid for 32bit for fixing fake signing for 32 bit builds --- tools/darwin/Support/Codesign.command | 11 +++++++++- tools/depends/native/ldid-native/Makefile | 25 +++++++++++++++-------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/tools/darwin/Support/Codesign.command b/tools/darwin/Support/Codesign.command index 65b823c63ac8a..84ff08fe885d5 100755 --- a/tools/darwin/Support/Codesign.command +++ b/tools/darwin/Support/Codesign.command @@ -9,7 +9,16 @@ export CODESIGN_ALLOCATE=`xcodebuild -find codesign_allocate` GEN_ENTITLEMENTS="$NATIVEPREFIX/bin/gen_entitlements.py" IOS11_ENTITLEMENTS="$XBMC_DEPENDS/share/ios11_entitlements.xml" -LDID="$NATIVEPREFIX/bin/ldid" +LDID32="$NATIVEPREFIX/bin/ldid32" +LDID64="$NATIVEPREFIX/bin/ldid64" +LDID=${LDID32} + +if [ "${CURRENT_ARCH}" == "arm64" ]; then + LDID=${LDID64} + echo "using LDID64" +else + echo "using LDID32" +fi if [ ! -f ${GEN_ENTITLEMENTS} ]; then echo "error: $GEN_ENTITLEMENTS not found. Codesign won't work." diff --git a/tools/depends/native/ldid-native/Makefile b/tools/depends/native/ldid-native/Makefile index 36149b47c3787..970b4cccb3a2f 100644 --- a/tools/depends/native/ldid-native/Makefile +++ b/tools/depends/native/ldid-native/Makefile @@ -5,21 +5,30 @@ DEPS= ../../Makefile.include Makefile # lib name, version LIBNAME=ldid -VERSION=2 -SOURCE=$(LIBNAME)-$(VERSION) -ARCHIVE=$(SOURCE).tar.gz +VERSION32=1.0.0 +VERSION64=2 +SOURCE32=$(LIBNAME)-$(VERSION32) +SOURCE64=$(LIBNAME)-$(VERSION64) +ARCHIVE32=$(SOURCE32).tar.gz +ARCHIVE64=$(SOURCE64).tar.gz all: .installed-$(PLATFORM) -$(TARBALLS_LOCATION)/$(ARCHIVE): - cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) +$(TARBALLS_LOCATION)/$(ARCHIVE32): + cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE32) -$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) +$(TARBALLS_LOCATION)/$(ARCHIVE64): + cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE64) + +$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE32) $(TARBALLS_LOCATION)/$(ARCHIVE64) $(DEPS) rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) + cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE32) + mv $(PLATFORM)/ldid $(PLATFORM)/ldid32 + cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE64) + mv $(PLATFORM)/ldid $(PLATFORM)/ldid64 .installed-$(PLATFORM):$(PLATFORM) - cp $(PLATFORM)/ldid $(NATIVEPREFIX)/bin + cp $(PLATFORM)/ldid* $(NATIVEPREFIX)/bin touch $@ clean: From 1a39aff069cce20acb026699afcec2a359fb5413 Mon Sep 17 00:00:00 2001 From: Memphiz Date: Sat, 2 Mar 2019 10:42:32 +0100 Subject: [PATCH 2/4] =?UTF-8?q?Revert=20"[ios/WinSystem]=20-=20instead=20o?= =?UTF-8?q?f=20using=20the=20eaglbounds=20for=20determining=20the=20size?= =?UTF-8?q?=20of=20the=20internal=20screen=20-=20simply=20use=20the=20scer?= =?UTF-8?q?ensize=20from=20UIScreen=20and=20exchange=20width=20with=20heig?= =?UTF-8?q?ht=20(because=20the=20screen=20is=20installed=2090=C2=B0=20rota?= =?UTF-8?q?ted).=20This=20fixes=20traversing=20back=20from=20external=20to?= =?UTF-8?q?=20internal=20screen=20which=20resulted=20in=20getting=20the=20?= =?UTF-8?q?eaglbounds=20from=20the=20external=20screen=20*=20screenscale?= =?UTF-8?q?=20from=20the=20internal=20(and=20lead=20to=20non-working=20tou?= =?UTF-8?q?ch=20input)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit acf176f49cd1cd75a1cb51d56c12d049d17ec225. --- xbmc/windowing/osx/WinSystemIOS.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xbmc/windowing/osx/WinSystemIOS.mm b/xbmc/windowing/osx/WinSystemIOS.mm index 7f849ba31282c..3202551c1f6da 100644 --- a/xbmc/windowing/osx/WinSystemIOS.mm +++ b/xbmc/windowing/osx/WinSystemIOS.mm @@ -237,14 +237,13 @@ - (void) runDisplayLink; *h = firstMode.size.height; } - //for mainscreen exchange w and h + //for mainscreen use the eagl bounds //because mainscreen is build in //in 90° rotated if(screenIdx == 0) { - int tmp = *w; - *w = *h; - *h = tmp; + *w = [g_xbmcController getScreenSize].width; + *h = [g_xbmcController getScreenSize].height; } CLog::Log(LOGDEBUG,"Current resolution Screen: %i with %i x %i",screenIdx, *w, *h); return true; From a1e187db7b53f01aaf09194f8b89368341d2d52a Mon Sep 17 00:00:00 2001 From: Memphiz Date: Sat, 2 Mar 2019 20:57:26 +0100 Subject: [PATCH 3/4] [ios/windowing] - cache internal touch screen resolution because when going from external to internal screen - display settings want to know these before actually switching to internal. As we rely on eaglbounds we can't tell the internal resolution before switching - so we have to give back the cached results. - fixes touch screen issues due to wrong resolution for older ios9 32bit devices like ipad2 - while still maintaining the fix for external screens --- xbmc/windowing/osx/WinSystemIOS.h | 2 ++ xbmc/windowing/osx/WinSystemIOS.mm | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/xbmc/windowing/osx/WinSystemIOS.h b/xbmc/windowing/osx/WinSystemIOS.h index d29cc13b5b689..53827ef60d08f 100644 --- a/xbmc/windowing/osx/WinSystemIOS.h +++ b/xbmc/windowing/osx/WinSystemIOS.h @@ -85,5 +85,7 @@ class CWinSystemIOS : public CWinSystemBase, public CRenderSystemGLES void FillInVideoModes(int screenIdx); bool SwitchToVideoMode(int width, int height, double refreshrate); CADisplayLinkWrapper *m_pDisplayLink; + int m_internalTouchscreenResolutionWidth = -1; + int m_internalTouchscreenResolutionHeight = -1; }; diff --git a/xbmc/windowing/osx/WinSystemIOS.mm b/xbmc/windowing/osx/WinSystemIOS.mm index 3202551c1f6da..f077304de847c 100644 --- a/xbmc/windowing/osx/WinSystemIOS.mm +++ b/xbmc/windowing/osx/WinSystemIOS.mm @@ -228,6 +228,7 @@ - (void) runDisplayLink; *w = screenSize.width; *h = screenSize.height; *fps = 0.0; + //if current mode is 0x0 (happens with external screens which aren't active) //then use the preferred mode if(*h == 0 || *w ==0) @@ -236,14 +237,27 @@ - (void) runDisplayLink; *w = firstMode.size.width; *h = firstMode.size.height; } - - //for mainscreen use the eagl bounds - //because mainscreen is build in - //in 90° rotated + + // for mainscreen use the eagl bounds from xbmcController + // because mainscreen is might be 90° rotate dependend on + // the device and eagl gives the correct values in all cases. if(screenIdx == 0) { - *w = [g_xbmcController getScreenSize].width; - *h = [g_xbmcController getScreenSize].height; + // at very first start up we cache the internal screen resolution + // because when using external screens and need to go back + // to internal we are not able to determine the eagl bounds + // before we really switched back to internal + // but display settings ask for the internal resolution before + // switching. So we give the cached values back in that case. + if (m_internalTouchscreenResolutionWidth == -1 && + m_internalTouchscreenResolutionHeight == -1) + { + m_internalTouchscreenResolutionWidth = [g_xbmcController getScreenSize].width; + m_internalTouchscreenResolutionHeight = [g_xbmcController getScreenSize].height; + } + + *w = m_internalTouchscreenResolutionWidth; + *h = m_internalTouchscreenResolutionHeight; } CLog::Log(LOGDEBUG,"Current resolution Screen: %i with %i x %i",screenIdx, *w, *h); return true; From 6d8502211f03ab8df1407819c9fe4bd67354067d Mon Sep 17 00:00:00 2001 From: Memphiz Date: Sun, 3 Mar 2019 16:17:32 +0100 Subject: [PATCH 4/4] [ios/cmake] - ensure that CURRENT_ARCH is set by cmake when calling Codesing.command --- cmake/scripts/ios/Install.cmake | 1 + tools/darwin/Support/Codesign.command | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/scripts/ios/Install.cmake b/cmake/scripts/ios/Install.cmake index 7d8de72b9c922..7668e7cf2c162 100644 --- a/cmake/scripts/ios/Install.cmake +++ b/cmake/scripts/ios/Install.cmake @@ -82,6 +82,7 @@ add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD "BUILT_PRODUCTS_DIR=$/.." "WRAPPER_NAME=${APP_NAME}.app" "APP_NAME=${APP_NAME}" + "CURRENT_ARCH=${ARCH}" ${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign.command ) diff --git a/tools/darwin/Support/Codesign.command b/tools/darwin/Support/Codesign.command index 84ff08fe885d5..1265000f8e368 100755 --- a/tools/darwin/Support/Codesign.command +++ b/tools/darwin/Support/Codesign.command @@ -13,7 +13,7 @@ LDID32="$NATIVEPREFIX/bin/ldid32" LDID64="$NATIVEPREFIX/bin/ldid64" LDID=${LDID32} -if [ "${CURRENT_ARCH}" == "arm64" ]; then +if [ "${CURRENT_ARCH}" == "arm64" ] || [ "${CURRENT_ARCH}" == "aarch64" ]; then LDID=${LDID64} echo "using LDID64" else