Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,779,915 Members 38,163 Now Online
XDA Developers Android and Mobile Development Forum

[DFT] z..::H.O.W...T.O...N.A.T.I.V.E::..z [PREVIEW]

Tip us?
 
Cotulla
Old
(Last edited by Cotulla; 9th September 2011 at 09:47 PM.)
#1  
Cotulla's Avatar
Senior Recognized Developer - OP
Thanks Meter 5,442
Posts: 881
Join Date: Sep 2007
Arrow [DFT] z..::H.O.W...T.O...N.A.T.I.V.E::..z [PREVIEW]

..::H.O.W...T.O...N.A.T.I.V.E::..

Hello,
today I had decided to start this thread about native development for WP7.



At the current moment I don't upload/attach any working stuffs to this message. It will happen a bit later, after new DFT ROMs release. This is because it's very difficult to run them for now.


Let's start from current achieved results:

1) It's possible to run any EXE files (after "FullUnlock")
2) Those EXE files can do any operations in the system (after "FullUnlock")
3) It's possible to show some GUI from this applications. But GUI has legacy Windows CE style, it's impossible to create Metro-style applications for now.


How can it be used by community?

We can develop a lot of homebrew applications: like porting emulators, old native applications, video players and etc.
It can be possible to port famous TCPMP player for example and get ultimate playback on Windows Phone 7!


Is it possible to run old Windows Mobile 6.5 applications without modifications?

No, it's not possible. A lot of different APIs are missing for those applications.


Is it hard to modify old Windows Mobile 6.5 applications?

Well, it's almost same like porting to pure Windows CE, but a lot of Windows CE stuffs are "damaged" inside Windows Phone. They just doesn't work right, because nobody never used/tested them before :P


Photos of sample "WP7 Native test"

Information for developers you can find in the next messages.



So I will release demo WP7 native application, when we fix issues with FullUnlock.

Demo will be as binary EXE file. And as VS2008 project, which can be good start point for other developers.

Now this thread dedicated for discussion, share ideas and thoughts.



DFT, Cotulla
Attached Thumbnails
Click image for larger version

Name:	IMAG0258.jpg
Views:	3738
Size:	95.5 KB
ID:	714929   Click image for larger version

Name:	IMAG0267.jpg
Views:	2540
Size:	94.7 KB
ID:	714930   Click image for larger version

Name:	IMAG0270.jpg
Views:	1769
Size:	93.6 KB
ID:	714931   Click image for larger version

Name:	IMAG0275.jpg
Views:	1484
Size:	96.6 KB
ID:	714932  
The Following 56 Users Say Thank You to Cotulla For This Useful Post: [ Click to Expand ]
 
Cotulla
Old
#2  
Cotulla's Avatar
Senior Recognized Developer - OP
Thanks Meter 5,442
Posts: 881
Join Date: Sep 2007
Default Information about "FullUnlock"

Information about "FullUnlock"



DevUnlock actually allows only to deploy XAP files from external sources.
It doesn't give more privileges.

So we (DFT) developed "FullUnlock". FullUnlock is implemented as replacing some system files by wrappers, which allows any kind of access (disable access checking at all)

We replace LVMOD.DLL which used to check files and data (checksums, certificates and etc) and POLICYENGINE.DLL which implements internal objects access checking.

All written before means that FullUnlock at the current moment only possible by flashing custom ROM to device. In future maybe we can find good ways to do it without flashing, but for now I don't see any ideas how to do it without flashing.

Maybe we can replace DLLs inside \Windows\ directory (put a shadow copy), but I am not sure if it will work really. It's stuffs for future experiments.

It can be possible to do something near by editing policy values, but it need big research to find right way. As it still won't disable file checking, maybe we can add own certificate to right store and then sign files with them.

The last DFT 7720 MANGO ROMs contains FullUnlock, but it doesn't work as expected there few issues. as well some users got issues with debugging on those ROMs and etc. We will continue work under it


So I will release demo WP7 native application, when we fix issues with FullUnlock.

Demo will be as binary EXE file. And as VS2008 project, which can be good start point for other developers.

Now this thread dedicated for discussion, share ideas and thoughts.

The Following 26 Users Say Thank You to Cotulla For This Useful Post: [ Click to Expand ]
 
Cotulla
Old
#3  
Cotulla's Avatar
Senior Recognized Developer - OP
Thanks Meter 5,442
Posts: 881
Join Date: Sep 2007
Default For developers

For developers
(users do not read! danger for brain!)



First of all I want to talk about abilities of native code.

Most applications built in inside WP7 are native. But they don't use usual Dialog UI style, they are using some kind of Silvelight scripts. This kind of UI is called "UIX".
Main idea of UIX that DLL files have UIX resources inside which describe whole UI.
Something similar is used inside CE 7.0 Slivelight - there some xml compiler which make binary data and put them as resources inside DLL. I don't know how to decode this binary data.
Seems Zune desktop application also using this framework.

So UIX used some kind of scripts for UI part and callbacks for all actions.
If we decode this UIX format, we will able to change/modify UI as we want, like it was before with regular resources inside DLL. But UIX must be much more powerful.

We can't use UIX for native application because we don't know how to use it, how to make proper binary data and etc. It's hard to reverse.

But native application can have some GUI with Windows CE style (you can see examples on the photos above)


Another issue: If you call API function "CreateWindowW" you won't see anything on the screen. It seems because shell handle all output, so window doesn't visible.
After some searching I found inside some test ROM nice DLL called "WindowTreeUpdater.dll". After looking inside and decoding functions parameters, it's working!
Basic idea: you create window and call function from this DLL and Window appear on the screen. There seems some kind of proxy engine to output legacy windows on top of shell output.
Nice, it's working...

So we can use usual windows for UI inside native application.
There present standard controls, but they work rather laggy (hey, and looks too).
Basic controls like PushButton, Static, CheckBox, Radiobutton, Icon are working.
About extended controls: (Progress bar, list view, and etc)
they come from Commctrl.dll usually, it was present inside Initial/NODO releases, ut it was removed inside MANGO. I was able to run NODO Commctrl.dll under MANGO after some modifications. But all this controls are shown on screen, but they don't do anything on input. So you can see toolbar, but can't press any button.
CommDlg.dll is missing and never was inside WP7.

There present AYGSHELL.DLL, but most functions are broken. For example, I was not able to create menu bar.

So, a lot of functions are broken, like MessageBox not working.

But we still can create own custom controls and use them for developing.

For example porting TCPMP means that we will need reimplement UI fully - because toolbar doesn't work. slider also won't. Maybe get and reuse some source from ReactOS or NT40 CommCtrl
The Following 22 Users Say Thank You to Cotulla For This Useful Post: [ Click to Expand ]
 
Cotulla
Old
#4  
Cotulla's Avatar
Senior Recognized Developer - OP
Thanks Meter 5,442
Posts: 881
Join Date: Sep 2007
reserved1reserved1
The Following 4 Users Say Thank You to Cotulla For This Useful Post: [ Click to Expand ]
 
Cotulla
Old
#5  
Cotulla's Avatar
Senior Recognized Developer - OP
Thanks Meter 5,442
Posts: 881
Join Date: Sep 2007
reserved2reserved2
The Following 3 Users Say Thank You to Cotulla For This Useful Post: [ Click to Expand ]
 
Cotulla
Old
#6  
Cotulla's Avatar
Senior Recognized Developer - OP
Thanks Meter 5,442
Posts: 881
Join Date: Sep 2007
reserved3reserved3
The Following 4 Users Say Thank You to Cotulla For This Useful Post: [ Click to Expand ]
 
Dam4rusxp
Old
#7  
Member
Thanks Meter 60
Posts: 90
Join Date: Aug 2010
This is some crazy ****! I like it
A doesn't hurt.

Phone: HTC One S
ROM: Cyanogenmod 10.2 Stable
Recovery: TWRP

RIP HTC HD2
The Following 2 Users Say Thank You to Dam4rusxp For This Useful Post: [ Click to Expand ]
 
domineus
Old
(Last edited by domineus; 9th September 2011 at 10:06 PM.)
#8  
Senior Member
Thanks Meter 118
Posts: 1,917
Join Date: Jun 2007
for...all...devices!? If possible...damn
I just came...
DVP USERS! DONATE TO GET CHRIS WALSH A DVP SO WE CAN FINALLY GO NATIVE!!! GO HERE AND DONATE!!!!!!
 
colossus_r
Old
#9  
colossus_r's Avatar
Senior Member
Thanks Meter 367
Posts: 2,014
Join Date: Feb 2007
Holly smoke !!!!!!!!!!!!!!!

Way to go guys....BRAVO... This is a major breakthrough for wp7 dev

Once again well done DFTeam
Contributions - WinMo :
1.
What to do before and after a flash
2. My XDA_UC scripts Examples
3. Icons 1. For GTX Roms 2. For Sencity
Android : HowTo 1. Rafdroid 2. Desire_DL 3. Frameworks for Desire_DL
If i helped you please hit "Thanks" button


Devices: Qtek2020i-S200-HTC3540 - ETENx500 - HTCCruise - iPhone(for a while)-HTC HD-HD2-Trophy-Titan Lumia 920
 
thatboydrae
Old
#10  
Member
Thanks Meter 2
Posts: 42
Join Date: Jan 2010
Location: P'Vegas
You guys are beasts...please keep it up :)

Tags
dft, native, wp7
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes