You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3944462 by Jack.Porter Prevent TVOS packaging from PC from attempting to build an asset catalog #jira UE-56114 Change 3943602 by Leslie.Nivison Adding licenses for additional TPS #jira none Change 3943597 by Leslie.Nivison Adding Enterprise licenses; licenses for additional TPS. #jira none Change 3941962 by Leslie.Nivison Updating 4.19 credit list #jira none Change 3941865 by Mark.Satterthwaite Fix the incorrect landscape rendering and the incorrect render-to-texture from blueprint bugs with MetalRHI. - Track outstanding AsyncCopyBufferFromBufferToBuffer operations to identify attempts to modify overlapping ranges within the same prologue command-buffer. This doesn't work and requires that we break the current render-pass and issue on the current command-buffer. A log warning will be emitted when this occurs. - Don't attempt to alias private memory buffers the moment they are released from the RHI resource because that can lead to incorrect sharing of the memory when used by AsyncCopyBufferFromBufferToBuffer. #jira UE-56021 Change 3940993 by Marc.Audy Do not return the last column if the specified column does not exist. Allow display names to be used when looking for a property if the table is backed by a user defined struct. Do not crash if a property with the given name is not found. #jira UE-56017 Change 3939179 by Ben.Marsh Revert change to not poison memory in development configuration. Making a tradeoff that editor stability and consistency is more important than performance. #jira Change 3938566 by Aaron.McLeran #jira UE-55940 Fix for wavetable synth Missed a case. Change 3938533 by Dan.Oconnor Fix uninitialized variable exposed by recent MallocTBB change #jira UE-56013 Change 3938508 by Aaron.McLeran Fixing CIS error, init order issues. #jira UE-55940 Change 3938490 by Aaron.McLeran #jira UE-55940 Fix for wavetable synth Change 3938352 by josh.jensen Show an error message for Windows iOS builds when packaging/launching and icons are present but no remote Mac is specified #jira UE-55987 Change 3938345 by Peter.Sauerbrei fix to Icons not being built on Mac #jira UE-53492 Change 3938305 by Mark.Satterthwaite For whatever reason moving the buffer initialisation into the prologue command buffer doesn't work - this make absolutely no sense to me. I suspect that this is *merely* moving a render pass boundary around somewhere and forcing raster-state to be reapplied. #jira UE-56005 Change3937968by Ben.Marsh Disable the boot DDC if we're not in the editor. Fixes access violations when multiple SCW instances attempt to read/write to the same file. #jira UE-56003 Change 3937573 by Mitchell.Wilson Saving asset to resolve empty asset warning. #jira UE-56004 Change 3937561 by Max.Preussner ImgMedia: Added support for single-threaded platforms Copied from Dev-Sequencer CL# 3937516 #jira UE-55986 Change 3937305 by Mike.Beach Resaving google VR model content with UGS build to fix the empty file version error. #jira UE-55984 Change 3935595 by Arne.Schober Fix missing UV precission on BSP surfaces #jira UE-54014 Change3935411by josh.jensen Fixed Windows iOS remote Mac build issue where the user icons were considered remote Mac compilation targets coming solely from the Engine directory #jira UE-55899 Change 3934982 by Marc.Audy Fix shadow variable issue #jira UE-55957 Change 3934892 by Mark.Satterthwaite In MetalRHI treat BUF_Volatile buffers as Shared or Managed memory in all circumstances so that multiple updates within a render pass are respected even though this will hurt CPU performance. This fixes GPU particles on macOS. Also push initialisation upload into the async. command buffer to avoid it overwriting a later Lock/Unlock! Only read-back and copy-buffer operations should be on the 'current' command buffer as they need to be inline with all outstanding commands. #jira UE-55956 Change 3934421 by Arciel.Rekman Fix lockup/OOM when setting audio sources to 2 (UE-53968). #jira UE-53968 Change 3934156 by Peter.Sauerbrei fix for backgrounding problems on iOS and tvOS this will re-open UE-50979 as the fix for that was not correct and would have caused crashes when backgrounding during startup #jira UE4-55609 Change 3933547 by Aaron.McLeran #jira UE-55940 Fix for wavetable sample duration and seek Change 3933544 by Aaron.McLeran #jira UE-55939 Hiding channel format Submix channel format is an experimental feature and shouldn't be exposed to the submix editor for 4.19. Change 3933540 by Aaron.McLeran #jira UE-55718 Fix for playback progress. Change 3933280 by Ethan.Geller [Release-4.19] #jira UE-55810 Ensure AudioComponent is created before we start using it. #rb Aaron.McLeran Change 3933079 by Ryan.Vance #jira UE-55936 Fixed missing referenced uniform bindings on AR pass-through camera shaders. Change 3932319 by Ben.Zeigler #jira UE-55885 Fix corruption of packages when starting and then cancelling an async load of a package that already exists, or attempting to async load a script package It now keeps track of which packages were created by the async load system and will only throw those away on cancel Copy of CL #3932312 Change 3932287 by Matt.Kuhlenschmidt Updated substance texture #jira UE-55081 Change 3931729 by josh.jensen Ensure the tvOS and iOS Assets.car is always produced as part of a regular remote/local build #jira UE-55899 Change 3929723 by josh.jensen Removed packaging requirement on Windows of a remote Mac after setting an app icon to default #jira UE-53495 Change 3929722 by josh.jensen Fixed iOS asset catalog generation issues when swapping out/resetting to default app icons for both code- and BP-projects #jira UE-53492, UE-51879 #robomerge Change 3929350 by Mike.Erwin "Save As" support for #jira UE-55732 Change 3927829 by Steve.Robb Out-of-memory handler for MallocStomp. #jira UE-55550 Change 3926404 by Mike.Erwin #jira UE-55732 Change 3926394 by Dan.Oconnor Recompile bytecode dependencies when compiling an individual blueprint interface, this prevents crashes due to stale bytecode #jira UE-55813 Change 3926098 by Guillaume.Abadie Do not allow dynamic resolution to be enabled on unsupported platforms avoiding game breaker experience by security. #jira UE-55697 Change 3925927 by Guillaume.Abadie Enables TAA's AA_BORDER on all permutation for dynamic resolution. #jira UE-55353 Change 3925882 by Matt.Kuhlenschmidt Fix substance uri having one extra / Fix substance menu option showing up for github (incompatible with plugin) #jira UE-55766 Change 3925873 by Ben.Zeigler #jira UE-55783 Fix issue introduced in 4.18 where user structs did not handle converting AssetPtrs to SoftObjectPtrs properly Copy of CL #3925871 Change 3925163 by Guillaume.Abadie Fixes DFAO's temporal AA passes that was handling FViewInfo::ViewRect.Min wrongly. #jira UE-55788 Change3924839by Guillaume.Abadie Fixes a crash of LDR android preview with OS DPI scale != 0. #jira UE-43622 Change 3924542 by Cosmin.Sulea Merged fixes: UE-55299 - XGE Shader Compile Interferes with Remote Shader Compiling Causing Materials to Fail to Compile #7 UE-51086 - No clear editor activity during remote shader compiling #jira UE-55299 Change 3922398 by Mark.Satterthwaite Compile fix for 3922273. #jira UE-53993 Change 3922273 by Mark.Satterthwaite Fix validation error caused by the game updating its orientation before the drawable system catches up. We need to drop drawables that are incorrectly sized until we get one with the correct size. #jira UE-53993 Change 3921127 by Ethan.Geller [Release-4.19] #jira UE-55744: Add OnTick virtual to IAudioPluginListener, fix thread safety issue in Resonance Audio. #rb aaron.mcleran Change 3920632 by Lina.Halper Fix render thread crash when morphtarget is deleted or added #jira: UE-55521 Change 3920557 by Lauren.Ridge Fixing material editor resetting background to off #jira UE-55267 Change 3920519 by Phillip.Kavan Fix a regression in which elements would not be initialized when constructing the value assignment for UDS-typed container members in nativized Blueprint C++ code. Change summary: - Modified FEmitDefaultValueHelper::InnerGenerate() to remove UDS from the list of special cases that avoid calling InitializeStruct() as part of new element construction. Previously the conversion code assumed the compiler would perform value initialization of a nameless temporary, but that is no longer valid in 4.19, as UDS types have been changed to function more like native structs, and as such all converted UDS types will now emit an explicit default ctor which is now used to assign defaults that differ from the zero-initialized value. #jira UE-55628 Change 3920476 by Michael.Trepka Clean up Mac menu item cache at exit before SlateApplication is fully destroyed. #jira UE-55599 Change 3920336 by Ben.Marsh Ignore license warnings from PVS-Studio. #jira UE-55729 Change 3920134 by Jurre.deBaare Moving over: "HLOD: Building HLOD for P map with sublevels requires HLODSetupAsset when it should not #fix Ensure that we dynamically add HLOD level treeview items whenever they are required, rather than adding a static number of levels according to the worldsettings" #jira UE-55619 Change 3920126 by Max.Preussner MediaCompositing: Implemented media track for Sequencer Copied from Dev-Sequencer #jira UE-53974 Change 3920004 by Jack.Porter Disable Manual Vertex Fetch SRV creation when MVF is disabled. Made a single RHISupportsManualVertexFetch(EShaderPlatform) to control whether to use MVF. The Shader Platform (or alternatively, feature level) is the only thing that can decide whether or not to use MVF because we need to know when we compile the shaders if we're going to do MVF or not. Checking GSupportsResourceView at runtime is useless because the shaders can't change and so if GSupportsResourceView can ever be false for a platform, the shaders need to have been built without it. Creating SRVs without using them on mobile is not harmless because several devices don't support formats that are needed. #jira UE-54764 #jira UE-55622 Change 3919069 by Aaron.McLeran #jira UE-55718 Fix for playback progress. Change 3918942 by Graeme.Thornton Added "ProjectBuildMutatorFeature" modular feature, allowing plugins to register said feature and dictate whether the current project requires a code build. CryptoKeys plugin uses this feature to force a code build when encryption or signing is enabled. #jira UE-55686 Change 3918721 by Zak.Parrish Lighter version map for Gremlin + new Engine.ini - result is 60Hz #jira none Change 3918236 by Joe.Graf Added a bFlipTrackedRotation to give a better result when mirroring the rotation of a tracked face #jira: UE-55531 Change 3917970 by Martin.Wilson Expose curve data in remap assets to blueprints #jira UE-55585 Change 3917740 by Olaf.Piesche Properly checking for presence of buffer SRV capability via GSupportsResourceView so ES3.1 and Metal devices don't crash using GPU particles (and possibly in other circumstances); #jira UE-55591 Change 3917713 by Cody.Albert Build fixes for Match3 on iOS #jira UE-53742 Change 3917472 by zak.parrish added mouthPressLeft and MouthPressRight back into debug screen #jira none Change 3917244 by Michael.Dupuis #jira UE-35097: Fixed crash when creating a new landscape with 2x2 subsections and material containing grass spawning node Change 3916775 by Ben.Marsh Add missing files for packaging IOS on Windows. #jira UE-53873 Change 3916293 by Joe.Graf Removed the redundant GetTransform() from UARFaceGeometry since GetLocalToWorldTransform() is exposed on a base class #jira: UE-55531 Change 3916011 by Joe.Graf Added an accessor to get the transform of the face mesh or a face mesh component #jira: UE-55531 Change 3915967 by Mark.Satterthwaite Place buffer updates into the prologue command-buffer in MetalRHI to avoid breaking the current command-encoder. This improves performance, though the semantics of Metal now differ subtly to other RHI implementations as the buffer updates happen prior to the SetRenderTargets call in the GPU's view of the world. #jira UE-54858 Change 3915751 by Nick.Atamas Merging CL 3913931 from //UE/Partner-Google-VR/... to //UE4/Release-4.19/... #jira UE-55639 Change 3915421 by Martin.Wilson Fix crash from live link message bus heartbeat manager #jira UE-55644 Change 3915326 by Dan.Oconnor Make compilation manager's skeleton class layout better match the old compilation path's skeleton class layout, fixes a crash when renaming blueprint functions #jira UE-55592 Change 3915250 by JeanLuc.Corenthin Can't add C++ code to Enterprise projects (when enterprise is installed) Root cause: When compiling a C++ project, Datasmith modules are included in the build process (with the wrong path) Fix: - Added two more Enterprise directories, Plugins and Intermediate, to the Enterprise directories to check against - Build the correct path for the Datasmith modules and plugins in FindOrCreateModuleByName. Added check to see if module is under one of the Enterprise directories. - Added modules to list of precompiled modeules in UEBuildTargets.AddPrecompiledModules if Engine and Enterprise are 'installed and the module is under Enterprise. #jira UEENT-1032 Change 3915240 by Ben.Marsh Reduce editor startup times by ~15s on Windows. Platform loading code recursively scans every module for dependent DLL modules to load first. Change to make it early-out as soon as it encounters a module which is already in memory (via a call to GetModuleHandle() from ResolveMissingLibraryImportsRecursive). Also use a TSet<> to store set of visited modules rather than an Array. Now spends <0.1s total in this function on editor startup. (Change looks larger than it is due to moving functions out of WindowsPlatformProcess.h to avoid introducing TSet dependency into this header). #jira UE-55642 Change 3914803 by Gil.Gribb UE4 - Removed memory track from the lock free list links. This is not safe and will sometimes assert in debug. #jira UE-49600 Change 3914616 by zak.parrish Adding Calibrate button #jira none Change 3914599 by Andrew.Rodham Sequencer: Sequence template source signatures are now also compared to catch the case where a sub-sequence asset has been saved but not modified - The following sequence of events exposes this issue: - Create a master sequence with a single shot that spawns a cube - Add this sequence to a level and set it to auto-play - Save everything and restart - Resave just the inner shot asset without opening it - PIE - The inner shot never spawns its cube because its template was wiped on save, but its signature never changed. Since the master sequence previously didn't check the template source signature, it ends up trying to evaluate an empty template. #jira UE-55626 Change 3914479 by Krzysztof.Narkowicz Added encoded HDR reflection capture cooking if targeting ES 2.0/3.1 on Windows #jira UE-53875 Change 3914347 by Martin.Wilson Stop anim preview instance from ever running in parallel #Jira UE-55577 Change 3914179 by Benn.Gallagher Fixed clothing sections not displaying in LOD section list in skeletal mesh editor, due to no longer duplicating clothing sections in the model data. #jira UE-55528 Change 3914122 by Steven.Barnett Fix perf regression in BSP queries by changing suppression of PhysX mesh cleaning failure message. #jira UE-54081 Change 3913950 by zak.parrish Clamping my normalization math #jira none Change 3913926 by Zak.Parrish First pass at Gremlin Calibrate button. Also added shirt/backpack to boy so he's not a floating head. #jira none Change 3913668 by Matt.Kuhlenschmidt Adding missing substance styling info #jira UE-55081 Change 3913667 by Nick.Atamas Merging CL 3912976 from //UE4/Partner-Google-VR/... //UE4/Release-4.19/... Upgrading to support ARCore 1.0 runtime. #jira UE-55602 Change 3913645 by Aaron.McLeran #jira UE-55618 fix for mono audio devices Change 3913509 by Cody.Albert Removing PhsX build exclusion from Match3 #jira UE-53742 Change 3913380 by Dan.Oconnor Preload Sequence Bindings node at proper time #jira UE-55412 Change 3913300 by Mitchell.Wilson Updating iOS default startup movie to H.264, 1280x720, 30 fps. #jira UE-55382 Change 3913291 by Cody.Albert More iOS build fixes for Match3 #jira UE-53742 Change 3913169 by Cody.Albert Fixed iOS build issues for UnrealMatch3 #jira UE-53742 Change 3913131 by Krzysztof.Narkowicz Fixed remaining quad overdraw viewmode contents on screen after switching to certain other viewmodes (e.g. light overlap or complexity) #jira UE-54580 Change 3912851 by Lina.Halper Fixed issue with pose asset blending additively multiple poses suming up to 1 weight. #jira: UE-55603 Change3912629by Guillaume.Abadie Fixes SSR that was computing vigneting according to PrevScreen that could let some outside viewport samples going through when rotating the camera. #jira UE-55353 Change 3912170 by Martin.Wilson Add logging for UE-55511 (NaN crash) #jira UE-55511 Change 3912161 by Phillip.Kavan Fix editor-only default subobjects inherited from a native C++ parent class not being handled correctly during nativized Blueprint class ctor generation. Change summary: - Modified FEmitDefaultValueHelper::HandleSpecialTypes() to skip editor-only checks for instanced default subobjects. These will have already been created by a native parent class. - Modified FEmitDefaultValueHelper::HandleInstancedSubobject() to assert before creating a "dummy" component in place of an editor-only instance if we're not supposed to be creating it. #jira UE-55474 Change 3912100 by Luke.Thatcher [RELEASE] [^] Merging (as edit) fix for building pak patches (CL 3911754) from //UE4/Dev-Core to //UE4/Release-4.19 #jira UE-55340 Change 3912072 by Mike.Beach Art cleanup pass on AR template icon. #jira UE-55587 Change 3912057 by Michael.Trepka Additional widget path validity check in FSlateUser::NotifyWindowDestroyed() #jira UE-55580 Change 3911592 by Jurre.deBaare Crash on merge actor when Use specific LOD Level #fix make sure we use the correct array to determine the number of components being merged #jira UE-55508 Change 3911466 by Cosmin.Sulea Mega change list for the following related issues: UEMOB-417 - Support Xcode automagical code signing UE-49829 - Remote build fails to use / sign distribution provisions coming from PC UE-39501 - Packaging for tvOS in Distribution fails to find valid provision UE-55334 - XCode managed provisions don╞t operate gracefully with manual provisions UE-55330 - Automatic signing doesn't work with tvOS UE-10969 - Remote build fails if there is no development provision provided #jira UEMOB-417 Change 3911454 by Luke.Thatcher [RELEASE] [!] Fix rendering thread memory leak in FLandscapeComponentSceneProxy::InitViewCustomData - FViewCustomDataLOD is allocated on a memstack, but contains a TArray, so is not trivially destructible. - The SubSections array is leaked when the memstack is popped. - Fix replaces the TArray with a TStaticArray of max size MAX_SUBSECTION_COUNT (which is 4). (Merging as edit CL 3911422 from //Fortnite/Release-3.1/... to //UE4/Release-4.19/...) #jira UE-54835 Change 3911370 by Dragan.Jerosimovic changed browOuterLeft -> browOuterUpLeft, browOuterRight->browOuterUpRight updated KiteBoyHead_JointsAndBlends.fbx #jira none Change 3910545 by Dan.Oconnor PR #4512: Fix FNetNameMapping::GetUniqueName regression (Contributed by dfb) #jira UE-55513 Change 3910449 by Michael.Trepka Fix for crash on exit on Mac when closing the root editor window with Cmd+W #jira UE-54973 Change 3909601 by Patrick.Boutot Expose to Blueprint GetProjectDirectory functions. #jira UE-55548, UEENT-999 Change 3909543 by Patrick.Boutot Rename ECollisionResponse to CollisionResponseType in script to prevent collision with FCollisionResponse. Python's help function now output the Python type instead of the cpp type. Do not export hidden enum entry from Python. #jira UE-55545, UEENT-961 Change 3909289 by Zak.Parrish Adding shirt/chest to faceAR sample #jira none Change 3908808 by Dragan.Jerosimovic added combination shapes network #jira none Change 3908788 by Mitchell.Wilson Updaing Match3Camera to resolve clipping issue on iPhone X #jira UE-54723 Change 3908374 by Jack.Porter Fix viewport offset problem for preview PIE window #jira UE-52583 Change 3907108 by Shane.Caudle #JIRA Added DefaultDeviceProfiles.ini to set the [IOS DeviceProfile] +CVars=r.ShadowQuality=4 Change 3907105 by Lauren.Ridge Fix for thumbnails not resetting when layers/blends reset and for them being incorrectly scaled when null #jira UETOOL-1303 Change3907011by Chris.Phillips UE-52667 Unable to package an Android DLC Using "Android APK" and "Android DLC" profiles in Project Launcher. #jira UE-52667 Change3906792by Lauren.Ridge When constructing the material editor viewport, use the direct method to set the environment visibility. #jira UE-55267 Change 3906734 by Chris.Babcock Fix issue with vertex fetch disable #jira UE-55475 Change 3906721 by Rolando.Caloca UE4.19 - Check if the results file from SCW is corrupt #jira UE-53124 Change 3906648 by Chris.Phillips UE-53184 Assertion when running mobile PIE in iPhone 5S mode. Updated the iPhone5s.json Metal settings. #jira UE-53184 Change 3906474 by David.Hibbitts Added default constructor for FLiveLinkWorldTime. #jira UEENT-879 #rb none Change 3906467 by Lauren.Ridge Swapping sibling materials now correctly swaps the overridden parameters out #jira nojira demobug Change 3906156 by Michael.Trepka Reverting CL 3728924 as it's causing problems with modal windows. A different, much more involved fix for UE-51711 will be needed. #jira UE-52492 Change 3906144 by Michael.Dupuis #jira UE-54547: Added guard to be sure that material is valid Change 3905882 by Matt.Kuhlenschmidt Enable substance buttons again #jira UE-55081 Change 3905513 by Sorin.Gradinaru UE-55394 iOS crash exiting app during startup movie: SPRINGBOARD, process-exit watchdog transgression #jira UE-55394 #jira UE-52328 #iOS #4.19 This is a particular case of UE-52328 iOS reporting crash on application exit: SPRINGBOARD, process-exit watchdog transgression Found several issues on iOS if the game is forced closed when the startup movie is playing and "Wait for movies to complete" is enabled in Project Settings - the game thread is waiting for the movie to complete on game shutdown - more that 5 sec - crash on FDefaultGameMoviePlayer::Shutdown if the above is fixed - HTTP module no longer has time to wait for the requests to complete. Change 3905506 by Michael.Dupuis Remove static mesh instancing async buffer filling, as with all the changes made, it's no longer necessary, the cost of loading very large buffer is negligable Rebuild the occlusion tree when using foliage.DensityScale with something other than 1.0 #jira 0 Change 3905498 by Lina.Halper Fix multiple pose asset issue - fallout from CL 3903509 - as for fullbody, went back to old mathod because in the fullbody, we want shortest path most of times and you don't blend more than 1 weight, so this is likely fine - as for additive, change to use blend from identity. #jira: UE-55439, UE-55448, UE-55250 Change 3905325 by Sorin.Gradinaru UE-54764 UnrealMatch3 spams Kindle device log with "Unsupported EPixelFormat" #jira UE-54764 #4.19 Also reproduced on Samsung Galaxy S5 Neo (SM-G903F, GPU Mali-T720). Check GMaxRHIFeatureLevel > ERHIFeatureLevel::ES3_1 (not mobile) before creating RSV params used with SupportsManualVertexFetch: (Positions, Tangents, TextureCoordinates, Color buffers) Change 3905307 by Jack.Porter Removed iPhone5 PIE json file as it's not a supported device #jira UE-53184 Change 3905132 by Shane.Caudle #JIRA Pushed it a little more out of the yellow. Change 3905117 by Shane.Caudle #JIRA Got SSS working and made some tweaks. Change 3904936 by Max.Chen Fix editor only #jira UE-55459 Change 3904269 by Chris.Babcock Disable manual vertex fetch on mobile #jira UE-55389 #ue4 #android #ios Change 3904186 by Lina.Halper Pose asset crash when skeleton not existing during serialization #jira: UE-55422 Change 3904063 by Max.Chen Sequencer: Fix copy/paste crash. Only process UMovieSceneCopyableBinding and objects that can be spawned by the movie scene spawn register. Copy from Dev-Sequencer #jira UE-55314 Change 3904060 by Lauren.Ridge Fix for saving a child out of a layer stack capturing the wrong parameters #jira UETOOL-1280 Change 3904050 by Luke.Thatcher [CONSOLE] [^] Added RHI Command List Enqueue Lambda method (merging as edit CL 3879722 from //Fortnite/Main to //UE4/Release-4.19) - Can be used to enqueue arbitrary tasks on the RHI thread from the render thread (similar to how EURC works for GT -> RT tasks), without having to write lots of bolierplate FRHICommand functor classes. - The first overload of EnqueueLambda method will check Bypass() to determine if it should run the lambda immediately or defer to the RHI thread. - This can be overriden via the 2nd overload if you need to check additional things such as IsRunningRHIInSeparateThread. - The function returns true if the lambda was enqueued and deferred to the RHI thread, otherwise false. This can be used to optionally add RHIThreadFences for unlock commands etc. #jira UE-55437 Change 3904004 by Lauren.Ridge Fix for material layer output nodes being able to be placed in other graphs #jira UE-54867 Change 3903931 by Aaron.McLeran #jira UE-55435 Crash in google resonance when toggling visualization fix for issue described here -- https://github.com/resonance-audio/resonance-audio-unreal-sdk/issues/1 Change 3903722 by David.Hill The ProxyLOD plugin is experimental: don't load it by default. #jira: ue-55402 Change 3903583 by Ben.Marsh Include .version and .modules files in manifest. Should fix missing version information in precompiled binaries. #jira Change 3903529 by Richard.Hinckley #jira UEDOC-7180 4.19 API Documentation manual update. Change 3903509 by Lina.Halper Merging using //UE4/Dev-AnimPhys/->//UE4/Release-4.19/ #DUPE MERGE: Fix issue with pose blending with shortest path - causing additive to blend linearly between pose if the rotation is same direction. #jira: UE-55250 Change 3903501 by Michael.Dupuis #jira UE-55122: Fixed bad neighbors updating for mobile Change 3903387 by Will.Fissler ; r.XGEShaderCompile is now enabled by default in source. Uncomment to disable XGE shader compilation. ;r.XGEShaderCompile = 0 #jira UE-55286 Change 3903251 by Sungjin.Hong #JIRA UE-55349 #loc added KO locallization for VR, Handheld AR templates Change 3903219 by Adrian.Siminciuc https://jira.it.epicgames.net/browse/UE-54738 removed redundant iOS warning when IOnlineIdentity::Login is called by FOnlineExternalUIIOS::ShowLoginUI #jira UE-54738 #iOS Change 3903130 by Cody.Albert Updated build configuration to resolve iOS build error on UnrealMatch3 #jira UE-53742 Change 3903056 by Shane.Caudle #JIRA Latest tweaks to lighitng and rendering for boy. Change 3903032 by Cody.Albert Added missing include that was preventing iOS builds from succeeding on TopDown template #jira UE-54341 Change 3902669 by Lauren.Ridge Fix for thumbnail crash after saving material instances that contain layers #jira crash Change 3902581 by Mitchell.Wilson Updating Samples and Template Min iOS Version to iOS 9. #jira UE-55148 Change 3902448 by Lauren.Ridge Fix for crash due to unparented material instance #jira crash Change 3902206 by Chris.Phillips UE-52612 External textures only work in pixel shaders. Sampling external textures are now only limited to pixel shaders when the shader model is < SM4. #jira UE-52612 Change 3902120 by Peter.Sauerbrei bvringing over the fix for backgrounding crash on iPhone X from Fortnite #jira UE-54883 Change 3902097 by Lina.Halper Merging using //UE4/Dev-AnimPhys/->//UE4/Release-4.19/ #DUPE MERGE: CL 3901939 #jira: UE-55401 Change 3902082 by Mike.Beach Fixing an issue with the fix from CL 3889470 - fully matching the old UEnum name check (checking both the value name and the typed name, for example: "Left" and "EControllerHand::Left"). #jira UE-55153 Change 3901963 by Peter.Sauerbrei bring over the fix from Fortnite for Remote Shader Compilation not respecting settings in the passed in shader #jira UE-52797 Change 3901959 by Ethan.Geller [Release-4.19] #jira UE-55225: Stop RtAudio stream on StopRecording in sequence recorder. #rb Aaron.McLaren Change 3901482 by Lauren.Ridge Fix for crash on opening materials due to array out of bounds #jira crash Change 3901181 by Michael.Dupuis #jira UE-55313: To enable tessellation we MUST have 2 materials in the list Change 3900935 by Nick.Bullard Updating Default_Startup.mp4 with more recent UE branding. This still requires another update for final version with audio #jira UE-55382 Change 3900660 by Aaron.McLeran #jira UE-55381 crash in sound submix Bringing fix from FN to 4.19 (CL 3890630) Change 3900643 by Aaron.McLeran #jira UE-55380 fixing synth envelopes Change 3900617 by Aaron.McLeran #jira UE-55151 Fixing crash w/ mic component Change 3900544 by tim.gautier QAGame: Submitting asset for AsNumber fix submitted with UE-10310 #jira UE-29618 Change 3900430 by Ryan.Brucks KismetRenderingLibrary: Applied a fix from FN to make it possible to create textures from BP created RTs. Without the fix the assets would be created but invisible to the user due to missing RF_Public and RF_Standalone. #JIRA none Change 3900399 by Lauren.Ridge Fixing global parameters not working #jira UE-55242 Change 3900297 by Ben.Marsh Speculative fix for hot reload causing version files to be updated with a locally made installed build. #jira UE-55072 Change 3900116 by Chris.Bunner Removing outdated tests and test assets. #jira UETOOL-1298 Change 3900042 by Chris.Bunner Deleted SharedInputCollection and associated material graph nodes. #jira UETOOL-1298 Change 3899887 by Lauren.Ridge Fix for background checkbox stomping profile info for material editor. Note that you may have to delete Saved/Config/Windows/Editor.ini to get this to work. #jira UE-55267 Change 3899824 by Chris.Phillips UE-52813 Editor's mobile preview doesn't serialize the landscape's cooked heightmap data. Now only regenerating landscape pixel data when needed when using Mobile Preview Rendering Levels. #jira UE-52813 Change 3899775 by Lauren.Ridge Fix for crash on opening material layer material #jira crash Change 3899673 by Jamie.Dale Fixed Functions sometimes being exposed to Python as if they were Structs #jira none Change 3899487 by Chris.Bunner Duplicate [CL 3852020, 3896571] - Disabling non-performant code only required by experimental material layers feature. Users can opt-in per-project through experimental renderer settings, replacing the previous editor experimental flag. #jira UETOOL-1298 Change 3899156 by Phillip.Kavan Include address of object reference in persistent frame debug info. #jira UE-51952 Change 3899146 by Rolando.Caloca UE4.19 - hlslcc - Workaround for intrinsics with two output arguments #jira UE-52477 Change 3899060 by Bart.Hawthorne Add a null check for the game mode pointer in UWorld::SpawnPlayActor #jira UE-54461 Change 3899015 by Krzysztof.Narkowicz Fixed initialization of instancing random vertex stream. #jira UE-53605 Change 3899008 by Michael.Dupuis Fix issue with landscape mobile vertex factory accessing unbound LodTessellationParams when r.ShaderDevelopmentMode=1 #jira 0 Change 3898994 by Phillip.Kavan More verbose debug logging if an invalid object reference is detected in the BP ubergraph frame during garbage collection. #jira UE-51952 Change 3898962 by Guillaume.Abadie Fixes wrong parameters about whether GPU timing may have CPU generated bubbles to the dynamic resolution heuristic. #jira UE-55352 Change 3898826 by Sorin.Gradinaru UE-54784 StrategyGame crashes entering game on KindleFire 7 - Assertion failed: ViewSize.GetMin #4.19 #Android #jira UE-54784 Wrong code to make an integer even + operator precedence Change 3898822 by Sorin.Gradinaru UE-52328 iOS reporting crash on application exit: SPRINGBOARD, process-exit watchdog transgression FORT-70783 FHttpManager::Flush is immediately canceling all HTTP requests #jira UE-52328 #jira FORT-70783 #iOS #PC #4.19 UE-52328 reopened because of FORT-70783 iOS only: Delay Request->CancelRequest() on Http module shutdown - wait for 2 sec on FHttpManager::Flush to allow pending requests to be sent to the server. Change 3898705 by Max.Chen Sequencer: Skip if the binding id's sequence can't be found. #jira UE-55337 Change 3898108 by Michael.Dupuis #jira UE-54547: Remove the FORCEINLINE so we get a proper callstack of what's happening Change 3898076 by Max.Chen Sequencer: Override the animation asset in the player state if it doesn't match the animation asset that's being evaluated. #jira UE-55328 Change 3897897 by Matt.Kuhlenschmidt Disable substance buttons for now #jira UE-55081 Change 3897742 by Aaron.McLeran Merging fix for UE-55223 to 4.19 #jira UE-55223 Change 3897538 by Michael.Dupuis #jira UE-53787: Added guard if for some reason the material is null we should not try to draw using this material Change3897406by Phillip.Kavan Back out local debug logs. #jira UE-51952 Change 3897400 by Phillip.Kavan Serializing object will now be passed to GC so that it can be logged in case the referenced objects is garbage. - Mirrored from //UE4/Dev-Core (3871863). #jira UE-51952 Change 3897391 by Max.Chen Sequencer: Don't update current time to be within the view range when stepping into a sequence. #jira UE-55322 Change 3897274 by Krzysztof.Narkowicz Fixed issues with loading shaders from DDC - hardcoded CustomAttributes initialization instead of filling them inside UObject costructors in order to properly initialize CustomAttributes before DDC key was created. Added an assert that CustomAttributes are initialized before the AttributeDDCString, so we won't run into this issue again in the future. #jira UE-54683 Change 3897148 by Adrian.Siminciuc https://jira.it.epicgames.net/browse/UE-55147 #4.19 #iOS #jira UE-55147 Change 3897138 by Max.Chen Sequencer: Fix crash when an actor factory is not found. Copy from Dev-Sequencer #jira UE-55309 Change 3897045 by Jack.Porter Fix for crash in ALandscapeProxy::UpdateGrass #jira UE-54362 Change 3897036 by Jack.Porter Fix InstancedStaticMesh crash with invalid lightmap coordinates #jira UE-54423 Change 3896801 by Dmitriy.Dyomin Fixed: Planar reflections does not handle origin rebasing #jira UE-52351 Change 3896743 by Dmitriy.Dyomin Discard CPU copy of vertex/index buffers in OpenGL RHI #jira UE-52133 Change 3896619 by Guillaume.Abadie Cherry-pick 3896598: Fixes after TAAU post process material that had wrong default buffer UV. #jira UE-55317 Change 3895718 by Max.Chen Sequencer: Null checks to prevent crash when saving the default state of a spawnable #jira UE-55304 Change 3895426 by Rolando.Caloca UE4.19 - Add an increased timeout for SCW to avoid OOM situations #jira UE-55306 Change 3895245 by tim.gautier QAGame: Submitting updated test assets. Broke ML_Base out into individual components #jira UE-29618 Change 3895194 by Marc.Audy Prevent crash due to a null entry in the linked to graph of the destination pin #jira UE-54606 Change 3894913 by Arne.Schober REL - Fix crash in Speedtree wind where Renderdata is unavailable #jira UE-54544 Change 3894625 by Arne.Schober REL - Fix assert not in RenderingThread from Triangle Renderer. #jira UE-55247 Change 3894464 by Martin.Wilson Extra debugging info for UE-54705 plus remove check so it is no longer fatal #jira UE-54705 Change 3894450 by Martin.Wilson Remove pinnable ness of retarget asset. Paves the way for exposing retarget asset properties on the node #jira none Change 3893948 by Jostin.Bilyeu Adding default player start location to help with launch on testing within level TM-Materials_POM #jira UE-55063 Change 3893495 by Robert.Manuszewski Fixing a crash when running DDC commandlet #jira UE-54646 Change 3893451 by Jurre.deBaare Altered fix for actor merging with negative scaling to get correct normals #jira UE-54996 #misc updated automated test to include this test-case Change 3892913 by Ethan.Geller [Release-4.19] #jira UE-55151 Fix for Mic Component crashing on re-init. #rb aaron.mcleran Change 3892871 by Ryan.Vance Multi-view requires the day dream compositor. #jira UE-55253 Change 3892785 by Arciel.Rekman Linux: fix inability to create a C++ project (UE-55222). - NullSourceCodeAccessor will unconditionally allow C++ project creation in source builds. - Installed build will check for more compilers in commonly found locations. #jira UE-55222 Change 3892687 by Jostin.Bilyeu Checking in replacement Built Data for map TM-Materials_POM #jira UE-55063 Change 3892674 by Jostin.Bilyeu Adding an invisible plane to TM-Materials_POM to help testing on mobile devices #jira UE-55063 Change 3892622 by Aaron.McLeran #jira none Fixing scope lock in phonon probe volume Change 3892511 by Matt.Kuhlenschmidt Fix zero engine version warning #jira UE-55081 Change 3892211 by Yuriy.ODonnell Fix/workaround for inconsistent preprocessor definitions for NVAftermath that result in FD3D11DynamicRHI class layout mismatch. NVAftermath support is now enabled by default for Win64. NVAftermath is declared as a private dependency in D3D11RHI. It does not automatically propagate to modules that explicitly include private RHI headers (OculusHMD, OSVR, OSVRInput). This results in NV_AFTERMATH being defined while compiling RHI module and not defined when compiling other modules, causing memory corruption at runtime. The long-term solution for this and similar issues requires some mechanism for adding transitive module dependencies, so that anyone that depends on D3D11RHI module would automatically also get the NVAftermath. Additionally, private headers should *never* be included directly by external modules. The short-term solution is to explicitly add NVAftermath dependency to OculusHMD, OSVR and OSVRInput. Additionally, NV_AFTERMATH is no longer forced by D3D11RHIPrivate.h when it's not defined. This allows catching this kind of mismatch in the future through a compiler warning (C4668). #jira UE-53065 Change 3891732 by Brian.Zaugg Re-adding iPhoneX launch images with correct case. #JIRA UE-53541 Change 3891727 by Arne.Schober REL - Do not recreate one Frame Resource for dynamic draws #jira UE-55063 Change 3891716 by Ben.Marsh Fix buffer overrun when generating callstack. #jira Change 3891697 by Brian.Zaugg Deleting iPhoneX launch images that have incorrect case. #jira UE-53541 Change3891678by Brian.Zaugg IPP binaries for iPhoneX support. #jira UE-53541 Change 3891525 by Lauren.Ridge Thumbnails now update correctly w/parameters #jira UETOOL-1333 Change 3891520 by Lauren.Ridge Fixing SA error in material editor #jira UE-55206 Change 3891495 by Jurre.deBaare Normal are different after Merge Actor on scaled objects #fix Make sure we do not apply scale when transform Normals/Tangents #jira UE-54996 Change 3891352 by Guillaume.Abadie Fixes ensure when visualizing HDR with TAAU. #jira UE-55019 Change 3891323 by Matt.Kuhlenschmidt Added substance buttons to content browser and material editor #jira UE-55081 Change 3891033 by David.Hibbitts #JIRA UE-55135 Moved Message Bus Source heartbeats to their own thread using a new FHeartbeatManager singleton. This prevents sources from incorrectly being removed during Slate UI operations. Change 3890642 by Arne.Schober REL - Better fix for Paper2d which honors batching #jira UE-55063 Change 3890593 by Arne.Schober REL - Fix Paper2d crash. When addMesh is called the Vertex and Indexbuffers are nulled out. re-create Dynamic Mesh builder for every Mesh instead. #jira UE-55063 Change 3890502 by Mike.Erwin Fix reported VRAM size on Metal We were getting correct value in MB from system but overflowing uint32 arithmetic when converting to bytes. This led 4GB and 8GB configs to report 0 total VRAM, 0 dedicated tex mem, and GTexturePoolSize = 0. Noticed the problem on my 6GB FirePro, which reported 2GB and set GTexturePoolSize to 70% of that. Also fixed log of texture pool size to show MB. Other platforms' RHIs already report this in MB. #jira none Change 3890404 by Jostin.Bilyeu Updating Demo Display names to remove redundant spaces #jira UE-29618 Change3890401by Dan.Oconnor Fix for property table performance regression #jira UE-54984 Change 3890194 by Dan.Oconnor Make sure a CDO's subobjects are preloaded when running in -game #jira UE-54242 Change 3890182 by Krzysztof.Narkowicz Moving CL3867594 from Dev-Rendering to fix missing shaders in cooked Binary Editor DCC. USE_EDITOR_ONLY_DEFAULT_MATERIAL_FALLBACK generated default material shaders had no cooking code path. #jira UE-54683 Change 3890140 by Rob.Cannaday Merging cacert.pem from //UE4/Dev-Online to //UE4/Release-4.19 Includes latest cacert.pem from https://curl.haxx.se/docs/caextract.html as of January 17, 2018 #jira none Change 3889850 by Shaun.Kime Now initializing Niagara scripts and emitters even if the config file isn't ready yet. #jira UE-54168 #jira UE-54169 #tests can create a blank emitter and all script sub-types Change 3889833 by Michael.Trepka Disabled Clang's unused-lambda-capture warning added in Xcode 9.3 #jira none Change 3889696 by Patrick.Boutot Allow rename from AssetTool when there is no source control enabled. Fix crash when you rename an asset without an enabled source control. #jira UEENT-803 Change 3889470 by Mike.Beach Switching the source-name to legacy hand enum lookup functions to use a static table instead of finding a UEnum object and iterating over reflection data (to prevent a GC lockup with the UObject query). #jira UE-55153 Change 3889319 by Matt.Kuhlenschmidt Disable hardware survey on build machines. They run windows server and lack the necessary win32 api functionality to execute it properly #jira UE-55166 Change 3889087 by Jostin.Bilyeu Minor adjustments TM-SceneTexture for better testing clarity. Minor adjustments to TM-MipLevels for test map clean up #jira UE-29618 Change 3889073 by Sorin.Gradinaru UE-55117 Android virtual keyboard can have text input hidden by software buttons #jira UE-55117 #Android #4.19 Adjusted x-coord and width for the native EditText Change 3888841 by Jurre.deBaare Make FSkeletalMeshRenderData::GetMaxBonesPerSection an ENGINE_API exported function #jira none Change 3888837 by Guillaume.Abadie Fixes a crash in dynamic resolution when doing UE4Editor -server #jira UE-55158 Change 3888831 by Dragan.Jerosimovic added fbx files #jira none Change 3888340 by Ethan.Geller [Release-4.19] #jira UE-54787 edit settings for Strategy Game to prevent stuttering in AudioMixer on low performance Android Devices #rb Aaron.McLeran #fyi Aaron.McLeran #lockdown Cristina.Riveron Change 3888133 by Michael.Karambelas QAGame: Adding a BP Actor to test the Mic component feature that AaronM implemented with UE-51471. #jira UE-29618 Change 3887957 by Krzysztof.Narkowicz "Fixed" Vulkan instancing in by doing Metal style set instance offset to 0 hack #jira UE-54367 Change 3887912 by Jostin.Bilyeu Adding content to TM-SceneTexture to verify Screen Positioning as well as Scene Color and Depth. Adding a new map (TM-MIPLevels) for testing custom mip levels #jira UE-29618 Change 3887571 by Zak.Parrish Adding FaceAR content and cleanup #jira none Change 3887458 by Dan.Oconnor Fix 'Step Out' functionality for macro and collapsed graphs #jira UE-55000, UE-55002, UE-55022 Change 3886883 by zachary.wilson Add testing content to QAGame: Texture and material for testing mip levels. Postprocess material for testing scene buffer sampling. #jira UE-29618 Change 3886848 by Max.Preussner Engine: Workaround for uninitialized external textures causing white flashes in media playback Copied from Fortnite-Main and Dev-Sequencer #jira UE-53357 Change 3886720 by Matt.Kuhlenschmidt Guard against mac menus updating during slow tasks. #jira UE-55068 Change3886657by Guillaume.Abadie Cherry-pick 3886626: Cherry-pick 3886560: Fixes strong aliasing on TAAU's fast shader permutation. This adds a 6th neighbor sampling, and switch AA_TONE ON as TAA does for its fast shader permutation. #jira FORT-69961 Change 3886653 by Matt.Kuhlenschmidt Perforce Plugin: Removed all calls to methods that would update the P4PASSWD environment variable. Perforce stores this as plain text so it is not safe and we do not want the editor to be responsible for this being set. All users should be using ticket based p4 servers for the best security but if they are unable to then they can call p4 passwd on their own to set a slightly better hashed password directly. They may also log in each time to the editor which prevents any password from being stored #jira UE-55111 Change 3886621 by Benn.Gallagher Fixed crash closing clothing tab if workflow centric application puts the tab spawners in a bad state due to incorrect handling of tab context menus. #JIRA UE-55067 Change 3886552 by Thomas.Sarkanen Fixed crash loading an anim instance with a re-instanced class Unable to repro, but in editor we dont need the optimization that this provides. Now we always re-initialize functions and properties in case the class has changed out from under us. #jira UE-55065 - [CrashReport] UE4Editor_Engine!FExposedValueHandler::Initialize() [animnodebase.cpp:521] Change 3886442 by Cosmin.Sulea UE-53033 - Editor Rapidly Spawns Multiple Empty Windows Throughout Remote Shader Compiling #jira UE-53033 Change 3886441 by Cosmin.Sulea UE-54598 - Using an Invalid iOS Mobile Provision does not give descriptive error in Project Launcher, IPhonePackager #jira UE-54598 Change 3886427 by Sorin.Gradinaru UE-54139 Possible crash with new virtual keyboard on Android if suggestions not disabled - from //Dev-Mobile@CL3843552 #4.19 #Android #jira UE-54139 S8 on 7.0 is not hiding suggestions and disabling predictive input. There are cases with this that can cause a crash. Fix: On text change, downgrade to simple suggestions all the easy correction spans that are not a spell check span (remove android.text.style.SuggestionSpan.FLAG_EASY_CORRECT flags) Change 3886210 by Ethan.Geller [Release-4.19] #jira UE-53867 Ensure we don't read off into garbage memory for uncompressed PCM. Change 3886005 by Zak.Parrish Checking in faceAR work on behalf of 3Lateral #jira none Change 3885925 by Mike.Erwin Material preview label off-center on HiDPI screen #jira UE-52533 Change 3885778 by Dan.Oconnor Fix stepping over collapsed graph and macro nodes #jira UE-54950, UE-54955 Change 3885713 by Mike.Erwin glTF: fix material using wrong textures Imported material could plug the wrong textures into its inputs. The previous code tracked a material's textures based on image source index, corrected code uses texture (source + sampler) index. This is more general allowing an image to be referenced by multiple textures. Bug reported yesterday via email, demonstrated using the Khronos TextureSettingsTest sample model. #jira none Change 3885603 by Ben.Marsh Fixes for compiler errors in nightly builds of VS2017 in /permissive- mode. #jira Change 3885566 by Phillip.Kavan Fix a scoping issue related to inaccessible property reference caching in nativized Blueprint code. Change summary: - Modified FDefaultSubobjectData::EmitPropertyInitialization() to utilize the FScopeBlock utility to manage the inaccessible property cache during code generation for instanced subobject initialization. #jira UE-55061 Change 3885481 by Mark.Satterthwaite Attempt to workaround an Intel shader compiler bug without reopening a related AMD bug. This may cost performance unless function constants are available and the runtime compiler actually bothers to perform optimisation (AMD's did not in 10.12.6 and earlier). #jira UE-54333 Change 3885461 by Lauren.Ridge Fix for slot not being initialized to null #jira UE-55069 Change 3885455 by zak.parrish Adding initial files for FaceAR scene lookdev #jira none Change 3885446 by Zak.Parrish Adding test assets for Gremlin look dev. May get removed later prior to release. #jira none Change 3885424 by Krzysztof.Narkowicz Fixed skeletal mesh LODs inside editor. If skeletal mesh wasn't recently visible, code was incorrectly changing LOD settings without updating LOD data on render thread. #jira UE-53861 Change 3885406 by Zak.Parrish Rollback //UE4/Release-4.19/Samples/FaceARSample/Content/UI/FaceARDebugUI.uasset to revision 1 #jira UE-54639 Change 3885340 by Arne.Schober REL - Bitarray FindFromLast was masking incorrectly for the corner case where there is no slack #jira none Change 3885143 by Marc.Audy Merge memory corruption fix in CL# 3884991 from Fortnite-Staging to Release-4.19 #jira UE-54977 #jira UE-54976 #jira UE-54898 Change 3885093 by Mark.Satterthwaite Apple don't like testing for the validation layer in iOS App Store builds - it is unnecessary so we can disable this for shipping builds. #JIRA N/A Change 3884622 by Jurre.deBaare Moving over missing file from changelist for UE-54508 #jira UE-54508 Change 3883391 by Nick.Atamas Fix for UE-54622 : PIE in VR available when ARKit/ARCore plugins enabled. Only create ARKit/ARCore tracking systems on iOS/Android. #jira UE-54622 Change 3883257 by Phillip.Kavan Fix a Blueprint compile error for the GetClassDefaults node Map value outputs introduced by stronger type checking in 4.19 between Map pin types. #jira UE-55026 Change 3883024 by Lauren.Ridge Fixing static analysis warning #jira SA Change 3882510 by Michael.Dupuis #jira none : Fixed screen size calculation to take aspect ratio into account correctly Change 3882502 by Lauren.Ridge Fix for material layer parameters not rebuilding and adding save child button #jira UETOOL-1275 Change 3882458 by Krzysztof.Narkowicz Copying cached shadow map assert fix from Fortnite-Main (CL3802813) #jira UE-54747 Change 3882366 by Michael.Karambelas QAGame: made changes to QABP_Debugging, QABP_FunctionLib, and QA_TestHelper for Blueprint debugger tests. #jira UE-29618 Change 3881971 by andrew.porter QAGame: Removing actor from Shot_003 #jira UE-29618 Change 3881795 by Krzysztof.Narkowicz Added encoded HDR reflection capture cooking if targeting ES 2.0/3.1 on Windows #jira UE-53875 Change 3881550 by David.Hibbitts #JIRA UEENT-879 Subject frames now store world time explictly as a double with optional scene timecode as MetaData. This allows for use cases such as posing a single frame in Maya where the world time would be changing but the scene timecode associated with the animation remains fixed. THIS IS A BREAKING CHANGE: Sources from before this change will no longer compile. Change 3881339 by Jurre.deBaare Moving over: "Editor crashed when attempting to bake out all the material channels #jira UE-54508 #misc small UDN Merge actor / bake material fixes Change 3879557 by Dan.Oconnor Fix stepover behavior when no debug target is selected #jira UE-54978 Change 3879485 by Mike.Beach Limiting the number of stereo layers on Oculus android to 4 (otherwise, their lib crashes). #jira UE-54999 Change 3879438 by David.Hibbitts #JIRA UEENT-880 Added support for Subject level MetaData to LiveLink #rb martin.wilson #fyi james.golding, simon.tourangeau Change 3879343 by Lina.Halper Last min change that skiped compiling #jira: none Change 3879337 by Lina.Halper Fix issue where tick is skipped due to last ticked pose isn't cleared after AnimInstance changes. #jira: UE-54806 Change 3878968 by Phillip.Kavan Fix deprecation warnings in compiled stub class wrapper codegen for Blueprint class dependencies excluded from nativization. Change summary: - Modified FBlueprintCompilerCppBackendBase::GenerateWrapperForClass() to const-correct the assignment of cached weak pointers to referenced properties. #jira UE-54981 Change 3878962 by Adrian.Siminciuc https://jira.it.epicgames.net/browse/UE-54831 (No error occurs accepting if Android SDK license file cannot be written, but user cannot accept license) #4.19 #jira UE-54831 #android - shows an error message box informing that the license file could not be written. Change 3878821 by Andrew.Rodham Sequencer: Fixed overlapping ranges being inserted into the evaluation field during compilation - The issue was that track segments that had been combined with adjacent segments (due to them being identical) would potentially cause a subsequently compiled frame to overlap with a range that had already been inserted into the evaluation field. - The insertion code previously asserted that only minor overlaps were catered for (due to fp rounding errors) and assumed that a supplied range could not entirely contain any other range in the field. - The solution is to supply the insertion time along with the range to know exactly where the data should live in the field, and crop the range to the maximum allowable space between adjacent ranges. #jira UE-54922 Change 3878171 by Chris.Phillips Android: Fixed crash after splash screen when using Vulkan. #jira UE-54299 Change 3877950 by Ethan.Geller Fix copyright information from previous CL #jira none #rb none #lockdown Cristina.Riveron Change 3877859 by Nick.Shin rebuilt lighting for TM-ShaderModels and resaved the level #jira UE-53374 Client displays "lighting needs to be rebuilt (1 unbuilt object(s))" when launching TM-Shadermodels onto HTML5 Change3877854by tim.gautier Adding additional (temp) ML Test asset #jira UE-29318 Change 3877609 by Ethan.Geller [4.19] Change FWhiteNoise generate function to use SRand, due to weird distribution in FRandRange #jira UE-54965 #rb aaron.mcleran #lockdown cristina.riveron Change 3877474 by Lauren.Ridge Adding WITH_EDITOR wrappers to editor-only section of code #jira fixingcompiles Change 3877271 by Arne.Schober REL - Integrate 3872827 - The VFs are not owners of the data, e.g the underlying Buffers might be released before this and this reference counting should not be neccessary #jira none Change 3877260 by Lina.Halper If revision is too far away, ignore the request and send current buffer - this is exactly how it used to do and it is still required, but this means motion vector will be ignored when this happens #jira: UE-54398 Change 3876950 by Lauren.Ridge Renaming layers in a material instance - from 4.19 preview feedback #jira UETOOL-1296 Change 3876932 by Arciel.Rekman Linux: updated the link to the cross-toolchain (UE-54597). #jira UE-54597 Change 3876918 by Phillip.Kavan Fix a regression that could cause packaging to fail and/or data loss with Blueprint nativization enabled. Change summary: - Removed logic that attempted to avoid redundant assignments of instanced default subobject references. This was not compatible with editinline characteristics that can allow certain object reference values to be overridden by the Blueprint class. - Explicitly defer to ExportTextItem() when generating C++ code for UObjectProperty/UInterfaceProperty reference values in which the underlying object reference is NULL. #jira UE-54870 Change 3876759 by tim.gautier Updated Material Layer test assets to include Opacity and Emissive. #jira UE-29318 Change 3876575 by Michael.Karambelas Updating the QABP_Debugging asset in QAGame with a couple of interfaces and additional logic for testing purposes. #jira UE-29618 Change 3876406 by Robert.Manuszewski Fixed a crash when reporting linker errors #jira UE-51037 Change 3875891 by Nick.Atamas Fixed scenario where geometries were being updated once per pin, instead of just being updated once. Also fixes a scenario where there are no pins and geometries fail to update. #jira UE-54914 Change 3875880 by Aaron.McLeran #jira UE-54916 Fixing up submix effect templates Change 3875673 by Brandon.Schaefer Fix Apex dependencies Depend on static Apex libraries in Apex.Build.cs versus Physx.Build.cs #jira UE-54861 Change 3875498 by Lauren.Ridge PR #4477: 4.19 Fixed a crash caused by the layered material property widget of the material instance editor. (Contributed by mlaveaux) #jira UE-54862 Change 3875322 by tim.gautier Recreating Material Layer test assets (asset version has changed) #jira UE-29318 Change 3875157 by Aaron.McLeran #jira UE-54901 Synth components do not allow sends to buses Change 3875103 by Brandon.Schaefer Need to use our bundled libc++.so not libstdc++.so when building Apex/PhysX/NvCloth libraries #jira UE-54815 Change 3875037 by Aaron.McLeran #jira UE-54896 Fixing up audio capture component to parameterize the delay Parameterize the jitter latency delay. Change 3875026 by Aaron.McLeran #jira UE-54895 Filter frequency values don't update live with EQ effects and 0-frequency cutoff causes pops Change 3874927 by Ryan.Vance #jira UE-54894 Ensure we don't delete aliased texture resources, they are managed externally. Change 3874925 by Martin.Wilson Remove XR post fix from live link code written during motion controller integration #jira none Change 3874354 by Ben.Marsh Use the compiler matching the user's preferred IDE if they don't have a specific compiler selected in the project settings. #jira UE-54272 Change 3877545 by Ben.Marsh Replace FPlatformMisc::DebugBreak() with the UE_DEBUG_BREAK() macro. VS2017 is able to show force-inlined calls on the callstack, which makes debugging asserts and ensures annoying. Use similar logic for expanding ensure() macros in place. #jira UE-54961 [CL 3963579 by Ben Marsh in Main branch]
3045 lines
113 KiB
C#
3045 lines
113 KiB
C#
//
|
|
// Copyright (c) 2007, Peter Dennis Bartok <PeterDennisBartok@gmail.com>
|
|
// All rights reserved.
|
|
//
|
|
// Redistribution and use of this software in source and binary forms, with or without modification, are
|
|
// permitted provided that the following conditions are met:
|
|
//
|
|
// * Redistributions of source code must retain the above
|
|
// copyright notice, this list of conditions and the
|
|
// following disclaimer.
|
|
//
|
|
// * Redistributions in binary form must reproduce the above
|
|
// copyright notice, this list of conditions and the
|
|
// following disclaimer in the documentation and/or other
|
|
// materials provided with the distribution.
|
|
//
|
|
// * Neither the name of Peter Dennis Bartok nor the names of its
|
|
// contributors may be used to endorse or promote products
|
|
// derived from this software without specific prior
|
|
// written permission of Yahoo! Inc.
|
|
//
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
|
// TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
//
|
|
|
|
//
|
|
// Based on code developed by geohot, ixtli, nightwatch, warren
|
|
// See http://iphone.fiveforty.net/wiki/index.php?title=Main_Page
|
|
//
|
|
|
|
using System;
|
|
using System.IO;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using Microsoft.Win32;
|
|
using MobileDeviceInterface;
|
|
|
|
namespace Manzana
|
|
{
|
|
/// <summary>
|
|
/// Structures with unknown innards. They should only ever be used as the target of a TypedPtr, never inspected.
|
|
/// </summary>
|
|
public class AppleMobileDeviceConnection { }
|
|
|
|
/// <summary>
|
|
/// Structures with unknown innards. They should only ever be used as the target of a TypedPtr, never inspected.
|
|
/// </summary>
|
|
public class AFCCommConnection { }
|
|
|
|
public class AFCDictionary { }
|
|
|
|
/// <summary>
|
|
/// Provides the fields representing the type of notification
|
|
/// </summary>
|
|
public enum NotificationMessage
|
|
{
|
|
/// <summary>The iPhone was connected to the computer.</summary>
|
|
Connected = 1,
|
|
|
|
/// <summary>The iPhone was disconnected from the computer.</summary>
|
|
Disconnected = 2,
|
|
|
|
/// <summary>Notification from the iPhone occurred, but the type is unknown.</summary>
|
|
Unknown = 3,
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
|
internal struct AMDeviceNotificationCallbackInfo
|
|
{
|
|
public IntPtr dev
|
|
{
|
|
get
|
|
{
|
|
return dev_ptr;
|
|
}
|
|
}
|
|
internal IntPtr dev_ptr;
|
|
public NotificationMessage msg;
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
|
internal struct AMRecoveryDevice
|
|
{
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
|
public byte[] unknown0; /* 0 */
|
|
public DeviceRestoreNotificationCallback callback; /* 8 */
|
|
public IntPtr user_info; /* 12 */
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
|
|
public byte[] unknown1; /* 16 */
|
|
public uint readwrite_pipe; /* 28 */
|
|
public byte read_pipe; /* 32 */
|
|
public byte write_ctrl_pipe; /* 33 */
|
|
public byte read_unknown_pipe; /* 34 */
|
|
public byte write_file_pipe; /* 35 */
|
|
public byte write_input_pipe; /* 36 */
|
|
};
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
internal delegate void DeviceNotificationCallback(ref AMDeviceNotificationCallbackInfo callback_info);
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
internal delegate void DeviceRestoreNotificationCallback(ref AMRecoveryDevice callback_info);
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
internal delegate void DeviceInstallationCallback(IntPtr/*CFDictionary*/ UntypedStatusDict, IntPtr UserData);
|
|
|
|
public interface ICoreFoundationRunLoop
|
|
{
|
|
int RunLoopInMode(IntPtr mode, double seconds, int returnAfterSourceHandled);
|
|
IntPtr DefaultMode();
|
|
}
|
|
|
|
internal class CoreFoundationRunLoopOSX : ICoreFoundationRunLoop
|
|
{
|
|
public int RunLoopInMode(IntPtr mode, double seconds, int returnAfterSourceHandled)
|
|
{
|
|
return CFRunLoopRunInMode(mode, seconds, returnAfterSourceHandled);
|
|
}
|
|
|
|
public IntPtr DefaultMode()
|
|
{
|
|
return kCFRunLoopDefaultMode;
|
|
}
|
|
|
|
[DllImport("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")]
|
|
public extern static IntPtr CFStringCreateWithCString(IntPtr allocator, string value, int encoding);
|
|
|
|
[DllImport("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")]
|
|
public extern static void CFRunLoopRun();
|
|
|
|
[DllImport("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")]
|
|
public extern static IntPtr CFRunLoopGetMain();
|
|
|
|
[DllImport("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")]
|
|
public extern static IntPtr CFRunLoopGetCurrent();
|
|
|
|
[DllImport("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")]
|
|
public extern static int CFRunLoopRunInMode(IntPtr mode, double seconds, int returnAfterSourceHandled);
|
|
|
|
public static IntPtr kCFRunLoopDefaultMode = CFStringCreateWithCString(IntPtr.Zero, "kCFRunLoopDefaultMode", 0);
|
|
}
|
|
|
|
internal class CoreFoundationRunLoopWin32 : ICoreFoundationRunLoop
|
|
{
|
|
static CoreFoundationRunLoopWin32()
|
|
{
|
|
}
|
|
|
|
public int RunLoopInMode(IntPtr mode, double seconds, int returnAfterSourceHandled)
|
|
{
|
|
return CFRunLoopRunInMode(mode, seconds, returnAfterSourceHandled);
|
|
}
|
|
|
|
public IntPtr DefaultMode()
|
|
{
|
|
return kCFRunLoopDefaultMode;
|
|
}
|
|
|
|
[DllImport("CoreFoundation.dll")]
|
|
public extern static IntPtr CFStringCreateWithCString(IntPtr allocator, string value, int encoding);
|
|
|
|
[DllImport("CoreFoundation.dll")]
|
|
public extern static void CFRunLoopRun();
|
|
|
|
[DllImport("CoreFoundation.dll")]
|
|
public extern static IntPtr CFRunLoopGetMain();
|
|
|
|
[DllImport("CoreFoundation.dll")]
|
|
public extern static IntPtr CFRunLoopGetCurrent();
|
|
|
|
[DllImport("CoreFoundation.dll")]
|
|
public extern static int CFRunLoopRunInMode(IntPtr mode, double seconds, int returnAfterSourceHandled);
|
|
|
|
public static IntPtr kCFRunLoopDefaultMode = CFStringCreateWithCString(IntPtr.Zero, "kCFRunLoopDefaultMode", 0);
|
|
}
|
|
|
|
public class CoreFoundationRunLoop
|
|
{
|
|
static public ICoreFoundationRunLoop CoreImpl;
|
|
|
|
static CoreFoundationRunLoop()
|
|
{
|
|
if (Environment.OSVersion.Platform == PlatformID.MacOSX || Environment.OSVersion.Platform == PlatformID.Unix)
|
|
{
|
|
CoreImpl = new CoreFoundationRunLoopOSX();
|
|
}
|
|
else
|
|
{
|
|
List<string> PathBits = new List<string>();
|
|
PathBits.Add(Environment.GetEnvironmentVariable("Path"));
|
|
|
|
// Try to add the paths from the registry (they aren't always available on newer iTunes installs though)
|
|
object RegistrySupportDir = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Apple Inc.\Apple Application Support", "InstallDir", Environment.CurrentDirectory);
|
|
if (RegistrySupportDir != null)
|
|
{
|
|
DirectoryInfo ApplicationSupportDirectory = new DirectoryInfo(RegistrySupportDir.ToString());
|
|
|
|
if (ApplicationSupportDirectory.Exists)
|
|
{
|
|
PathBits.Add(ApplicationSupportDirectory.FullName);
|
|
}
|
|
}
|
|
|
|
// Add some guesses as well
|
|
DirectoryInfo AppleMobileDeviceSupport = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles) + @"\Apple\Mobile Device Support");
|
|
if (AppleMobileDeviceSupport.Exists)
|
|
{
|
|
PathBits.Add(AppleMobileDeviceSupport.FullName);
|
|
}
|
|
|
|
DirectoryInfo AppleMobileDeviceSupportX86 = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86) + @"\Apple\Mobile Device Support");
|
|
if ((AppleMobileDeviceSupport != AppleMobileDeviceSupportX86) && (AppleMobileDeviceSupportX86.Exists))
|
|
{
|
|
PathBits.Add(AppleMobileDeviceSupportX86.FullName);
|
|
}
|
|
|
|
// Set the path from all the individual bits
|
|
Environment.SetEnvironmentVariable("Path", string.Join(";", PathBits));
|
|
CoreImpl = new CoreFoundationRunLoopWin32();
|
|
}
|
|
}
|
|
|
|
public static int RunLoopRunInMode(IntPtr mode, double seconds, int returnAfterSourceHandled)
|
|
{
|
|
return CoreImpl.RunLoopInMode(mode, seconds, returnAfterSourceHandled);
|
|
}
|
|
|
|
public static IntPtr kCFRunLoopDefaultMode()
|
|
{
|
|
return CoreImpl.DefaultMode();
|
|
}
|
|
}
|
|
|
|
internal interface MobileDeviceImpl
|
|
{
|
|
int NotificationSubscribe(DeviceNotificationCallback DeviceCallbackHandle);
|
|
IntPtr CopyDeviceIdentifier(TypedPtr<AppleMobileDeviceConnection> device);
|
|
int Connect(TypedPtr<AppleMobileDeviceConnection> device);
|
|
IntPtr CopyValue(TypedPtr<AppleMobileDeviceConnection> device, uint unknown, TypedPtr<CFString> cfstring);
|
|
int Disconnect(TypedPtr<AppleMobileDeviceConnection> device);
|
|
int GetConnectionID(TypedPtr<AppleMobileDeviceConnection> device);
|
|
int IsPaired(TypedPtr<AppleMobileDeviceConnection> device);
|
|
int Pair(TypedPtr<AppleMobileDeviceConnection> device);
|
|
int Unpair(TypedPtr<AppleMobileDeviceConnection> device);
|
|
int ValidatePairing(TypedPtr<AppleMobileDeviceConnection> device);
|
|
int LookupApplications(TypedPtr<AppleMobileDeviceConnection> device, IntPtr options, out Dictionary<string, object> AppBundles);
|
|
int StartSession(TypedPtr<AppleMobileDeviceConnection> device);
|
|
int StopSession(TypedPtr<AppleMobileDeviceConnection> device);
|
|
int StartHouseArrestService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2);
|
|
int StartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, ref IntPtr handle, IntPtr unknown);
|
|
int SecureStartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, int flagsPassInZero, ref IntPtr handle);
|
|
string ServiceConnectionReceive(IntPtr handle);
|
|
int RestoreRegisterForDeviceNotifications(
|
|
DeviceRestoreNotificationCallback dfu_connect,
|
|
DeviceRestoreNotificationCallback recovery_connect,
|
|
DeviceRestoreNotificationCallback dfu_disconnect,
|
|
DeviceRestoreNotificationCallback recovery_disconnect,
|
|
uint unknown0,
|
|
IntPtr user_info);
|
|
int SecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFString> ApplicationIdentifer,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
int SecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
int SecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
int ConnectionClose(TypedPtr<AFCCommConnection> conn);
|
|
int ConnectionInvalidate(TypedPtr<AFCCommConnection> conn);
|
|
int ConnectionIsValid(TypedPtr<AFCCommConnection> conn);
|
|
int ConnectionOpen(IntPtr handle, uint io_timeout, out TypedPtr<AFCCommConnection> OutConn);
|
|
int DeviceInfoOpen(IntPtr handle, ref IntPtr dict);
|
|
int DirectoryClose(TypedPtr<AFCCommConnection> conn, IntPtr dir);
|
|
int DirectoryCreate(TypedPtr<AFCCommConnection> conn, string path);
|
|
int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref IntPtr dirent);
|
|
int FileInfoOpen(TypedPtr<AFCCommConnection> conn, string path, out TypedPtr<AFCDictionary> OutDict);
|
|
int FileRefClose(TypedPtr<AFCCommConnection> conn, Int64 handle);
|
|
int FileRefOpen(TypedPtr<AFCCommConnection> conn, string path, Int64 mode, out Int64 handle);
|
|
int FileRefRead(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, ref uint len);
|
|
int FileRefSeek(TypedPtr<AFCCommConnection> conn, Int64 handle, Int64 pos, Int64 origin);
|
|
int FileRefSetFileSize(TypedPtr<AFCCommConnection> conn, Int64 handle, uint size);
|
|
int FileRefTell(TypedPtr<AFCCommConnection> conn, Int64 handle, ref uint position);
|
|
int FileRefWrite(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, uint len);
|
|
int FlushData(TypedPtr<AFCCommConnection> conn, Int64 handle);
|
|
int KeyValueClose(TypedPtr<AFCDictionary> dict);
|
|
int KeyValueRead(TypedPtr<AFCDictionary> dict, out IntPtr key, out IntPtr val);
|
|
int RemovePath(TypedPtr<AFCCommConnection> conn, string path);
|
|
int RenamePath(TypedPtr<AFCCommConnection> conn, string OldPath, string NewPath);
|
|
int DirectoryOpen(TypedPtr<AFCCommConnection> conn, string path, ref IntPtr dir);
|
|
int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref string buffer);
|
|
}
|
|
|
|
internal class MobileDeviceOSX : MobileDeviceImpl
|
|
{
|
|
// static readonly int ForceStaticInit = 42;
|
|
const string DLLName = "/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice";
|
|
|
|
public int NotificationSubscribe(DeviceNotificationCallback DeviceCallbackHandle)
|
|
{
|
|
return AMDeviceMethods.NotificationSubscribe(DeviceCallbackHandle);
|
|
}
|
|
|
|
public IntPtr CopyDeviceIdentifier(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.CopyDeviceIdentifier(device);
|
|
}
|
|
|
|
public int Connect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Connect(device);
|
|
}
|
|
|
|
public IntPtr CopyValue(TypedPtr<AppleMobileDeviceConnection> device, uint unknown, TypedPtr<CFString> cfstring)
|
|
{
|
|
return AMDeviceMethods.CopyValue(device, unknown, cfstring);
|
|
}
|
|
|
|
public int Disconnect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Disconnect(device);
|
|
}
|
|
|
|
public int GetConnectionID(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.GetConnectionID(device);
|
|
}
|
|
|
|
public int IsPaired(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.IsPaired(device);
|
|
}
|
|
|
|
public int Pair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Pair(device);
|
|
}
|
|
|
|
public int Unpair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Unpair(device);
|
|
}
|
|
|
|
public int ValidatePairing(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.ValidatePairing(device);
|
|
}
|
|
|
|
public int LookupApplications(TypedPtr<AppleMobileDeviceConnection> device, IntPtr options, out Dictionary<string, object> AppBundles)
|
|
{
|
|
int Result = AMDeviceMethods.LookupApplications(device, options, out AppBundles);
|
|
return Result;
|
|
}
|
|
|
|
public int StartSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.StartSession((IntPtr)device);
|
|
}
|
|
|
|
public int StopSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.StopSession((IntPtr)device);
|
|
}
|
|
|
|
public int StartHouseArrestService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2)
|
|
{
|
|
return AMDeviceMethods.StartHouseArrestService((IntPtr)device, (IntPtr)bundleName, unknown1, ref handle, unknown2);
|
|
}
|
|
|
|
public int StartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, ref IntPtr handle, IntPtr unknown)
|
|
{
|
|
return AMDeviceMethods.StartService((IntPtr)device, (IntPtr)serviceName, ref handle, unknown);
|
|
}
|
|
|
|
public int SecureStartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, int flagsPassInZero, ref IntPtr handle)
|
|
{
|
|
return AMDeviceMethods.SecureStartService((IntPtr)device, (IntPtr)serviceName, flagsPassInZero, ref handle);
|
|
}
|
|
|
|
public string ServiceConnectionReceive(IntPtr handle)
|
|
{
|
|
return AMDeviceMethods.ServiceConnectionReceive(handle);
|
|
}
|
|
|
|
public int RestoreRegisterForDeviceNotifications(
|
|
DeviceRestoreNotificationCallback dfu_connect,
|
|
DeviceRestoreNotificationCallback recovery_connect,
|
|
DeviceRestoreNotificationCallback dfu_disconnect,
|
|
DeviceRestoreNotificationCallback recovery_disconnect,
|
|
uint unknown0,
|
|
IntPtr user_info)
|
|
{
|
|
return AMDeviceMethods.AMRestoreRegisterForDeviceNotifications(dfu_connect, recovery_connect, dfu_disconnect, recovery_disconnect, unknown0, user_info);
|
|
}
|
|
|
|
public int SecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFString> ApplicationIdentifer,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceMethods.SecureUninstallApplication(serviceConnection, DeviceIfConnIsNull, ApplicationIdentifer, ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public int SecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceMethods.SecureInstallApplication(serviceConnection, DeviceIfConnIsNull, UrlPath, ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public int SecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceMethods.SecureUpgradeApplication(ServiceConnection, DeviceIfConnIsNull, UrlPath, ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public int ConnectionClose(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFC.ConnectionClose(conn);
|
|
}
|
|
|
|
public int ConnectionInvalidate(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFC.ConnectionInvalidate(conn);
|
|
}
|
|
|
|
public int ConnectionIsValid(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFC.ConnectionIsValid(conn);
|
|
}
|
|
|
|
public int ConnectionOpen(IntPtr handle, uint io_timeout, out TypedPtr<AFCCommConnection> OutConn)
|
|
{
|
|
return AFC.ConnectionOpen(handle, io_timeout, out OutConn);
|
|
}
|
|
|
|
public int DeviceInfoOpen(IntPtr handle, ref IntPtr dict)
|
|
{
|
|
return AFC.DeviceInfoOpen(handle, ref dict);
|
|
}
|
|
|
|
public int DirectoryClose(TypedPtr<AFCCommConnection> conn, IntPtr dir)
|
|
{
|
|
return AFC.DirectoryClose(conn, dir);
|
|
}
|
|
|
|
public int DirectoryCreate(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFC.DirectoryCreate(conn, path);
|
|
}
|
|
|
|
public int DirectoryOpen(TypedPtr<AFCCommConnection> conn, string path, ref IntPtr dir)
|
|
{
|
|
return AFC.DirectoryOpen(conn, path, ref dir);
|
|
}
|
|
|
|
public int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref IntPtr dirent)
|
|
{
|
|
return AFC.DirectoryRead(conn, dir, ref dirent);
|
|
}
|
|
|
|
public int FileInfoOpen(TypedPtr<AFCCommConnection> conn, string path, out TypedPtr<AFCDictionary> OutDict)
|
|
{
|
|
return AFC.FileInfoOpen(conn, path, out OutDict);
|
|
}
|
|
|
|
public int FileRefClose(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFC.FileRefClose(conn, handle);
|
|
}
|
|
|
|
public int FileRefOpen(TypedPtr<AFCCommConnection> conn, string path, Int64 mode, out Int64 handle)
|
|
{
|
|
return AFC.FileRefOpen(conn, path, mode, out handle);
|
|
}
|
|
|
|
public int FileRefRead(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, ref uint len)
|
|
{
|
|
return AFC.FileRefRead(conn, handle, buffer, ref len);
|
|
}
|
|
|
|
public int FileRefSeek(TypedPtr<AFCCommConnection> conn, Int64 handle, Int64 pos, Int64 origin)
|
|
{
|
|
return AFC.FileRefSeek(conn, handle, pos, origin);
|
|
}
|
|
|
|
public int FileRefSetFileSize(TypedPtr<AFCCommConnection> conn, Int64 handle, uint size)
|
|
{
|
|
return AFC.FileRefSetFileSize(conn, handle, size);
|
|
}
|
|
|
|
public int FileRefTell(TypedPtr<AFCCommConnection> conn, Int64 handle, ref uint position)
|
|
{
|
|
return AFC.FileRefTell(conn, handle, ref position);
|
|
}
|
|
|
|
public int FileRefWrite(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, uint len)
|
|
{
|
|
return AFC.FileRefWrite(conn, handle, buffer, len);
|
|
}
|
|
|
|
public int FlushData(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFC.FlushData(conn, handle);
|
|
}
|
|
|
|
public int KeyValueClose(TypedPtr<AFCDictionary> dict)
|
|
{
|
|
return AFC.KeyValueClose(dict);
|
|
}
|
|
|
|
public int KeyValueRead(TypedPtr<AFCDictionary> dict, out IntPtr key, out IntPtr val)
|
|
{
|
|
return AFC.KeyValueRead(dict, out key, out val);
|
|
}
|
|
|
|
public int RemovePath(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFC.RemovePath(conn, path);
|
|
}
|
|
|
|
public int RenamePath(TypedPtr<AFCCommConnection> conn, string OldPath, string NewPath)
|
|
{
|
|
return AFC.RenamePath(conn, OldPath, NewPath);
|
|
}
|
|
|
|
#region Application Methods
|
|
public class AMDeviceMethods
|
|
{
|
|
// Need to have the path manipulation code in static MobileDevice() to run
|
|
// static int ForceMobileDeviceConstructorToRun;
|
|
static AMDeviceMethods()
|
|
{
|
|
// ForceMobileDeviceConstructorToRun = ForceStaticInit;
|
|
}
|
|
|
|
public static IntPtr CopyDeviceIdentifier(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceCopyDeviceIdentifier((IntPtr)device);
|
|
}
|
|
|
|
public static int Connect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceConnect((IntPtr)device);
|
|
}
|
|
|
|
public static IntPtr CopyValue(TypedPtr<AppleMobileDeviceConnection> device, uint unknown, TypedPtr<CFString> cfstring)
|
|
{
|
|
return AMDeviceCopyValue((IntPtr)device, unknown, (IntPtr)cfstring);
|
|
}
|
|
|
|
public static int Disconnect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceDisconnect((IntPtr)device);
|
|
}
|
|
|
|
public static int GetConnectionID(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceGetConnectionID((IntPtr)device);
|
|
}
|
|
|
|
public static int IsPaired(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceIsPaired((IntPtr)device);
|
|
}
|
|
|
|
public static int Pair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDevicePair((IntPtr)device);
|
|
}
|
|
|
|
public static int Unpair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceUnpair((IntPtr)device);
|
|
}
|
|
|
|
public static int ValidatePairing(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceValidatePairing((IntPtr)device);
|
|
}
|
|
|
|
public static int LookupApplications(TypedPtr<AppleMobileDeviceConnection> device, IntPtr options, out Dictionary<string, object> AppBundles)
|
|
{
|
|
IntPtr UntypedDict = IntPtr.Zero;
|
|
int Result = AMDeviceLookupApplications((IntPtr)device, options, ref UntypedDict);
|
|
|
|
AppBundles = MobileDevice.ConvertCFDictionaryToDictionaryString(new TypedPtr<CFDictionary>(UntypedDict));
|
|
|
|
return Result;
|
|
}
|
|
|
|
public static int StartSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceStartSession((IntPtr)device);
|
|
}
|
|
|
|
public static int StopSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceStopSession((IntPtr)device);
|
|
}
|
|
|
|
public static int StartHouseArrestService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2)
|
|
{
|
|
return AMDeviceStartHouseArrestService((IntPtr)device, (IntPtr)bundleName, unknown1, ref handle, unknown2);
|
|
}
|
|
|
|
public static int StartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, ref IntPtr handle, IntPtr unknown)
|
|
{
|
|
return AMDeviceStartService((IntPtr)device, (IntPtr)serviceName, ref handle, unknown);
|
|
}
|
|
|
|
public static int SecureStartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, int flagsPassInZero, ref IntPtr handle)
|
|
{
|
|
return AMDeviceSecureStartService((IntPtr)device, (IntPtr)serviceName, flagsPassInZero, ref handle);
|
|
}
|
|
|
|
public static string ServiceConnectionReceive(IntPtr handle)
|
|
{
|
|
StringBuilder sb = new StringBuilder("", 1024);
|
|
AMDServiceConnectionReceive(handle, sb, sb.Capacity, 0);
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static int UninstallApplication(
|
|
TypedPtr<AppleMobileDeviceConnection> device,
|
|
TypedPtr<CFString> ApplicationIdentifier,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceUninstallApplication((IntPtr)device, (IntPtr)ApplicationIdentifier, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int SecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFString> ApplicationIdentifer,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceSecureUninstallApplication(serviceConnection, (IntPtr)DeviceIfConnIsNull, (IntPtr)ApplicationIdentifer, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int SecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceSecureInstallApplication(serviceConnection, (IntPtr)DeviceIfConnIsNull, (IntPtr)UrlPath, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int TransferApplication(
|
|
TypedPtr<AppleMobileDeviceConnection> device,
|
|
TypedPtr<CFString> InPackagePath,
|
|
IntPtr UnknownButUnused,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceTransferApplication((IntPtr)device, (IntPtr)InPackagePath, UnknownButUnused, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int SecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceSecureUpgradeApplication(ServiceConnection, (IntPtr)DeviceIfConnIsNull, (IntPtr)UrlPath, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int InstallApplication(
|
|
TypedPtr<AppleMobileDeviceConnection> device,
|
|
TypedPtr<CFString> FilePath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceInstallApplication((IntPtr)device, (IntPtr)FilePath, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int NotificationSubscribe(DeviceNotificationCallback DeviceCallbackHandle)
|
|
{
|
|
IntPtr notification;
|
|
return AMDeviceNotificationSubscribe(DeviceCallbackHandle, 0, 0, 0, out notification);
|
|
}
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static IntPtr AMDeviceCopyDeviceIdentifier(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceConnect(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static IntPtr AMDeviceCopyValue(IntPtr/*AppleMobileDeviceConnection*/ device, uint unknown, IntPtr/*CFString*/ cfstring);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceDisconnect(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceGetConnectionID(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceIsPaired(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDevicePair(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceUnpair(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceValidatePairing(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceLookupApplications(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr options, ref IntPtr appBundles);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceNotificationSubscribe(DeviceNotificationCallback callback, uint unused1, uint unused2, uint unused3, out IntPtr am_device_notification_ptr);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStartHouseArrestService(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr/*CFString*/ bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStartService(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr/*CFString*/ serviceName, ref IntPtr handle, IntPtr unknown);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureStartService(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr/*CFString*/ serviceName, int flagsPassInZero, ref IntPtr handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDServiceConnectionReceive(IntPtr handle, StringBuilder buffer, int bufferLen, int unknown);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStartSession(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStopSession(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMRestoreModeDeviceCreate(uint unknown0, int connection_id, uint unknown1);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
public extern static int AMRestoreRegisterForDeviceNotifications(
|
|
DeviceRestoreNotificationCallback dfu_connect,
|
|
DeviceRestoreNotificationCallback recovery_connect,
|
|
DeviceRestoreNotificationCallback dfu_disconnect,
|
|
DeviceRestoreNotificationCallback recovery_disconnect,
|
|
uint unknown0,
|
|
IntPtr user_info);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceUninstallApplication(
|
|
IntPtr/*AppleMobileDeviceConnection*/ device,
|
|
IntPtr/*CFString*/ ApplicationIdentifier,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
IntPtr/*AppleMobileDeviceConnection*/ DeviceIfConnIsNull,
|
|
IntPtr/*CFString*/ ApplicationIdentifer,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
IntPtr/*AppleMobileDeviceConnection*/ DeviceIfConnIsNull,
|
|
IntPtr/*CFURL*/ UrlPath,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceTransferApplication(
|
|
IntPtr/*AppleMobileDeviceConnection*/ device,
|
|
IntPtr/*CFString*/ InPackagePath,
|
|
IntPtr UnknownButUnused,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
IntPtr/*AppleMobileDeviceConnection*/ DeviceIfConnIsNull,
|
|
IntPtr/*CFURL*/ UrlPath,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceInstallApplication(
|
|
IntPtr/*AppleMobileDeviceConnection*/ device,
|
|
IntPtr/*CFString*/ FilePath,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
// the unknown goes into the 4th dword in the connection struct. if non-zero, winsock send() won't get called in AMDServiceConnectionSend AFAIK
|
|
// the only option is "CloseOnInvalidate" (CFBoolean type, defaults to false)
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static IntPtr AMDServiceConnectionCreate(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr UnknownTypically0, IntPtr OptionsDictionary);
|
|
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMSBeginSync(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr OuterIn8, IntPtr OuterIn12, IntPtr OuterIn16);
|
|
}
|
|
#endregion
|
|
|
|
#region AFC Operations
|
|
|
|
public int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref string buffer)
|
|
{
|
|
int ret;
|
|
|
|
IntPtr ptr = IntPtr.Zero;
|
|
ret = AFC.DirectoryRead((IntPtr)conn, dir, ref ptr);
|
|
if ((ret == 0) && (ptr != IntPtr.Zero))
|
|
{
|
|
buffer = Marshal.PtrToStringAnsi(ptr);
|
|
}
|
|
else
|
|
{
|
|
buffer = null;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
public class AFC
|
|
{
|
|
public static int ConnectionClose(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFCConnectionClose((IntPtr)conn);
|
|
}
|
|
|
|
public static int ConnectionInvalidate(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFCConnectionInvalidate((IntPtr)conn);
|
|
}
|
|
|
|
public static int ConnectionIsValid(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFCConnectionIsValid((IntPtr)conn);
|
|
}
|
|
|
|
public static int ConnectionOpen(IntPtr handle, uint io_timeout, out TypedPtr<AFCCommConnection> OutConn)
|
|
{
|
|
IntPtr Conn;
|
|
int Result = AFCConnectionOpen(handle, io_timeout, out Conn);
|
|
OutConn = Conn;
|
|
return Result;
|
|
}
|
|
|
|
public static int DeviceInfoOpen(IntPtr handle, ref IntPtr dict)
|
|
{
|
|
return AFCDeviceInfoOpen(handle, ref dict);
|
|
}
|
|
|
|
public static int DirectoryClose(TypedPtr<AFCCommConnection> conn, IntPtr dir)
|
|
{
|
|
return AFCDirectoryClose((IntPtr)conn, dir);
|
|
}
|
|
|
|
public static int DirectoryCreate(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFCDirectoryCreate((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path));
|
|
}
|
|
|
|
public static int DirectoryOpen(TypedPtr<AFCCommConnection> conn, string path, ref IntPtr dir)
|
|
{
|
|
return AFCDirectoryOpen((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path), ref dir);
|
|
}
|
|
|
|
public static int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref IntPtr dirent)
|
|
{
|
|
return AFCDirectoryRead((IntPtr)conn, dir, ref dirent);
|
|
}
|
|
|
|
public static int FileInfoOpen(TypedPtr<AFCCommConnection> conn, string path, out TypedPtr<AFCDictionary> OutDict)
|
|
{
|
|
IntPtr UntypedDict;
|
|
int Result = AFCFileInfoOpen((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path), out UntypedDict);
|
|
OutDict = UntypedDict;
|
|
|
|
return Result;
|
|
}
|
|
|
|
public static int FileRefClose(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFCFileRefClose((IntPtr)conn, handle);
|
|
}
|
|
|
|
public static int FileRefOpen(TypedPtr<AFCCommConnection> conn, string path, Int64 mode, out Int64 handle)
|
|
{
|
|
return AFCFileRefOpen((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path), mode, out handle);
|
|
}
|
|
|
|
public static int FileRefRead(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, ref uint len)
|
|
{
|
|
return AFCFileRefRead((IntPtr)conn, handle, buffer, ref len);
|
|
}
|
|
|
|
public static int FileRefSetFileSize(TypedPtr<AFCCommConnection> conn, Int64 handle, uint size)
|
|
{
|
|
return AFCFileRefSetFileSize((IntPtr)conn, handle, size);
|
|
}
|
|
|
|
public static int FileRefSeek(TypedPtr<AFCCommConnection> conn, Int64 handle, Int64 pos, Int64 origin)
|
|
{
|
|
return AFCFileRefSeek((IntPtr)conn, handle, pos, origin);
|
|
}
|
|
|
|
public static int FileRefTell(TypedPtr<AFCCommConnection> conn, Int64 handle, ref uint position)
|
|
{
|
|
return AFCFileRefTell((IntPtr)conn, handle, ref position);
|
|
}
|
|
|
|
public static int FileRefWrite(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, uint len)
|
|
{
|
|
return AFCFileRefWrite((IntPtr)conn, handle, buffer, len);
|
|
}
|
|
|
|
public static int FlushData(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFCFlushData((IntPtr)conn, handle);
|
|
}
|
|
|
|
public static int KeyValueClose(TypedPtr<AFCDictionary> dict)
|
|
{
|
|
return AFCKeyValueClose((IntPtr)dict);
|
|
}
|
|
|
|
public static int KeyValueRead(TypedPtr<AFCDictionary> dict, out IntPtr key, out IntPtr val)
|
|
{
|
|
return AFCKeyValueRead((IntPtr)dict, out key, out val);
|
|
}
|
|
|
|
public static int RemovePath(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFCRemovePath((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path));
|
|
}
|
|
|
|
public static int RenamePath(TypedPtr<AFCCommConnection> conn, string OldPath, string NewPath)
|
|
{
|
|
return AFCRenamePath((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(OldPath), MobileDevice.StringToFileSystemRepresentation(NewPath));
|
|
}
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionClose(IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionInvalidate(IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionIsValid(IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionOpen(IntPtr handle, uint io_timeout, out IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDeviceInfoOpen(IntPtr handle, ref IntPtr dict);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryClose(IntPtr/*AFCCommConnection*/ conn, IntPtr dir);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryCreate(IntPtr/*AFCCommConnection*/ conn, byte[] path);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryOpen(IntPtr/*AFCCommConnection*/ conn, byte[] path, ref IntPtr dir);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryRead(IntPtr/*AFCCommConnection*/ conn, IntPtr dir, ref IntPtr dirent);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileInfoOpen(IntPtr/*AFCCommConnection*/ conn, byte[] path, out IntPtr OutDict);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefClose(IntPtr/*AFCCommConnection*/ conn, Int64 handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefOpen(IntPtr/*AFCCommConnection*/ conn, byte[] path, Int64 mode, out Int64 handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefRead(IntPtr/*AFCCommConnection*/ conn, Int64 handle, byte[] buffer, ref uint len);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefSeek(IntPtr/*AFCCommConnection*/ conn, Int64 handle, Int64 pos, Int64 origin);
|
|
|
|
// FIXME - not working, arguments?
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
public extern static int AFCFileRefSetFileSize(IntPtr/*AFCCommConnection*/ conn, Int64 handle, uint size);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefTell(IntPtr/*AFCCommConnection*/ conn, Int64 handle, ref uint position);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefWrite(IntPtr/*AFCCommConnection*/ conn, Int64 handle, byte[] buffer, uint len);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFlushData(IntPtr/*AFCCommConnection*/ conn, Int64 handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCKeyValueClose(IntPtr dict);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCKeyValueRead(IntPtr dict, out IntPtr key, out IntPtr val);
|
|
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCRemovePath(IntPtr/*AFCCommConnection*/ conn, byte[] path);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCRenamePath(IntPtr/*AFCCommConnection*/ conn, byte[] old_path, byte[] new_path);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
internal class MobileDeviceWiniTunes11 : MobileDeviceImpl
|
|
{
|
|
// static readonly int ForceStaticInit = 42;
|
|
const string DLLName = "iTunesMobileDevice.dll";
|
|
|
|
static MobileDeviceWiniTunes11()
|
|
{
|
|
List<string> PathBits = new List<string>();
|
|
|
|
// Try to add the paths from the registry (they aren't always available on newer iTunes installs though)
|
|
object RegistryDllPath = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Apple Inc.\Apple Mobile Device Support\Shared", "iTunesMobileDeviceDLL", DLLName);
|
|
if (RegistryDllPath != null)
|
|
{
|
|
FileInfo iTunesMobileDeviceFile = new FileInfo(RegistryDllPath.ToString());
|
|
|
|
if (iTunesMobileDeviceFile.Exists)
|
|
{
|
|
PathBits.Add(iTunesMobileDeviceFile.DirectoryName);
|
|
}
|
|
}
|
|
|
|
object RegistrySupportDir = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Apple Inc.\Apple Application Support", "InstallDir", Environment.CurrentDirectory);
|
|
if (RegistrySupportDir != null)
|
|
{
|
|
DirectoryInfo ApplicationSupportDirectory = new DirectoryInfo(RegistrySupportDir.ToString());
|
|
|
|
if (ApplicationSupportDirectory.Exists)
|
|
{
|
|
PathBits.Add(ApplicationSupportDirectory.FullName);
|
|
}
|
|
}
|
|
|
|
// Add some guesses as well
|
|
DirectoryInfo AppleMobileDeviceSupport = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles) + @"\Apple\Mobile Device Support");
|
|
if (AppleMobileDeviceSupport.Exists)
|
|
{
|
|
PathBits.Add(AppleMobileDeviceSupport.FullName);
|
|
}
|
|
|
|
DirectoryInfo AppleMobileDeviceSupportX86 = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86) + @"\Apple\Mobile Device Support");
|
|
if ((AppleMobileDeviceSupport != AppleMobileDeviceSupportX86) && (AppleMobileDeviceSupportX86.Exists))
|
|
{
|
|
PathBits.Add(AppleMobileDeviceSupportX86.FullName);
|
|
}
|
|
|
|
// add the rest of the path
|
|
PathBits.Add(Environment.GetEnvironmentVariable("Path"));
|
|
|
|
// Set the path from all the individual bits
|
|
Environment.SetEnvironmentVariable("Path", string.Join(";", PathBits));
|
|
}
|
|
|
|
public int NotificationSubscribe(DeviceNotificationCallback DeviceCallbackHandle)
|
|
{
|
|
return AMDeviceMethods.NotificationSubscribe(DeviceCallbackHandle);
|
|
}
|
|
|
|
public IntPtr CopyDeviceIdentifier(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.CopyDeviceIdentifier(device);
|
|
}
|
|
|
|
public int Connect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Connect(device);
|
|
}
|
|
|
|
public IntPtr CopyValue(TypedPtr<AppleMobileDeviceConnection> device, uint unknown, TypedPtr<CFString> cfstring)
|
|
{
|
|
return AMDeviceMethods.CopyValue(device, unknown, cfstring);
|
|
}
|
|
|
|
public int Disconnect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Disconnect(device);
|
|
}
|
|
|
|
public int GetConnectionID(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.GetConnectionID(device);
|
|
}
|
|
|
|
public int IsPaired(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.IsPaired(device);
|
|
}
|
|
|
|
public int Pair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Pair(device);
|
|
}
|
|
|
|
public int Unpair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Unpair(device);
|
|
}
|
|
|
|
public int ValidatePairing(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.ValidatePairing(device);
|
|
}
|
|
|
|
public int LookupApplications(TypedPtr<AppleMobileDeviceConnection> device, IntPtr options, out Dictionary<string, object> AppBundles)
|
|
{
|
|
int Result = AMDeviceMethods.LookupApplications(device, options, out AppBundles);
|
|
return Result;
|
|
}
|
|
|
|
public int StartSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.StartSession((IntPtr)device);
|
|
}
|
|
|
|
public int StopSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.StopSession((IntPtr)device);
|
|
}
|
|
|
|
public int StartHouseArrestService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2)
|
|
{
|
|
return AMDeviceMethods.StartHouseArrestService((IntPtr)device, (IntPtr)bundleName, unknown1, ref handle, unknown2);
|
|
}
|
|
|
|
public int StartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, ref IntPtr handle, IntPtr unknown)
|
|
{
|
|
return AMDeviceMethods.StartService((IntPtr)device, (IntPtr)serviceName, ref handle, unknown);
|
|
}
|
|
|
|
public int SecureStartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, int flagsPassInZero, ref IntPtr handle)
|
|
{
|
|
return AMDeviceMethods.SecureStartService((IntPtr)device, (IntPtr)serviceName, flagsPassInZero, ref handle);
|
|
}
|
|
|
|
public string ServiceConnectionReceive(IntPtr handle)
|
|
{
|
|
return AMDeviceMethods.ServiceConnectionReceive(handle);
|
|
}
|
|
|
|
public int RestoreRegisterForDeviceNotifications(
|
|
DeviceRestoreNotificationCallback dfu_connect,
|
|
DeviceRestoreNotificationCallback recovery_connect,
|
|
DeviceRestoreNotificationCallback dfu_disconnect,
|
|
DeviceRestoreNotificationCallback recovery_disconnect,
|
|
uint unknown0,
|
|
IntPtr user_info)
|
|
{
|
|
return AMDeviceMethods.AMRestoreRegisterForDeviceNotifications(dfu_connect, recovery_connect, dfu_disconnect, recovery_disconnect, unknown0, user_info);
|
|
}
|
|
|
|
public int SecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFString> ApplicationIdentifer,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceMethods.SecureUninstallApplication(serviceConnection, DeviceIfConnIsNull, ApplicationIdentifer, ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public int SecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceMethods.SecureInstallApplication(serviceConnection, DeviceIfConnIsNull, UrlPath, ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public int SecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceMethods.SecureUpgradeApplication(ServiceConnection, DeviceIfConnIsNull, UrlPath, ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public int ConnectionClose(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFC.ConnectionClose(conn);
|
|
}
|
|
|
|
public int ConnectionInvalidate(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFC.ConnectionInvalidate(conn);
|
|
}
|
|
|
|
public int ConnectionIsValid(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFC.ConnectionIsValid(conn);
|
|
}
|
|
|
|
public int ConnectionOpen(IntPtr handle, uint io_timeout, out TypedPtr<AFCCommConnection> OutConn)
|
|
{
|
|
return AFC.ConnectionOpen(handle, io_timeout, out OutConn);
|
|
}
|
|
|
|
public int DeviceInfoOpen(IntPtr handle, ref IntPtr dict)
|
|
{
|
|
return AFC.DeviceInfoOpen(handle, ref dict);
|
|
}
|
|
|
|
public int DirectoryClose(TypedPtr<AFCCommConnection> conn, IntPtr dir)
|
|
{
|
|
return AFC.DirectoryClose(conn, dir);
|
|
}
|
|
|
|
public int DirectoryCreate(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFC.DirectoryCreate(conn, path);
|
|
}
|
|
|
|
public int DirectoryOpen(TypedPtr<AFCCommConnection> conn, string path, ref IntPtr dir)
|
|
{
|
|
return AFC.DirectoryOpen(conn, path, ref dir);
|
|
}
|
|
|
|
public int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref IntPtr dirent)
|
|
{
|
|
return AFC.DirectoryRead(conn, dir, ref dirent);
|
|
}
|
|
|
|
public int FileInfoOpen(TypedPtr<AFCCommConnection> conn, string path, out TypedPtr<AFCDictionary> OutDict)
|
|
{
|
|
return AFC.FileInfoOpen(conn, path, out OutDict);
|
|
}
|
|
|
|
public int FileRefClose(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFC.FileRefClose(conn, handle);
|
|
}
|
|
|
|
public int FileRefOpen(TypedPtr<AFCCommConnection> conn, string path, Int64 mode, out Int64 handle)
|
|
{
|
|
return AFC.FileRefOpen(conn, path, mode, out handle);
|
|
}
|
|
|
|
public int FileRefRead(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, ref uint len)
|
|
{
|
|
return AFC.FileRefRead(conn, handle, buffer, ref len);
|
|
}
|
|
|
|
public int FileRefSeek(TypedPtr<AFCCommConnection> conn, Int64 handle, Int64 pos, Int64 origin)
|
|
{
|
|
return AFC.FileRefSeek(conn, handle, pos, origin);
|
|
}
|
|
|
|
public int FileRefSetFileSize(TypedPtr<AFCCommConnection> conn, Int64 handle, uint size)
|
|
{
|
|
return AFC.FileRefSetFileSize(conn, handle, size);
|
|
}
|
|
|
|
public int FileRefTell(TypedPtr<AFCCommConnection> conn, Int64 handle, ref uint position)
|
|
{
|
|
return AFC.FileRefTell(conn, handle, ref position);
|
|
}
|
|
|
|
public int FileRefWrite(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, uint len)
|
|
{
|
|
return AFC.FileRefWrite(conn, handle, buffer, len);
|
|
}
|
|
|
|
public int FlushData(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFC.FlushData(conn, handle);
|
|
}
|
|
|
|
public int KeyValueClose(TypedPtr<AFCDictionary> dict)
|
|
{
|
|
return AFC.KeyValueClose(dict);
|
|
}
|
|
|
|
public int KeyValueRead(TypedPtr<AFCDictionary> dict, out IntPtr key, out IntPtr val)
|
|
{
|
|
return AFC.KeyValueRead(dict, out key, out val);
|
|
}
|
|
|
|
public int RemovePath(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFC.RemovePath(conn, path);
|
|
}
|
|
|
|
public int RenamePath(TypedPtr<AFCCommConnection> conn, string OldPath, string NewPath)
|
|
{
|
|
return AFC.RenamePath(conn, OldPath, NewPath);
|
|
}
|
|
|
|
#region Application Methods
|
|
public class AMDeviceMethods
|
|
{
|
|
// Need to have the path manipulation code in static MobileDevice() to run
|
|
// static int ForceMobileDeviceConstructorToRun;
|
|
static AMDeviceMethods()
|
|
{
|
|
// ForceMobileDeviceConstructorToRun = ForceStaticInit;
|
|
}
|
|
|
|
public static IntPtr CopyDeviceIdentifier(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceCopyDeviceIdentifier((IntPtr)device);
|
|
}
|
|
|
|
public static int Connect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceConnect((IntPtr)device);
|
|
}
|
|
|
|
public static IntPtr CopyValue(TypedPtr<AppleMobileDeviceConnection> device, uint unknown, TypedPtr<CFString> cfstring)
|
|
{
|
|
return AMDeviceCopyValue((IntPtr)device, unknown, (IntPtr)cfstring);
|
|
}
|
|
|
|
public static int Disconnect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceDisconnect((IntPtr)device);
|
|
}
|
|
|
|
public static int GetConnectionID(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceGetConnectionID((IntPtr)device);
|
|
}
|
|
|
|
public static int IsPaired(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceIsPaired((IntPtr)device);
|
|
}
|
|
|
|
public static int Pair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDevicePair((IntPtr)device);
|
|
}
|
|
|
|
public static int Unpair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceUnpair((IntPtr)device);
|
|
}
|
|
|
|
public static int ValidatePairing(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceValidatePairing((IntPtr)device);
|
|
}
|
|
|
|
public static int LookupApplications(TypedPtr<AppleMobileDeviceConnection> device, IntPtr options, out Dictionary<string, object> AppBundles)
|
|
{
|
|
IntPtr UntypedDict = IntPtr.Zero;
|
|
int Result = AMDeviceLookupApplications((IntPtr)device, options, ref UntypedDict);
|
|
|
|
AppBundles = MobileDevice.ConvertCFDictionaryToDictionaryString(new TypedPtr<CFDictionary>(UntypedDict));
|
|
|
|
return Result;
|
|
}
|
|
|
|
public static int StartSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceStartSession((IntPtr)device);
|
|
}
|
|
|
|
public static int StopSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceStopSession((IntPtr)device);
|
|
}
|
|
|
|
public static int StartHouseArrestService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2)
|
|
{
|
|
return AMDeviceStartHouseArrestService((IntPtr)device, (IntPtr)bundleName, unknown1, ref handle, unknown2);
|
|
}
|
|
|
|
public static int StartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, ref IntPtr handle, IntPtr unknown)
|
|
{
|
|
return AMDeviceStartService((IntPtr)device, (IntPtr)serviceName, ref handle, unknown);
|
|
}
|
|
|
|
public static int SecureStartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, int flagsPassInZero, ref IntPtr handle)
|
|
{
|
|
return AMDeviceSecureStartService((IntPtr)device, (IntPtr)serviceName, flagsPassInZero, ref handle);
|
|
}
|
|
|
|
public static string ServiceConnectionReceive(IntPtr handle)
|
|
{
|
|
StringBuilder sb = new StringBuilder(1024);
|
|
AMDServiceConnectionReceive(handle, sb, sb.Capacity, 0);
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static int UninstallApplication(
|
|
TypedPtr<AppleMobileDeviceConnection> device,
|
|
TypedPtr<CFString> ApplicationIdentifier,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceUninstallApplication((IntPtr)device, (IntPtr)ApplicationIdentifier, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int SecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFString> ApplicationIdentifer,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceSecureUninstallApplication(serviceConnection, (IntPtr)DeviceIfConnIsNull, (IntPtr)ApplicationIdentifer, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int SecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceSecureInstallApplication(serviceConnection, (IntPtr)DeviceIfConnIsNull, (IntPtr)UrlPath, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int TransferApplication(
|
|
TypedPtr<AppleMobileDeviceConnection> device,
|
|
TypedPtr<CFString> InPackagePath,
|
|
IntPtr UnknownButUnused,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceTransferApplication((IntPtr)device, (IntPtr)InPackagePath, UnknownButUnused, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int SecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceSecureUpgradeApplication(ServiceConnection, (IntPtr)DeviceIfConnIsNull, (IntPtr)UrlPath, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int InstallApplication(
|
|
TypedPtr<AppleMobileDeviceConnection> device,
|
|
TypedPtr<CFString> FilePath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceInstallApplication((IntPtr)device, (IntPtr)FilePath, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int NotificationSubscribe(DeviceNotificationCallback DeviceCallbackHandle)
|
|
{
|
|
IntPtr notification;
|
|
return AMDeviceNotificationSubscribe(DeviceCallbackHandle, 0, 0, 0, out notification);
|
|
}
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static IntPtr AMDeviceCopyDeviceIdentifier(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceConnect(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static IntPtr AMDeviceCopyValue(IntPtr/*AppleMobileDeviceConnection*/ device, uint unknown, IntPtr/*CFString*/ cfstring);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceDisconnect(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceGetConnectionID(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceIsPaired(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDevicePair(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceUnpair(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceValidatePairing(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceLookupApplications(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr options, ref IntPtr appBundles);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceNotificationSubscribe(DeviceNotificationCallback callback, uint unused1, uint unused2, uint unused3, out IntPtr am_device_notification_ptr);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStartHouseArrestService(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr/*CFString*/ bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStartService(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr/*CFString*/ serviceName, ref IntPtr handle, IntPtr unknown);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureStartService(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr/*CFString*/ serviceName, int flagsPassInZero, ref IntPtr handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDServiceConnectionReceive(IntPtr handle, StringBuilder buffer, int bufferLen, int unknown);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStartSession(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStopSession(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMRestoreModeDeviceCreate(uint unknown0, int connection_id, uint unknown1);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
public extern static int AMRestoreRegisterForDeviceNotifications(
|
|
DeviceRestoreNotificationCallback dfu_connect,
|
|
DeviceRestoreNotificationCallback recovery_connect,
|
|
DeviceRestoreNotificationCallback dfu_disconnect,
|
|
DeviceRestoreNotificationCallback recovery_disconnect,
|
|
uint unknown0,
|
|
IntPtr user_info);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceUninstallApplication(
|
|
IntPtr/*AppleMobileDeviceConnection*/ device,
|
|
IntPtr/*CFString*/ ApplicationIdentifier,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
IntPtr/*AppleMobileDeviceConnection*/ DeviceIfConnIsNull,
|
|
IntPtr/*CFString*/ ApplicationIdentifer,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
IntPtr/*AppleMobileDeviceConnection*/ DeviceIfConnIsNull,
|
|
IntPtr/*CFURL*/ UrlPath,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceTransferApplication(
|
|
IntPtr/*AppleMobileDeviceConnection*/ device,
|
|
IntPtr/*CFString*/ InPackagePath,
|
|
IntPtr UnknownButUnused,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
IntPtr/*AppleMobileDeviceConnection*/ DeviceIfConnIsNull,
|
|
IntPtr/*CFURL*/ UrlPath,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceInstallApplication(
|
|
IntPtr/*AppleMobileDeviceConnection*/ device,
|
|
IntPtr/*CFString*/ FilePath,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
// the unknown goes into the 4th dword in the connection struct. if non-zero, winsock send() won't get called in AMDServiceConnectionSend AFAIK
|
|
// the only option is "CloseOnInvalidate" (CFBoolean type, defaults to false)
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static IntPtr AMDServiceConnectionCreate(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr UnknownTypically0, IntPtr OptionsDictionary);
|
|
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMSBeginSync(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr OuterIn8, IntPtr OuterIn12, IntPtr OuterIn16);
|
|
}
|
|
#endregion
|
|
|
|
#region AFC Operations
|
|
|
|
public int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref string buffer)
|
|
{
|
|
int ret;
|
|
|
|
IntPtr ptr = IntPtr.Zero;
|
|
ret = AFC.DirectoryRead((IntPtr)conn, dir, ref ptr);
|
|
if ((ret == 0) && (ptr != IntPtr.Zero))
|
|
{
|
|
buffer = Marshal.PtrToStringAnsi(ptr);
|
|
}
|
|
else
|
|
{
|
|
buffer = null;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
public class AFC
|
|
{
|
|
public static int ConnectionClose(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFCConnectionClose((IntPtr)conn);
|
|
}
|
|
|
|
public static int ConnectionInvalidate(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFCConnectionInvalidate((IntPtr)conn);
|
|
}
|
|
|
|
public static int ConnectionIsValid(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFCConnectionIsValid((IntPtr)conn);
|
|
}
|
|
|
|
public static int ConnectionOpen(IntPtr handle, uint io_timeout, out TypedPtr<AFCCommConnection> OutConn)
|
|
{
|
|
IntPtr Conn;
|
|
int Result = AFCConnectionOpen(handle, io_timeout, out Conn);
|
|
OutConn = Conn;
|
|
return Result;
|
|
}
|
|
|
|
public static int DeviceInfoOpen(IntPtr handle, ref IntPtr dict)
|
|
{
|
|
return AFCDeviceInfoOpen(handle, ref dict);
|
|
}
|
|
|
|
public static int DirectoryClose(TypedPtr<AFCCommConnection> conn, IntPtr dir)
|
|
{
|
|
return AFCDirectoryClose((IntPtr)conn, dir);
|
|
}
|
|
|
|
public static int DirectoryCreate(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFCDirectoryCreate((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path));
|
|
}
|
|
|
|
public static int DirectoryOpen(TypedPtr<AFCCommConnection> conn, string path, ref IntPtr dir)
|
|
{
|
|
return AFCDirectoryOpen((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path), ref dir);
|
|
}
|
|
|
|
public static int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref IntPtr dirent)
|
|
{
|
|
return AFCDirectoryRead((IntPtr)conn, dir, ref dirent);
|
|
}
|
|
|
|
public static int FileInfoOpen(TypedPtr<AFCCommConnection> conn, string path, out TypedPtr<AFCDictionary> OutDict)
|
|
{
|
|
IntPtr UntypedDict;
|
|
int Result = AFCFileInfoOpen((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path), out UntypedDict);
|
|
OutDict = UntypedDict;
|
|
|
|
return Result;
|
|
}
|
|
|
|
public static int FileRefClose(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFCFileRefClose((IntPtr)conn, handle);
|
|
}
|
|
|
|
public static int FileRefOpen(TypedPtr<AFCCommConnection> conn, string path, Int64 mode, out Int64 handle)
|
|
{
|
|
return AFCFileRefOpen((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path), mode, out handle);
|
|
}
|
|
|
|
public static int FileRefRead(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, ref uint len)
|
|
{
|
|
return AFCFileRefRead((IntPtr)conn, handle, buffer, ref len);
|
|
}
|
|
|
|
public static int FileRefSetFileSize(TypedPtr<AFCCommConnection> conn, Int64 handle, uint size)
|
|
{
|
|
return AFCFileRefSetFileSize((IntPtr)conn, handle, size);
|
|
}
|
|
|
|
public static int FileRefSeek(TypedPtr<AFCCommConnection> conn, Int64 handle, Int64 pos, Int64 origin)
|
|
{
|
|
return AFCFileRefSeek((IntPtr)conn, handle, pos, origin);
|
|
}
|
|
|
|
public static int FileRefTell(TypedPtr<AFCCommConnection> conn, Int64 handle, ref uint position)
|
|
{
|
|
return AFCFileRefTell((IntPtr)conn, handle, ref position);
|
|
}
|
|
|
|
public static int FileRefWrite(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, uint len)
|
|
{
|
|
return AFCFileRefWrite((IntPtr)conn, handle, buffer, len);
|
|
}
|
|
|
|
public static int FlushData(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFCFlushData((IntPtr)conn, handle);
|
|
}
|
|
|
|
public static int KeyValueClose(TypedPtr<AFCDictionary> dict)
|
|
{
|
|
return AFCKeyValueClose((IntPtr)dict);
|
|
}
|
|
|
|
public static int KeyValueRead(TypedPtr<AFCDictionary> dict, out IntPtr key, out IntPtr val)
|
|
{
|
|
return AFCKeyValueRead((IntPtr)dict, out key, out val);
|
|
}
|
|
|
|
public static int RemovePath(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFCRemovePath((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path));
|
|
}
|
|
|
|
public static int RenamePath(TypedPtr<AFCCommConnection> conn, string OldPath, string NewPath)
|
|
{
|
|
return AFCRenamePath((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(OldPath), MobileDevice.StringToFileSystemRepresentation(NewPath));
|
|
}
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionClose(IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionInvalidate(IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionIsValid(IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionOpen(IntPtr handle, uint io_timeout, out IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDeviceInfoOpen(IntPtr handle, ref IntPtr dict);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryClose(IntPtr/*AFCCommConnection*/ conn, IntPtr dir);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryCreate(IntPtr/*AFCCommConnection*/ conn, byte[] path);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryOpen(IntPtr/*AFCCommConnection*/ conn, byte[] path, ref IntPtr dir);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryRead(IntPtr/*AFCCommConnection*/ conn, IntPtr dir, ref IntPtr dirent);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileInfoOpen(IntPtr/*AFCCommConnection*/ conn, byte[] path, out IntPtr OutDict);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefClose(IntPtr/*AFCCommConnection*/ conn, Int64 handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefOpen(IntPtr/*AFCCommConnection*/ conn, byte[] path, Int64 mode, out Int64 handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefRead(IntPtr/*AFCCommConnection*/ conn, Int64 handle, byte[] buffer, ref uint len);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefSeek(IntPtr/*AFCCommConnection*/ conn, Int64 handle, Int64 pos, Int64 origin);
|
|
|
|
// FIXME - not working, arguments?
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
public extern static int AFCFileRefSetFileSize(IntPtr/*AFCCommConnection*/ conn, Int64 handle, uint size);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefTell(IntPtr/*AFCCommConnection*/ conn, Int64 handle, ref uint position);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefWrite(IntPtr/*AFCCommConnection*/ conn, Int64 handle, byte[] buffer, uint len);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFlushData(IntPtr/*AFCCommConnection*/ conn, Int64 handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCKeyValueClose(IntPtr dict);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCKeyValueRead(IntPtr dict, out IntPtr key, out IntPtr val);
|
|
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCRemovePath(IntPtr/*AFCCommConnection*/ conn, byte[] path);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCRenamePath(IntPtr/*AFCCommConnection*/ conn, byte[] old_path, byte[] new_path);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
internal class MobileDeviceWiniTunes12 : MobileDeviceImpl
|
|
{
|
|
// static readonly int ForceStaticInit = 42;
|
|
const string DLLName = @"MobileDevice.dll";
|
|
|
|
static MobileDeviceWiniTunes12()
|
|
{
|
|
List<string> PathBits = new List<string>();
|
|
|
|
// Try to add the paths from the registry (they aren't always available on newer iTunes installs though)
|
|
object RegistryDllPath = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Apple Inc.\Apple Mobile Device Support\Shared", "MobileDeviceDLL", DLLName);
|
|
if (RegistryDllPath != null)
|
|
{
|
|
FileInfo iTunesMobileDeviceFile = new FileInfo(RegistryDllPath.ToString());
|
|
|
|
if (iTunesMobileDeviceFile.Exists)
|
|
{
|
|
PathBits.Add(iTunesMobileDeviceFile.DirectoryName);
|
|
}
|
|
}
|
|
|
|
object RegistrySupportDir = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Apple Inc.\Apple Application Support", "InstallDir", Environment.CurrentDirectory);
|
|
if (RegistrySupportDir != null)
|
|
{
|
|
DirectoryInfo ApplicationSupportDirectory = new DirectoryInfo(RegistrySupportDir.ToString());
|
|
|
|
if (ApplicationSupportDirectory.Exists)
|
|
{
|
|
PathBits.Add(ApplicationSupportDirectory.FullName);
|
|
}
|
|
}
|
|
|
|
// Add some guesses as well
|
|
DirectoryInfo AppleMobileDeviceSupport = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles) + @"\Apple\Mobile Device Support");
|
|
if (AppleMobileDeviceSupport.Exists)
|
|
{
|
|
PathBits.Add(AppleMobileDeviceSupport.FullName);
|
|
}
|
|
|
|
DirectoryInfo AppleMobileDeviceSupportX86 = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86) + @"\Apple\Mobile Device Support");
|
|
if ((AppleMobileDeviceSupport != AppleMobileDeviceSupportX86) && (AppleMobileDeviceSupportX86.Exists))
|
|
{
|
|
PathBits.Add(AppleMobileDeviceSupportX86.FullName);
|
|
}
|
|
|
|
// add the rest of the path
|
|
PathBits.Add(Environment.GetEnvironmentVariable("Path"));
|
|
|
|
// Set the path from all the individual bits
|
|
Environment.SetEnvironmentVariable("Path", string.Join(";", PathBits));
|
|
}
|
|
|
|
public int NotificationSubscribe(DeviceNotificationCallback DeviceCallbackHandle)
|
|
{
|
|
return AMDeviceMethods.NotificationSubscribe(DeviceCallbackHandle);
|
|
}
|
|
|
|
public IntPtr CopyDeviceIdentifier(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.CopyDeviceIdentifier(device);
|
|
}
|
|
|
|
public int Connect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Connect(device);
|
|
}
|
|
|
|
public IntPtr CopyValue(TypedPtr<AppleMobileDeviceConnection> device, uint unknown, TypedPtr<CFString> cfstring)
|
|
{
|
|
return AMDeviceMethods.CopyValue(device, unknown, cfstring);
|
|
}
|
|
|
|
public int Disconnect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Disconnect(device);
|
|
}
|
|
|
|
public int GetConnectionID(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.GetConnectionID(device);
|
|
}
|
|
|
|
public int IsPaired(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.IsPaired(device);
|
|
}
|
|
|
|
public int Pair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Pair(device);
|
|
}
|
|
|
|
public int Unpair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.Unpair(device);
|
|
}
|
|
|
|
public int ValidatePairing(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.ValidatePairing(device);
|
|
}
|
|
|
|
public int LookupApplications(TypedPtr<AppleMobileDeviceConnection> device, IntPtr options, out Dictionary<string, object> AppBundles)
|
|
{
|
|
int Result = AMDeviceMethods.LookupApplications(device, options, out AppBundles);
|
|
return Result;
|
|
}
|
|
|
|
public int StartSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.StartSession((IntPtr)device);
|
|
}
|
|
|
|
public int StopSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceMethods.StopSession((IntPtr)device);
|
|
}
|
|
|
|
public int StartHouseArrestService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2)
|
|
{
|
|
return AMDeviceMethods.StartHouseArrestService((IntPtr)device, (IntPtr)bundleName, unknown1, ref handle, unknown2);
|
|
}
|
|
|
|
public int StartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, ref IntPtr handle, IntPtr unknown)
|
|
{
|
|
return AMDeviceMethods.StartService((IntPtr)device, (IntPtr)serviceName, ref handle, unknown);
|
|
}
|
|
|
|
public int SecureStartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, int flagsPassInZero, ref IntPtr handle)
|
|
{
|
|
return AMDeviceMethods.SecureStartService((IntPtr)device, (IntPtr)serviceName, flagsPassInZero, ref handle);
|
|
}
|
|
|
|
public string ServiceConnectionReceive(IntPtr handle)
|
|
{
|
|
return AMDeviceMethods.ServiceConnectionReceive(handle);
|
|
}
|
|
|
|
public int RestoreRegisterForDeviceNotifications(
|
|
DeviceRestoreNotificationCallback dfu_connect,
|
|
DeviceRestoreNotificationCallback recovery_connect,
|
|
DeviceRestoreNotificationCallback dfu_disconnect,
|
|
DeviceRestoreNotificationCallback recovery_disconnect,
|
|
uint unknown0,
|
|
IntPtr user_info)
|
|
{
|
|
return AMDeviceMethods.AMRestoreRegisterForDeviceNotifications(dfu_connect, recovery_connect, dfu_disconnect, recovery_disconnect, unknown0, user_info);
|
|
}
|
|
|
|
public int SecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFString> ApplicationIdentifer,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceMethods.SecureUninstallApplication(serviceConnection, DeviceIfConnIsNull, ApplicationIdentifer, ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public int SecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceMethods.SecureInstallApplication(serviceConnection, DeviceIfConnIsNull, UrlPath, ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public int SecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceMethods.SecureUpgradeApplication(ServiceConnection, DeviceIfConnIsNull, UrlPath, ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public int ConnectionClose(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFC.ConnectionClose(conn);
|
|
}
|
|
|
|
public int ConnectionInvalidate(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFC.ConnectionInvalidate(conn);
|
|
}
|
|
|
|
public int ConnectionIsValid(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFC.ConnectionIsValid(conn);
|
|
}
|
|
|
|
public int ConnectionOpen(IntPtr handle, uint io_timeout, out TypedPtr<AFCCommConnection> OutConn)
|
|
{
|
|
return AFC.ConnectionOpen(handle, io_timeout, out OutConn);
|
|
}
|
|
|
|
public int DeviceInfoOpen(IntPtr handle, ref IntPtr dict)
|
|
{
|
|
return AFC.DeviceInfoOpen(handle, ref dict);
|
|
}
|
|
|
|
public int DirectoryClose(TypedPtr<AFCCommConnection> conn, IntPtr dir)
|
|
{
|
|
return AFC.DirectoryClose(conn, dir);
|
|
}
|
|
|
|
public int DirectoryCreate(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFC.DirectoryCreate(conn, path);
|
|
}
|
|
|
|
public int DirectoryOpen(TypedPtr<AFCCommConnection> conn, string path, ref IntPtr dir)
|
|
{
|
|
return AFC.DirectoryOpen(conn, path, ref dir);
|
|
}
|
|
|
|
public int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref IntPtr dirent)
|
|
{
|
|
return AFC.DirectoryRead(conn, dir, ref dirent);
|
|
}
|
|
|
|
public int FileInfoOpen(TypedPtr<AFCCommConnection> conn, string path, out TypedPtr<AFCDictionary> OutDict)
|
|
{
|
|
return AFC.FileInfoOpen(conn, path, out OutDict);
|
|
}
|
|
|
|
public int FileRefClose(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFC.FileRefClose(conn, handle);
|
|
}
|
|
|
|
public int FileRefOpen(TypedPtr<AFCCommConnection> conn, string path, Int64 mode, out Int64 handle)
|
|
{
|
|
return AFC.FileRefOpen(conn, path, mode, out handle);
|
|
}
|
|
|
|
public int FileRefRead(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, ref uint len)
|
|
{
|
|
return AFC.FileRefRead(conn, handle, buffer, ref len);
|
|
}
|
|
|
|
public int FileRefSeek(TypedPtr<AFCCommConnection> conn, Int64 handle, Int64 pos, Int64 origin)
|
|
{
|
|
return AFC.FileRefSeek(conn, handle, pos, origin);
|
|
}
|
|
|
|
public int FileRefSetFileSize(TypedPtr<AFCCommConnection> conn, Int64 handle, uint size)
|
|
{
|
|
return AFC.FileRefSetFileSize(conn, handle, size);
|
|
}
|
|
|
|
public int FileRefTell(TypedPtr<AFCCommConnection> conn, Int64 handle, ref uint position)
|
|
{
|
|
return AFC.FileRefTell(conn, handle, ref position);
|
|
}
|
|
|
|
public int FileRefWrite(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, uint len)
|
|
{
|
|
return AFC.FileRefWrite(conn, handle, buffer, len);
|
|
}
|
|
|
|
public int FlushData(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFC.FlushData(conn, handle);
|
|
}
|
|
|
|
public int KeyValueClose(TypedPtr<AFCDictionary> dict)
|
|
{
|
|
return AFC.KeyValueClose(dict);
|
|
}
|
|
|
|
public int KeyValueRead(TypedPtr<AFCDictionary> dict, out IntPtr key, out IntPtr val)
|
|
{
|
|
return AFC.KeyValueRead(dict, out key, out val);
|
|
}
|
|
|
|
public int RemovePath(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFC.RemovePath(conn, path);
|
|
}
|
|
|
|
public int RenamePath(TypedPtr<AFCCommConnection> conn, string OldPath, string NewPath)
|
|
{
|
|
return AFC.RenamePath(conn, OldPath, NewPath);
|
|
}
|
|
|
|
#region Application Methods
|
|
public class AMDeviceMethods
|
|
{
|
|
// Need to have the path manipulation code in static MobileDevice() to run
|
|
// static int ForceMobileDeviceConstructorToRun;
|
|
static AMDeviceMethods()
|
|
{
|
|
// ForceMobileDeviceConstructorToRun = ForceStaticInit;
|
|
}
|
|
|
|
public static IntPtr CopyDeviceIdentifier(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceCopyDeviceIdentifier((IntPtr)device);
|
|
}
|
|
|
|
public static int Connect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceConnect((IntPtr)device);
|
|
}
|
|
|
|
public static IntPtr CopyValue(TypedPtr<AppleMobileDeviceConnection> device, uint unknown, TypedPtr<CFString> cfstring)
|
|
{
|
|
return AMDeviceCopyValue((IntPtr)device, unknown, (IntPtr)cfstring);
|
|
}
|
|
|
|
public static int Disconnect(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceDisconnect((IntPtr)device);
|
|
}
|
|
|
|
public static int GetConnectionID(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceGetConnectionID((IntPtr)device);
|
|
}
|
|
|
|
public static int IsPaired(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceIsPaired((IntPtr)device);
|
|
}
|
|
|
|
public static int Pair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDevicePair((IntPtr)device);
|
|
}
|
|
|
|
public static int Unpair(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceUnpair((IntPtr)device);
|
|
}
|
|
|
|
public static int ValidatePairing(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceValidatePairing((IntPtr)device);
|
|
}
|
|
|
|
public static int LookupApplications(TypedPtr<AppleMobileDeviceConnection> device, IntPtr options, out Dictionary<string, object> AppBundles)
|
|
{
|
|
IntPtr UntypedDict = IntPtr.Zero;
|
|
int Result = AMDeviceLookupApplications((IntPtr)device, options, ref UntypedDict);
|
|
|
|
AppBundles = MobileDevice.ConvertCFDictionaryToDictionaryString(new TypedPtr<CFDictionary>(UntypedDict));
|
|
|
|
return Result;
|
|
}
|
|
|
|
public static int StartSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceStartSession((IntPtr)device);
|
|
}
|
|
|
|
public static int StopSession(TypedPtr<AppleMobileDeviceConnection> device)
|
|
{
|
|
return AMDeviceStopSession((IntPtr)device);
|
|
}
|
|
|
|
public static int StartHouseArrestService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2)
|
|
{
|
|
return AMDeviceStartHouseArrestService((IntPtr)device, (IntPtr)bundleName, unknown1, ref handle, unknown2);
|
|
}
|
|
|
|
public static int StartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, ref IntPtr handle, IntPtr unknown)
|
|
{
|
|
return AMDeviceStartService((IntPtr)device, (IntPtr)serviceName, ref handle, unknown);
|
|
}
|
|
|
|
public static int SecureStartService(TypedPtr<AppleMobileDeviceConnection> device, TypedPtr<CFString> serviceName, int flagsPassInZero, ref IntPtr handle)
|
|
{
|
|
return AMDeviceSecureStartService((IntPtr)device, (IntPtr)serviceName, flagsPassInZero, ref handle);
|
|
}
|
|
|
|
public static string ServiceConnectionReceive(IntPtr handle)
|
|
{
|
|
StringBuilder sb = new StringBuilder(1024);
|
|
AMDServiceConnectionReceive(handle, sb, sb.Capacity, 0);
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static int UninstallApplication(
|
|
TypedPtr<AppleMobileDeviceConnection> device,
|
|
TypedPtr<CFString> ApplicationIdentifier,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceUninstallApplication((IntPtr)device, (IntPtr)ApplicationIdentifier, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int SecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFString> ApplicationIdentifer,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceSecureUninstallApplication(serviceConnection, (IntPtr)DeviceIfConnIsNull, (IntPtr)ApplicationIdentifer, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int SecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceSecureInstallApplication(serviceConnection, (IntPtr)DeviceIfConnIsNull, (IntPtr)UrlPath, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int TransferApplication(
|
|
TypedPtr<AppleMobileDeviceConnection> device,
|
|
TypedPtr<CFString> InPackagePath,
|
|
IntPtr UnknownButUnused,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceTransferApplication((IntPtr)device, (IntPtr)InPackagePath, UnknownButUnused, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int SecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
TypedPtr<AppleMobileDeviceConnection> DeviceIfConnIsNull,
|
|
TypedPtr<CFURL> UrlPath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceSecureUpgradeApplication(ServiceConnection, (IntPtr)DeviceIfConnIsNull, (IntPtr)UrlPath, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int InstallApplication(
|
|
TypedPtr<AppleMobileDeviceConnection> device,
|
|
TypedPtr<CFString> FilePath,
|
|
TypedPtr<CFDictionary> ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData)
|
|
{
|
|
return AMDeviceInstallApplication((IntPtr)device, (IntPtr)FilePath, (IntPtr)ClientOptions, ProgressCallback, UserData);
|
|
}
|
|
|
|
public static int NotificationSubscribe(DeviceNotificationCallback DeviceCallbackHandle)
|
|
{
|
|
IntPtr notification;
|
|
return AMDeviceNotificationSubscribe(DeviceCallbackHandle, 0, 0, 0, out notification);
|
|
}
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static IntPtr AMDeviceCopyDeviceIdentifier(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceConnect(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static IntPtr AMDeviceCopyValue(IntPtr/*AppleMobileDeviceConnection*/ device, uint unknown, IntPtr/*CFString*/ cfstring);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceDisconnect(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceGetConnectionID(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceIsPaired(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDevicePair(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceUnpair(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceValidatePairing(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceLookupApplications(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr options, ref IntPtr appBundles);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceNotificationSubscribe(DeviceNotificationCallback callback, uint unused1, uint unused2, uint unused3, out IntPtr am_device_notification_ptr);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStartHouseArrestService(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr/*CFString*/ bundleName, IntPtr unknown1, ref IntPtr handle, int unknown2);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStartService(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr/*CFString*/ serviceName, ref IntPtr handle, IntPtr unknown);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureStartService(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr/*CFString*/ serviceName, int flagsPassInZero, ref IntPtr handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDServiceConnectionReceive(IntPtr handle, StringBuilder buffer, int bufferLen, int unknown);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStartSession(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceStopSession(IntPtr/*AppleMobileDeviceConnection*/ device);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMRestoreModeDeviceCreate(uint unknown0, int connection_id, uint unknown1);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
public extern static int AMRestoreRegisterForDeviceNotifications(
|
|
DeviceRestoreNotificationCallback dfu_connect,
|
|
DeviceRestoreNotificationCallback recovery_connect,
|
|
DeviceRestoreNotificationCallback dfu_disconnect,
|
|
DeviceRestoreNotificationCallback recovery_disconnect,
|
|
uint unknown0,
|
|
IntPtr user_info);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceUninstallApplication(
|
|
IntPtr/*AppleMobileDeviceConnection*/ device,
|
|
IntPtr/*CFString*/ ApplicationIdentifier,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureUninstallApplication(
|
|
IntPtr serviceConnection,
|
|
IntPtr/*AppleMobileDeviceConnection*/ DeviceIfConnIsNull,
|
|
IntPtr/*CFString*/ ApplicationIdentifer,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureInstallApplication(
|
|
IntPtr serviceConnection,
|
|
IntPtr/*AppleMobileDeviceConnection*/ DeviceIfConnIsNull,
|
|
IntPtr/*CFURL*/ UrlPath,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceTransferApplication(
|
|
IntPtr/*AppleMobileDeviceConnection*/ device,
|
|
IntPtr/*CFString*/ InPackagePath,
|
|
IntPtr UnknownButUnused,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceSecureUpgradeApplication(
|
|
IntPtr ServiceConnection,
|
|
IntPtr/*AppleMobileDeviceConnection*/ DeviceIfConnIsNull,
|
|
IntPtr/*CFURL*/ UrlPath,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMDeviceInstallApplication(
|
|
IntPtr/*AppleMobileDeviceConnection*/ device,
|
|
IntPtr/*CFString*/ FilePath,
|
|
IntPtr/*CFDictionary*/ ClientOptions,
|
|
DeviceInstallationCallback ProgressCallback,
|
|
IntPtr UserData);
|
|
|
|
// the unknown goes into the 4th dword in the connection struct. if non-zero, winsock send() won't get called in AMDServiceConnectionSend AFAIK
|
|
// the only option is "CloseOnInvalidate" (CFBoolean type, defaults to false)
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static IntPtr AMDServiceConnectionCreate(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr UnknownTypically0, IntPtr OptionsDictionary);
|
|
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AMSBeginSync(IntPtr/*AppleMobileDeviceConnection*/ device, IntPtr OuterIn8, IntPtr OuterIn12, IntPtr OuterIn16);
|
|
}
|
|
#endregion
|
|
|
|
#region AFC Operations
|
|
|
|
public int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref string buffer)
|
|
{
|
|
int ret;
|
|
|
|
IntPtr ptr = IntPtr.Zero;
|
|
ret = AFC.DirectoryRead((IntPtr)conn, dir, ref ptr);
|
|
if ((ret == 0) && (ptr != IntPtr.Zero))
|
|
{
|
|
buffer = Marshal.PtrToStringAnsi(ptr);
|
|
}
|
|
else
|
|
{
|
|
buffer = null;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
public class AFC
|
|
{
|
|
public static int ConnectionClose(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFCConnectionClose((IntPtr)conn);
|
|
}
|
|
|
|
public static int ConnectionInvalidate(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFCConnectionInvalidate((IntPtr)conn);
|
|
}
|
|
|
|
public static int ConnectionIsValid(TypedPtr<AFCCommConnection> conn)
|
|
{
|
|
return AFCConnectionIsValid((IntPtr)conn);
|
|
}
|
|
|
|
public static int ConnectionOpen(IntPtr handle, uint io_timeout, out TypedPtr<AFCCommConnection> OutConn)
|
|
{
|
|
IntPtr Conn;
|
|
int Result = AFCConnectionOpen(handle, io_timeout, out Conn);
|
|
OutConn = Conn;
|
|
return Result;
|
|
}
|
|
|
|
public static int DeviceInfoOpen(IntPtr handle, ref IntPtr dict)
|
|
{
|
|
return AFCDeviceInfoOpen(handle, ref dict);
|
|
}
|
|
|
|
public static int DirectoryClose(TypedPtr<AFCCommConnection> conn, IntPtr dir)
|
|
{
|
|
return AFCDirectoryClose((IntPtr)conn, dir);
|
|
}
|
|
|
|
public static int DirectoryCreate(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFCDirectoryCreate((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path));
|
|
}
|
|
|
|
public static int DirectoryOpen(TypedPtr<AFCCommConnection> conn, string path, ref IntPtr dir)
|
|
{
|
|
return AFCDirectoryOpen((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path), ref dir);
|
|
}
|
|
|
|
public static int DirectoryRead(TypedPtr<AFCCommConnection> conn, IntPtr dir, ref IntPtr dirent)
|
|
{
|
|
return AFCDirectoryRead((IntPtr)conn, dir, ref dirent);
|
|
}
|
|
|
|
public static int FileInfoOpen(TypedPtr<AFCCommConnection> conn, string path, out TypedPtr<AFCDictionary> OutDict)
|
|
{
|
|
IntPtr UntypedDict;
|
|
int Result = AFCFileInfoOpen((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path), out UntypedDict);
|
|
OutDict = UntypedDict;
|
|
|
|
return Result;
|
|
}
|
|
|
|
public static int FileRefClose(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFCFileRefClose((IntPtr)conn, handle);
|
|
}
|
|
|
|
public static int FileRefOpen(TypedPtr<AFCCommConnection> conn, string path, Int64 mode, out Int64 handle)
|
|
{
|
|
return AFCFileRefOpen((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path), mode, out handle);
|
|
}
|
|
|
|
public static int FileRefRead(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, ref uint len)
|
|
{
|
|
return AFCFileRefRead((IntPtr)conn, handle, buffer, ref len);
|
|
}
|
|
|
|
public static int FileRefSetFileSize(TypedPtr<AFCCommConnection> conn, Int64 handle, uint size)
|
|
{
|
|
return AFCFileRefSetFileSize((IntPtr)conn, handle, size);
|
|
}
|
|
|
|
public static int FileRefSeek(TypedPtr<AFCCommConnection> conn, Int64 handle, Int64 pos, Int64 origin)
|
|
{
|
|
return AFCFileRefSeek((IntPtr)conn, handle, pos, origin);
|
|
}
|
|
|
|
public static int FileRefTell(TypedPtr<AFCCommConnection> conn, Int64 handle, ref uint position)
|
|
{
|
|
return AFCFileRefTell((IntPtr)conn, handle, ref position);
|
|
}
|
|
|
|
public static int FileRefWrite(TypedPtr<AFCCommConnection> conn, Int64 handle, byte[] buffer, uint len)
|
|
{
|
|
return AFCFileRefWrite((IntPtr)conn, handle, buffer, len);
|
|
}
|
|
|
|
public static int FlushData(TypedPtr<AFCCommConnection> conn, Int64 handle)
|
|
{
|
|
return AFCFlushData((IntPtr)conn, handle);
|
|
}
|
|
|
|
public static int KeyValueClose(TypedPtr<AFCDictionary> dict)
|
|
{
|
|
return AFCKeyValueClose((IntPtr)dict);
|
|
}
|
|
|
|
public static int KeyValueRead(TypedPtr<AFCDictionary> dict, out IntPtr key, out IntPtr val)
|
|
{
|
|
return AFCKeyValueRead((IntPtr)dict, out key, out val);
|
|
}
|
|
|
|
public static int RemovePath(TypedPtr<AFCCommConnection> conn, string path)
|
|
{
|
|
return AFCRemovePath((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(path));
|
|
}
|
|
|
|
public static int RenamePath(TypedPtr<AFCCommConnection> conn, string OldPath, string NewPath)
|
|
{
|
|
return AFCRenamePath((IntPtr)conn, MobileDevice.StringToFileSystemRepresentation(OldPath), MobileDevice.StringToFileSystemRepresentation(NewPath));
|
|
}
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionClose(IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionInvalidate(IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionIsValid(IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCConnectionOpen(IntPtr handle, uint io_timeout, out IntPtr/*AFCCommConnection*/ conn);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDeviceInfoOpen(IntPtr handle, ref IntPtr dict);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryClose(IntPtr/*AFCCommConnection*/ conn, IntPtr dir);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryCreate(IntPtr/*AFCCommConnection*/ conn, byte[] path);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryOpen(IntPtr/*AFCCommConnection*/ conn, byte[] path, ref IntPtr dir);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCDirectoryRead(IntPtr/*AFCCommConnection*/ conn, IntPtr dir, ref IntPtr dirent);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileInfoOpen(IntPtr/*AFCCommConnection*/ conn, byte[] path, out IntPtr OutDict);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefClose(IntPtr/*AFCCommConnection*/ conn, Int64 handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefOpen(IntPtr/*AFCCommConnection*/ conn, byte[] path, Int64 mode, out Int64 handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefRead(IntPtr/*AFCCommConnection*/ conn, Int64 handle, byte[] buffer, ref uint len);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefSeek(IntPtr/*AFCCommConnection*/ conn, Int64 handle, Int64 pos, Int64 origin);
|
|
|
|
// FIXME - not working, arguments?
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
public extern static int AFCFileRefSetFileSize(IntPtr/*AFCCommConnection*/ conn, Int64 handle, uint size);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefTell(IntPtr/*AFCCommConnection*/ conn, Int64 handle, ref uint position);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFileRefWrite(IntPtr/*AFCCommConnection*/ conn, Int64 handle, byte[] buffer, uint len);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCFlushData(IntPtr/*AFCCommConnection*/ conn, Int64 handle);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCKeyValueClose(IntPtr dict);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCKeyValueRead(IntPtr dict, out IntPtr key, out IntPtr val);
|
|
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCRemovePath(IntPtr/*AFCCommConnection*/ conn, byte[] path);
|
|
|
|
[DllImport(DLLName, CallingConvention = CallingConvention.Cdecl)]
|
|
private extern static int AFCRenamePath(IntPtr/*AFCCommConnection*/ conn, byte[] old_path, byte[] new_path);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
internal partial class MobileDevice
|
|
{
|
|
static public MobileDeviceImpl DeviceImpl = null;
|
|
|
|
static MobileDevice()
|
|
{
|
|
if (Environment.OSVersion.Platform == PlatformID.MacOSX || Environment.OSVersion.Platform == PlatformID.Unix)
|
|
{
|
|
DeviceImpl = new MobileDeviceOSX();
|
|
}
|
|
else
|
|
{
|
|
string dllPath11 = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Apple Inc.\\Apple Mobile Device Support\\Shared", "iTunesMobileDeviceDLL", null) as string;
|
|
string dllPath12 = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Apple Inc.\\Apple Mobile Device Support\\Shared", "MobileDeviceDLL", null) as string;
|
|
if (!String.IsNullOrEmpty(dllPath12) && File.Exists(dllPath12))
|
|
{
|
|
DeviceImpl = new MobileDeviceWiniTunes12();
|
|
}
|
|
else if (!String.IsNullOrEmpty(dllPath11) && File.Exists(dllPath11))
|
|
{
|
|
DeviceImpl = new MobileDeviceWiniTunes11();
|
|
}
|
|
}
|
|
|
|
// Initialize the CoreFoundation bindings
|
|
InitializeCoreFoundation();
|
|
}
|
|
|
|
/*
|
|
Valid Value Names:
|
|
ActivationState
|
|
ActivationStateAcknowledged
|
|
BasebandBootloaderVersion
|
|
BasebandVersion
|
|
BluetoothAddress
|
|
BuildVersion
|
|
DeviceCertificate
|
|
DeviceClass
|
|
DeviceName
|
|
DevicePublicKey
|
|
FirmwareVersion
|
|
HostAttached
|
|
IntegratedCircuitCardIdentity
|
|
InternationalMobileEquipmentIdentity
|
|
InternationalMobileSubscriberIdentity
|
|
ModelNumber
|
|
PhoneNumber
|
|
ProductType
|
|
ProductVersion
|
|
ProtocolVersion
|
|
RegionInfo
|
|
SBLockdownEverRegisteredKey
|
|
SIMStatus
|
|
SerialNumber
|
|
SomebodySetTimeZone
|
|
TimeIntervalSince1970
|
|
TimeZone
|
|
TimeZoneOffsetFromUTC
|
|
TrustedHostAttached
|
|
UniqueDeviceID
|
|
Uses24HourClock
|
|
WiFiAddress
|
|
iTunesHasConnected
|
|
*/
|
|
|
|
public static string AMDeviceCopyValue(TypedPtr<AppleMobileDeviceConnection> device, string name)
|
|
{
|
|
IntPtr result = DeviceImpl.CopyValue(device, 0, CFStringMakeConstantString(name));
|
|
if (result != IntPtr.Zero)
|
|
{
|
|
return MobileDevice.CFStringGetCString(result);
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine("Error: Call to AMDeviceCopyValue failed");
|
|
}
|
|
return String.Empty;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns an error string
|
|
/// </summary>
|
|
public static string GetErrorString(int ErrorValue)
|
|
{
|
|
string Result = GetSpecificErrorString(ErrorValue);
|
|
|
|
if (Result == null)
|
|
{
|
|
Result = String.Format("Unknown error 0x{0:X}", ErrorValue);
|
|
}
|
|
|
|
return Result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns a human readable description of the error from the mobile device or null if there isn't one
|
|
/// </summary>
|
|
public static string GetSpecificErrorString(int ErrorValue)
|
|
{
|
|
switch ((uint)ErrorValue)
|
|
{
|
|
case 0:
|
|
return "Success.";
|
|
|
|
case 0xE8000002:
|
|
return "Bad Header Error";
|
|
|
|
case 0xE8000003:
|
|
return "No Resources Error";
|
|
|
|
case 0xE8000004:
|
|
return "Read Error";
|
|
|
|
case 0xE8000005:
|
|
return "Write Error";
|
|
|
|
case 0xE8000006:
|
|
return "Unknown Packet Error";
|
|
|
|
case 0xE8000007:
|
|
return "Invalid Argument Error";
|
|
|
|
case 0xE8000008:
|
|
return "Not Found Error";
|
|
|
|
case 0xE8000009:
|
|
return "Is Directory Error";
|
|
|
|
case 0xE800000A:
|
|
return "Permission Error";
|
|
|
|
case 0xE800000B:
|
|
return "Not Connected Error";
|
|
|
|
case 0xE800000C:
|
|
return "Time Out Error";
|
|
|
|
case 0xE800000D:
|
|
return "Overrun Error";
|
|
|
|
case 0xE800000E:
|
|
return "EOF Error";
|
|
|
|
case 0xE800000F:
|
|
return "Unsupported Error";
|
|
|
|
case 0xE8000010:
|
|
return "File Exists Error";
|
|
|
|
case 0xE8000011:
|
|
return "Busy Error";
|
|
|
|
case 0xE8000012:
|
|
return "Crypto Error";
|
|
|
|
case 0xE8000013:
|
|
return "Invalid Response Error";
|
|
|
|
case 0xE8000014:
|
|
return "Missing Key Error";
|
|
|
|
case 0xE8000015:
|
|
return "Missing Value Error";
|
|
|
|
case 0xE8000016:
|
|
return "Get Prohibited Error";
|
|
|
|
case 0xE8000017:
|
|
return "Set Prohibited Error";
|
|
|
|
case 0xE8000018:
|
|
return "Time Out Error";
|
|
|
|
case 0xE8000019:
|
|
return "Immutable Value Error";
|
|
|
|
case 0xE800001A:
|
|
return "Password Protected Error";
|
|
|
|
case 0xE800001B:
|
|
return "Missing Host ID Error";
|
|
|
|
case 0xE800001C:
|
|
return "Invalid Host ID Error";
|
|
|
|
case 0xE800001D:
|
|
return "Session Active Error";
|
|
|
|
case 0xE800001E:
|
|
return "Session Inactive Error";
|
|
|
|
case 0xE800001F:
|
|
return "Missing Session ID Error";
|
|
|
|
case 0xE8000020:
|
|
return "Invalid Session ID Error";
|
|
|
|
case 0xE8000021:
|
|
return "Missing Service Error";
|
|
|
|
case 0xE8000022:
|
|
return "Invalid Service Error";
|
|
|
|
case 0xE8000023:
|
|
return "Invalid Checkin Error";
|
|
|
|
case 0xE8000024:
|
|
return "Checkin Timeout Error";
|
|
|
|
case 0xE8000025:
|
|
return "Missing Pair Record Error";
|
|
|
|
case 0xE8000026:
|
|
return "Invalid Activation Record Error";
|
|
|
|
case 0xE8000027:
|
|
return "Missing Activation Error";
|
|
|
|
case 0xE8000028:
|
|
return "Wrong Droid Error";
|
|
|
|
case 0xE8000029:
|
|
return "SU Verification Error";
|
|
|
|
case 0xE800002A:
|
|
return "SU Patch Error";
|
|
|
|
case 0xE800002B:
|
|
return "SU Firmware Error";
|
|
|
|
case 0xE800002C:
|
|
return "Provisioning Profile Not Valid";
|
|
|
|
case 0xE800002D:
|
|
return "Send Message Error";
|
|
|
|
case 0xE800002E:
|
|
return "Receive Message Error";
|
|
|
|
case 0xE800002F:
|
|
return "Missing Options Error";
|
|
|
|
case 0xE8000030:
|
|
return "Missing Image Type Error";
|
|
|
|
case 0xE8000031:
|
|
return "Digest Failed Error";
|
|
|
|
case 0xE8000032:
|
|
return "Start Service Error";
|
|
|
|
case 0xE8000033:
|
|
return "Invalid Disk Image Error";
|
|
|
|
case 0xE8000034:
|
|
return "Missing Digest Error";
|
|
|
|
case 0xE8000035:
|
|
return "Mux Error";
|
|
|
|
case 0xE8000036:
|
|
return "Application Already Installed Error";
|
|
|
|
case 0xE8000037:
|
|
return "Application Move Failed Error";
|
|
|
|
case 0xE8000038:
|
|
return "Application SINF Capture Failed Error";
|
|
|
|
case 0xE8000039:
|
|
return "Application Sandbox Failed Error";
|
|
|
|
case 0xE800003A:
|
|
return "Application Verification Failed Error";
|
|
|
|
case 0xE800003B:
|
|
return "Archive Destructor Failed Error";
|
|
|
|
case 0xE800003C:
|
|
return "Bundle Verification Failed Error";
|
|
|
|
case 0xE800003D:
|
|
return "Carrier Bundle Copy Failed Error";
|
|
|
|
case 0xE800003E:
|
|
return "Carrier Bundle Directory Creation Failed Error";
|
|
|
|
case 0xE800003F:
|
|
return "Carrier Bundle Missing Supported SIMs Error";
|
|
|
|
case 0xE8000040:
|
|
return "Comm Center Notification Failed Error";
|
|
|
|
case 0xE8000041:
|
|
return "COntainer Creation Failed Error";
|
|
|
|
case 0xE8000042:
|
|
return "Container P0wn Failed Error";
|
|
|
|
case 0xE8000043:
|
|
return "Container Removal Failed Error";
|
|
|
|
case 0xE8000044:
|
|
return "Embedded Profile Install Failed Error";
|
|
|
|
case 0xE8000045:
|
|
return "Error Error";
|
|
|
|
case 0xE8000046:
|
|
return "Executable Twiddle Failed Error";
|
|
|
|
case 0xE8000047:
|
|
return "Existence Check Failed Error";
|
|
|
|
case 0xE8000048:
|
|
return "Install Map Upfate Failed Error";
|
|
|
|
case 0xE8000049:
|
|
return "Manifest Capture Failed Error";
|
|
|
|
case 0xE800004A:
|
|
return "Map Generation Failed Error";
|
|
|
|
case 0xE800004B:
|
|
return "Missing Bundle Executable Error";
|
|
|
|
case 0xE800004C:
|
|
return "Missing Bundle Identifier Error";
|
|
|
|
case 0xE800004D:
|
|
return "Missing Bundle Path Error";
|
|
|
|
case 0xE800004E:
|
|
return "Missing Container Error";
|
|
|
|
case 0xE800004F:
|
|
return "Notification Failed Error";
|
|
|
|
case 0xE8000050:
|
|
return "Package Extraction Failed Error";
|
|
|
|
case 0xE8000051:
|
|
return "Package Inspection Failed Error";
|
|
|
|
case 0xE8000052:
|
|
return "Package Move Failed Error";
|
|
|
|
case 0xE8000053:
|
|
return "Path Conversion Failed Error";
|
|
|
|
case 0xE8000054:
|
|
return "Restore Container Failed Error";
|
|
|
|
case 0xE8000055:
|
|
return "Seatbelt Profile Removal Failed Error";
|
|
|
|
case 0xE8000056:
|
|
return "Stage Creation Failed Error";
|
|
|
|
case 0xE8000057:
|
|
return "Symlink Failed Error";
|
|
|
|
case 0xE8000058:
|
|
return "iTunes Artwork Capture Failed Error";
|
|
|
|
case 0xE8000059:
|
|
return "iTunes Metadata Capture Failed Error";
|
|
|
|
case 0xE800005A:
|
|
return "Already Archived Error";
|
|
|
|
case 0xE8000067:
|
|
return "Device not Included in Provisioning Profile (0xE8000067)";
|
|
|
|
case 0xE8008001:
|
|
return "Unknown code signature related error (0xE8008001); your executable may be missing or misnamed (e.g., underscore issue)";
|
|
|
|
case 0xE8008015:
|
|
return "No matching mobile provision for this application (0xE8008015). Please ensure the mobile provision used includes the target device.";
|
|
|
|
case 0xE8008016:
|
|
return "There is a problem with the entitlements for this application (0xE8008016).";
|
|
|
|
case 0xE8008017:
|
|
return "Unable to validate signature (there is a problem with a signed code resource) (0xE8008017)";
|
|
|
|
case 0xE8008018:
|
|
return "The identity used to sign the executable is no longer valid (0xE8008018)";
|
|
|
|
case 0xE8008019:
|
|
return "Missing or invalid code signature (0xE8008019)";
|
|
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|