5,597,501 Members 32,055 Now Online
XDA Developers Android and Mobile Development Forum

[XAP][SOURCE][ROOT] XapHandler (RELEASE for Root Tools or full-unlock!)

Tip us?
 
GoodDayToDie
Old
(Last edited by GoodDayToDie; 31st March 2012 at 04:20 PM.) Reason: Release version
#1  
Recognized Developer - OP
Thanks Meter 2473
Posts: 5,293
Join Date: Jan 2011
Location: Seattle
Exclamation [XAP][SOURCE][ROOT] XapHandler (RELEASE for Root Tools or full-unlock!)

Hi folks,

FIRST RELEASE:
Wow, lots of bugs that needed fixing. There are still some things I'd like to improve, but they can wait. This is officially the first release of XapHandler, for stock ROMs with WP7 Root Tools, and optionally for custom ROMs as well.

INSTRUCTIONS:
1) Install XapHandler.
2) Run WP7 Root Tools.
3) Pivot to Policies, and set XapHandler as trusted (stock ROMs only).
4) Run XapHandler.
5) When prompted to set the file association, hit OK.
6) Exit XapHandler.
7) Open a XAP file from email, IE, or an app.
8) Check the data about the app given in XapHandler.
9) If the app is already installed and you want to do a clean install, exit XapHanderl and delete the app from your phone normally, then open the XAP file again.
10) Hit the Clean Install or Update button.
11) Wait for the Success message box.
12) Close XapHandler.

SOURCE CODE:
I don't have permission to release the actual XAP installation source code, which is from @ultrashot. Therefore, the source release just contains a pre-compiled static library (it's the same code as is used in the native XAP installer on custom ROMs, and the Bazaar app). You're able to build the full app, though.

The app has two parts: the native ARM DLL that has the COM library and does the actual installation, and the C#/Silverlight WP7 app that provides the UI and calls the COM library. You should unpack both parts to the same folder. Then, build the native part first (requires Visual Studio 2008 with the Windows Mobile 6.5 compiler). This will copy the native DLL into the managed app. Make sure the managed app includes the COM DLL, and then build it to produce a XAP file.

PROBLEMS:
If you have any issues, please report the following info:
A) Your phone model.
B) Your ROM (including version and firmware)
C) The problems or exception messageboxes you encountered.

RESTORING THE REGISTRY:
For stock ROMs, if you want to put the registry back the way it was so XAP files open in the built-in XAP handler of your custom ROM:
1) Open a registry editor
2) Go to HKEY_CLASSES_ROOT (HKCR)\.xap
3) Change the default value back to what it used to be
3.1) The original value on most custom ROMs should be "xapfile" which is the same value the app uses; don't panic if it's unchanged!
3.2) The old default value *should* be backed up in a registry value simply called "0"
4) If there's a value called 0, delete it
5) Go to HKCR\<originalClassName>
5.1) For most people, that's HKCR\xapfile
6) Change the default value back to what it used to be
6.1) The original value on most custom ROMs should be empty
6.2) This step is not important; the value is cosmetic and intended for the user
6.3) The old default value *should* be backed up in a registry value simply called "0"
7) If there's a value called 0, delete it
8) If you have a registry key called BrowseInPlace (eg. HKCR\xapfile\BrowseInPlace) you can delete it
8.1) I don't *think* it'll hurt anything if left, though
9) Set the registry value EditFlags to DWORD 65536 (0x00010000)
9.1) This value is set by release versions of XapHandler
9.2) If the value is missing, create it with the data listed above
10) Go into the registry keys "shell", "open", and "command"
10.1) For example, HKCR\xapfile\shell\open\command
11) Change the default value back to what it used to be
11.1) The default value on most custom ROMs should be "XAPDeployer.exe "%1"" (remove first and last quotes)
11.3) The old default value *should* be backed up in a registry value simply called "0"
12) If there's a value called 0, delete it
13) If you had to change anything in step 3, go to HKCR
13.1) Don't do this step if you didn't have to change anything in step 3!
14) Delete HKCR\xapfile and all its contents
14.1) This step isn't needed, just cleanup
14.2) Don't do this step unless you had a different original progID than "xapfile"!

Have fun!

Please feel free to include this app in WP7 homebrew collections or custom ROMs, so long as the Author attribution is not removed.

Total downloads of the test versions: 330.
Attached Files
File Type: xap XapHandler.xap - [Click for QR Code] (71.0 KB, 28663 views)
File Type: zip XapHandler.zip - [Click for QR Code] (1.26 MB, 14989 views)
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.
The Following 27 Users Say Thank You to GoodDayToDie For This Useful Post: [ Click to Expand ]
 
GoodDayToDie
Old
#3  
Recognized Developer - OP
Thanks Meter 2473
Posts: 5,293
Join Date: Jan 2011
Location: Seattle
Big Thanks to useful reports, of course!

I'm also looking at releasing an app that allows people to edit their file associations on the phone - things like add new filetypes that will open in Word (works for any plain-text file), or do complex things like "open" a Mobi file by putting it in the Kindle app's isostore, then launching the Kindle app. That will build on some of the work done in this app. It's also related to some stuff for the next version of Root Webserver. I really want to figure out what's going on here, though...
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.
 
voluptuary
Old
#4  
voluptuary's Avatar
Senior Member
Thanks Meter 731
Posts: 939
Join Date: Dec 2010
Location: Mukwonago

 
DONATE TO ME
a.) Samsung Focus v1.3
b.) My ROM (see sig) firmware 2124.11.9.4
c.) xapfile
d.) no change, errors: system.io.filenotfoundexception the system can not find the specified at xaphandler.xapdeployerinterop.setfileassociation() and so on and on then crashes to home screen
e.) reboot changes nothing, no other steps apply.
My contributions:
Clean ROM for Samsung Focus v1.3, Nokia Lumia 800, and HTC HD2
Samsung Interop Unlock & Internet Sharing All-In-One for Windows Phone
Samsung Custom Theme & Accent Colors for Windows Phone
List of Windows Phone Unlocks by Type/OEM

Allstars that donated: RonV42, dark.angel

CURRENT DEVICES: HTC HD2, Nokia Lumia 800, Nokia N9, Apple iPhone 4, Nokia Lumia 920

Get a FREE 2GB Dropbox account plus we'll get a bonus 500MB!
The Following User Says Thank You to voluptuary For This Useful Post: [ Click to Expand ]
 
pdaimatejam
Old
#5  
pdaimatejam's Avatar
Recognized Developer
Thanks Meter 1746
Posts: 649
Join Date: Mar 2009
Location: Sinop/Boyabat

 
DONATE TO ME
I installed with my hd2 program
program did not work

19.Marc HD2 Pdaimatejam Rom Wp7.5 Tango 7.10.8773.98 v7.8 >FULLY UNLOCKED>CABS Update
 
ultrashot
Old
#6  
ultrashot's Avatar
Recognized Developer
Thanks Meter 2014
Posts: 1,469
Join Date: May 2009
Location: St.Petersburg
Mozart
5.13-based custom rom (fully unlocked of course)
FileNotFound exception when trying to associate, IndexOutOfRangeException when trying to launch xap (after manual association)
Attached Thumbnails
Click image for larger version

Name:	xaphandler-error.jpg
Views:	802
Size:	36.8 KB
ID:	955815  
Nokia Lumia 920, Samsung Ativ S (T899 TMOUS, engineering), HTC 8X (partially broken)
Mozart and Titan: Dynamics v2.2 ROM
X1i and HD2: Dynamics v2.4 ROM
http://ultrashot.net
The Following User Says Thank You to ultrashot For This Useful Post: [ Click to Expand ]
 
pdaimatejam
Old
#7  
pdaimatejam's Avatar
Recognized Developer
Thanks Meter 1746
Posts: 649
Join Date: Mar 2009
Location: Sinop/Boyabat

 
DONATE TO ME
Quote:
Originally Posted by ultrashot View Post
Mozart
5.13-based custom rom (fully unlocked of course)
FileNotFound exception when trying to associate, IndexOutOfRangeException when trying to launch xap (after manual association)
yes
I get the same error
 
GoodDayToDie
Old
#8  
Recognized Developer - OP
Thanks Meter 2473
Posts: 5,293
Join Date: Jan 2011
Location: Seattle
Thanks, guys. I know where the error is for you - I took a shortcut testing for the existence of certain registry entries and didn't check for FileNotFound, which I should have. Expect a new version in a day or so!
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.
 
ted973
Old
#9  
ted973's Avatar
Senior Member
Thanks Meter 62
Posts: 150
Join Date: Feb 2008
Location: Beijing
do you mean use xapdeploy.exe to install a xap?
i am Ego!
 
GoodDayToDie
Old
#10  
Recognized Developer - OP
Thanks Meter 2473
Posts: 5,293
Join Date: Jan 2011
Location: Seattle
XapDeploy.exe can't be used on stock ROMs until we break the policy system to allow homebrew executables. This app runs under TskHost.exe, like any other executable. Using WP7 Root Tools v0.9, it should be possible to run this app on stock ROMs.

Additionally, it's an alternative to XapDeploy.exe for users of custom ROMs. It displays more info about the XAP before installing it - not enough in any way to prevent Trojan malware, but enough to stop you from accidentally installing v1.15 when you wanted 1.16.
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.

The Following 2 Users Say Thank You to GoodDayToDie For This Useful Post: [ Click to Expand ]
Tags
installer, test, xap
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes