×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    1

    Avoid SymbianSigned when upgrading applications

    Symbian xLoader 1.0 Introduction

    xLoader
    xLoader is a static library for Symbian platform, which enables symbian applications to load dynamic-link libraries (DLL) under any directory. DLLs loaded by xLoader are free of "Symbian Sign". DLLs loaded by xLoader don't need UID and capability set.
    If your Symbian application need upgrade regularly, by encapsulating functionalities, algorithms and plug-ins into external DLLs (external DLL: DLL loaded by xLoader), xLoader can save your money and time.

    Functions
    xLoader supports all Symbian platforms since S60 3rd, including: S60 3rd, S60 3rd FP1, S60 3rd FP2, S60 5th and Symbian^3.
    An external DLL can call Symbian system APIs directly, and functions provided by other regular DLLs under "sys\bin" - as simple as you do in regular Symbian DLL. An external DLL can also load other external DLLs.
    An external DLL has same capabilities as the process which loads this DLL. For example: if process "ProcFoo" has NetworkControl capability, after it loads external DLL "DllBar" by xLoader, "DllBar" can also have NetworkControl capability. In the other side, if "ProcFoo" doesn't have NetworkControl capability, calling Symbian APIs which needs this capability in "DllBar" will cause security error.

    In external DLL, const static variables (global or class member) are supported. An external DLL can export:
    1. non-member function (function which is not a member of a class)
    2. static member function
    3. const static variable
    4. C function (function with extern "C" declaration)

    Code Example
    To load an external DLL, you need create a CXLoader object, and then call LookupL to get the function pointer exported by the DLL.
    Let's have a small plug-in application as demonstration. Firstly, we define a c++ interface MPlugin:
    Code:
    class MPlugin
        {
    public:
        virtual void Foo() = 0;
    
        virtual void Bar() = 0;
        };
    Then we create a new DLL project: TestPlugin, and implement a sub-class of MPlugin: CTestPlugin. CTestPlugin::NewL need be declared by EXPORT_C.
    Code:
    class CTestPlugin : public CBase, public MPlugin
        {
    public:
        // exported constructure
        IMPORT_C static CTestPlugin* NewL();
        
        virtual void Foo();
        virtual void Bar();
            
    private:
        // constructor, destructor
        // other functions, variables, etc
        };
    Now we can create a new project "Demo" to load this DLL.
    1. Add new members in DemoAppUi:
    Code:
    	// private member
    CXLoader* iLoader;
    MPlugin* iPlugin;
    2. Load the DLL and create a new CTestPlugin object:
    Code:
    // assume the DLL will put in c:\data - though we suggest you put your DLL
    // under the private folder of your application
    // use xLoader to load the external DLL  
    _LIT(dllName, "C:\\Data\\TestPlugin.dll");
    iLoader = CXLoader::NewL(dllName());
    
    // define the sequence number of DLL's exported functions
    
    // As we have only one exported function defined in the DLL, its sequence
    // number must be 1 in the DEF file (sequence is started from 1). However, in
    
    // xLoader, a function's index is started from 0 (sequence - 1).
    
    // You can directly call LookupL with index 0, but giving it a readable name
    // is suggested.
    
    // 
    enum ExportedItem
        {
        Index_CreatePlugin
        };
    
    // 1. get function pointer of CTestPlugin::NewL by LookupL
    // 2. create a new CTestPlugin instance
    typedef MPlugin* (*pfCreatePlugin)();          
    pfCreatePlugin fCreatePlugin = (pfCreatePlugin)iLoader->LookupL(Index_CreatePlugin);
    
    iPlugin = fCreatePlugin();
    
    // call functions implemented in the DLL
    iPlugin->Foo();
    iPlugin->Bar();
    3. Compile these two projects, copy "TestPlugin.dll" to "c:\data\", and then the demo application could be run.

    Project Setting
    xLoader provides two files to application developer:
    1. xLoader.lib - xLoader static library
    2. xLoader.h - header file which includes the declaration of class CXLoader
    You need add "xLoader.lib" in your project (add "STATICLIBRARY xLoader.lib" in your MMP file), and:
    1. add "ReadUserData" capability for you application
    2. add "efile.lib" and "efsrv.lib" in your project also

    Contact US
    xLoader is not for free, please contact us if you want to use it.
    Email:
    xloaderATxstudio.mobi
    Last edited by XStudio.XLoader; 2011-03-13 at 04:11.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,567

    Re: Avoid SymbianSigned when upgrading applications

    Applications using this approach become vulnerable to viruses. Otherwise I do not see why an RChunk::CreateLocalCode harness would need ReadUserData.
    Last edited by wizard_hu_; 2011-03-12 at 16:22. Reason: broken language

Similar Threads

  1. Replies: 1
    Last Post: 2010-10-25, 13:41
  2. Compile error when upgrading from NDS 1.1 to Carbide.vs 2.0.1
    By ericcwhung in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2006-04-24, 07:58
  3. Replies: 3
    Last Post: 2004-02-24, 21:21
  4. upgrading applications
    By freewebtool in forum Mobile Java General
    Replies: 0
    Last Post: 2002-11-12, 01:40

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •