add the checking routine of app-id for secure key 49/68949/6 accepted/tizen/common/20160511.142148 accepted/tizen/ivi/20160512.050843 accepted/tizen/mobile/20160512.050841 accepted/tizen/tv/20160512.050813 accepted/tizen/wearable/20160512.050831 submit/tizen/20160511.042603
authorjongmun.woo <jongmun.woo@samsung.com>
Tue, 10 May 2016 12:59:35 +0000 (21:59 +0900)
committerjongmun.woo <jongmun.woo@samsung.com>
Wed, 11 May 2016 03:24:20 +0000 (12:24 +0900)
Signed-off-by: jongmun.woo <jongmun.woo@samsung.com>
Change-Id: I5fff8caa9a7b8626bdde0f4f5191887f98aec827

inc/engine/common/ApplicationContext.h
inc/engine/common/BaseQuery.h
lib/aarch64/libheremaps-engine.so.1
lib/aarch64/libheremaps-engine.so.1.0.6_13 [moved from lib/aarch64/libheremaps-engine.so.1.0.6_12 with 65% similarity, mode: 0644]
lib/arm/libheremaps-engine.so.1
lib/arm/libheremaps-engine.so.1.0.6_13 [moved from lib/arm/libheremaps-engine.so.1.0.6_12 with 62% similarity, mode: 0644]
lib/i586/libheremaps-engine.so.1
lib/i586/libheremaps-engine.so.1.0.6_13 [moved from lib/i586/libheremaps-engine.so.1.0.6_12 with 62% similarity, mode: 0644]
lib/x86_64/libheremaps-engine.so.1
lib/x86_64/libheremaps-engine.so.1.0.6_13 [moved from lib/x86_64/libheremaps-engine.so.1.0.6_12 with 65% similarity, mode: 0644]
src/here_manager.cpp

index d19dd95..4f4fa6b 100755 (executable)
@@ -58,19 +58,26 @@ public:
 
     /**
      * This method retrieves the app code.
-     * 
-     * @return A constant reference to a string containing the app code. 
+     *
+     * @return A constant reference to a string containing the app code.
      */
     const String& GetAppCode() const;
 
     /**
      * This method retrieves the app id.
-     * 
-     * @return A constant reference to a string containing the app id. 
+     *
+     * @return A constant reference to a string containing the app id.
      */
     const String& GetAppId() const;
 
     /**
+     * This method retrieves the request app id.
+     *
+     * @return A constant reference to a string containing the request app id.
+     */
+    const String& GetRequestAppId() const;
+
+    /**
      * This is a static method which returns the singleton's instance.
      *
      * @return A static reference to the instance of this singleton class.
@@ -84,13 +91,15 @@ public:
      *
      * @param sAppId A constant reference to a string containing the app id.
      *
+     * @param sRequestAppId A constant reference to a string containing the request app id.
+     *
      * @return A Boolean indicating the result of initialization,
      *        <code>true</code> on success, <code>false</code> on failure. Note
      *        that if the object already exists and has been initialized,
      *        further attempts to call this methods fail (the return value is
      *        <code>false</code>.
      */
-    bool Initialize(const String& sAppCode, const String& sAppId);
+    bool Initialize(const String& sAppCode, const String& sAppId, const String& sRequestAppId = "");
 
     /**
      * This method queries initialisation status.
index 3123bd7..3e50987 100755 (executable)
@@ -62,6 +62,11 @@ protected:
     static const String ILLEGAL_URL;
 
     /**
+     * This constant represents an App ID.
+     */
+    String RequestAppId;
+
+    /**
      * This is the default constructor.
      */
     BaseQuery();
index 0f3e16b..87c6e3c 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_12
\ No newline at end of file
+libheremaps-engine.so.1.0.6_13
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
similarity index 65%
rename from lib/aarch64/libheremaps-engine.so.1.0.6_12
rename to lib/aarch64/libheremaps-engine.so.1.0.6_13
index e34a904..c50cc19
Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_12 and b/lib/aarch64/libheremaps-engine.so.1.0.6_13 differ
index 0f3e16b..87c6e3c 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_12
\ No newline at end of file
+libheremaps-engine.so.1.0.6_13
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
similarity index 62%
rename from lib/arm/libheremaps-engine.so.1.0.6_12
rename to lib/arm/libheremaps-engine.so.1.0.6_13
index 2f011ed..7329a8a
Binary files a/lib/arm/libheremaps-engine.so.1.0.6_12 and b/lib/arm/libheremaps-engine.so.1.0.6_13 differ
index 0f3e16b..87c6e3c 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_12
\ No newline at end of file
+libheremaps-engine.so.1.0.6_13
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
similarity index 62%
rename from lib/i586/libheremaps-engine.so.1.0.6_12
rename to lib/i586/libheremaps-engine.so.1.0.6_13
index 1d587a9..135a916
Binary files a/lib/i586/libheremaps-engine.so.1.0.6_12 and b/lib/i586/libheremaps-engine.so.1.0.6_13 differ
index 0f3e16b..87c6e3c 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_12
\ No newline at end of file
+libheremaps-engine.so.1.0.6_13
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
similarity index 65%
rename from lib/x86_64/libheremaps-engine.so.1.0.6_12
rename to lib/x86_64/libheremaps-engine.so.1.0.6_13
index 9eef082..4d4c694
Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_12 and b/lib/x86_64/libheremaps-engine.so.1.0.6_13 differ
index e99dd78..02e06d8 100644 (file)
@@ -261,7 +261,7 @@ here_error_e HereManager::SetCredentials(const char *szKey)
                return HERE_ERROR_INVALID_PARAMETER;
 
        String strKey(szKey);
-       String strAppId, strAppCode;
+       String strAppId, strAppCode, strRequestAppId = "";
        size_t nCodeStart;
 
        nCodeStart = strKey.find("/");
@@ -275,7 +275,20 @@ here_error_e HereManager::SetCredentials(const char *szKey)
        strAppId = strKey.substr(0, nCodeStart);
        strAppCode = strKey.substr(nCodeStart+1, std::string::npos);
 
-       if(!ApplicationContext::GetInstance().Initialize(strAppCode, strAppId))
+       if (ApplicationContext::GetInstance().GetRequestAppId().length() < 1) {
+               char *strAppId = NULL;
+               pid_t nProcessId = getpid();
+
+               app_manager_get_app_id(nProcessId, &strAppId);
+               if (strAppId != NULL) {
+                       MAPS_LOGE("RequestAppId is %s", strAppId);
+                       strRequestAppId.append(strAppId);
+                       g_free(strAppId);
+               }
+       } else
+               strRequestAppId = ApplicationContext::GetInstance().GetRequestAppId();
+
+       if(!ApplicationContext::GetInstance().Initialize(strAppCode, strAppId, strRequestAppId))
                return HERE_ERROR_INVALID_OPERATION;
 
        //MAPS_LOGD("[success] credential setted to 'XXXXX/XXXXX'");