ProGuardマッピング

この記事では、コントローラ UI と REST API を使用して ProGuard マッピングをアップロードする方法について説明します。

コントローラ UI での ProGuard マッピングのアップロード

  1. 左側のパネルで、[Configuration] をクリックします。
  2. ProGuard Mapping & NDK Symbol Files をクリックします。このページには、ProGuard マッピングのアップロードが一覧表示されます。各アップロードには一意の [Build ID] があります。
  3. Add ProGuard File をクリックします。
  4. [Upload Missing ProGuard Mapping] ダイアログで、次の操作を実行します。
    1. パッケージのバージョンコード(数字)を入力します。これは、このマッピングファイルが生成されたアプリケーションの AndroidManifest.xml ファイルまたは build.gradle ファイルのいずれかで指定された versionCode プロパティです。
    2. [Choose File] をクリックします。
      アップローダは、拡張子が .txt のファイルに対応しています。ファイルの名前は mapping.txt です。
    3. ファイルブラウザでマッピングファイルを見つけて選択し、Open をクリックします。
    4. Upload をクリックします。

Upload ProGuard Mappings with the REST API

The API uses HTTP basic authentication. The username is your Splunk AppDynamics EUM account name and the password is your EUM license key.

注: If you wish to disable this REST API and use the Controller API that uses the token-based upload, contact Splunk AppDynamics Support.

Send the mapping file

Send the mapping file as a text file in the body of the PUT request to the following URL:
Americas
https://api.eum-appdynamics.com/v2/account/<EUM_Account_Name>/<androidPackageName>/<versionCode>/proguard-mapping
EMEA
CODE
https://fra-api.eum-appdynamics.com/v2/account/<EUM_Account_Name>/<androidPackageName>/<versionCode>/proguard-mapping
APAC
CODE
https://syd-api.eum-appdynamics.com/v2/account/<EUM_Account_Name>/<androidPackageName>/<versionCode>/proguard-mapping
See Splunk AppDynamics SaaS Domains and IP Ranges for more EUM server locations.

These parameters are required:

  • EUM_Account_Name : the URL-encoded version of your account name.
  • androidPackagename : the name of the Android package for which this mapping file was generated.
  • versionCode : the string representation of the "versionCode" property specified in either the AndroidManifest.xml file or the build.gradle file of the application for which this mapping file was generated.

The request body contains the mapping file. You are required to add a Content-Type header, -H Content-Type:text/plain, and your account name and license key/password to the call.

Sample Request and Response Using the REST API

This is a sample request and response using the REST API.

Upload Request

The following example uses curl to send a ProGuard mapping file. You would use a similar command to send a DexGuard mapping file. The account name is "Example account" and the license key/password is "Example-License-Key-4e8ec2ae6cfe". The plus signs replace spaces in the account name when the account name is URL-encoded. The package name of the Android application is "com.example.networklogger". The mapping file corresponds to the version with versionCode.
Americas
Android
CODE
curl -v -H Content-Type:text/plain --upload-file mapping.txt --user Example+account:Example-License-Key-4e8ec2ae6cfe https://api.eum-appdynamics.com/v2/account/Example+account/com.example.networklogger/1/proguard-mapping
iOS
CODE
curl -v -H Content-Type:text/plain --upload-file main.jsbundle.map" --user Example+account:Example-License-Key-4e8ec2ae6cfe https://api.eum-appdynamics.com/v2/account/Example+account/com.example.networklogger/1.0/iOS/jssource-mapping
EMEA
Android
CODE
curl -v -H Content-Type:text/plain --upload-file mapping.txt --user Example+account:Example-License-Key-4e8ec2ae6cfe https://fra-api.eum-appdynamics.com/v2/account/Example+account/com.example.networklogger/1/proguard-mapping
iOS
CODE
curl -v -H Content-Type:text/plain --upload-file main.jsbundle.map" --user Example+account:Example-License-Key-4e8ec2ae6cfe https://fra-api.eum-appdynamics.com/v2/account/Example+account/com.example.networklogger/1.0/iOS/jssource-mapping
APAC
Android
CODE
curl -v -H Content-Type:text/plain --upload-file mapping.txt --user Example+account:Example-License-Key-4e8ec2ae6cfe https://syd-api.eum-appdynamics.com/v2/account/Example+account/com.example.networklogger/1/proguard-mapping
iOS
CODE
curl -v -H Content-Type:text/plain --upload-file main.jsbundle.map" --user Example+account:Example-License-Key-4e8ec2ae6cfe https://syd-api.eum-appdynamics.com/v2/account/Example+account/com.example.networklogger/1.0/iOS/jssource-mapping

Upload Response

The successful output of the example request looks like this:
Americas
CODE
* About to connect() to api.eum-appdynamics.com port 443 (#0)
*   Trying ::1...
* connected
* Connected to api.eum-appdynamics.com  (::1) port 443 (#0)
* Server auth using Basic with user 'Example+account'
> PUT /v2/account/Example+account/com.example.networklogger/1/proguard-mapping HTTP/1.1
> Authorization: Basic SW50ZXJuYWwrdGVzdCthY2NvdW50OlRlc3RBY2N0LTFlMzktNDVkMy05MzAzLTRlOGVjMmFlNmNmZQ==
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5
> Host: api.eum-appdynamics.com
> Accept: */*
> Content-Length: 4
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Content-Length: 0
< Server: Jetty(8.1.4.v20120524)
<
* Connection #0 to host api.eum-appdynamics.com left intact
* Closing connection #0
EMEA
CODE
* About to connect() to fra-api.eum-appdynamics.com port 443 (#0)
*   Trying ::1...
* connected
* Connected to fra-api.eum-appdynamics.com  (::1) port 443 (#0)
* Server auth using Basic with user 'Example+account'
> PUT /v2/account/Example+account/com.example.networklogger/1/proguard-mapping HTTP/1.1
> Authorization: Basic SW50ZXJuYWwrdGVzdCthY2NvdW50OlRlc3RBY2N0LTFlMzktNDVkMy05MzAzLTRlOGVjMmFlNmNmZQ==
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5
> Host: fra-api.eum-appdynamics.com
> Accept: */*
> Content-Length: 4
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Content-Length: 0
< Server: Jetty(8.1.4.v20120524)
<
* Connection #0 to host fra-api.eum-appdynamics.com left intact
* Closing connection #0
APAC
CODE
* About to connect() to syd-api.eum-appdynamics.com port 443 (#0)
*   Trying ::1...
* connected
* Connected to syd.eum-appdynamics.com  (::1) port 443 (#0)
* Server auth using Basic with user 'Example+account'
> PUT /v2/account/Example+account/com.example.networklogger/1/proguard-mapping HTTP/1.1
> Authorization: Basic SW50ZXJuYWwrdGVzdCthY2NvdW50OlRlc3RBY2N0LTFlMzktNDVkMy05MzAzLTRlOGVjMmFlNmNmZQ==
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5
> Host: syd-api.eum-appdynamics.com
> Accept: */*
> Content-Length: 4
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Content-Length: 0
< Server: Jetty(8.1.4.v20120524)
<
* Connection #0 to host syd-api.eum-appdynamics.com left intact
* Closing connection #0

Check Uploaded Mapping Files Using the REST API

You can check to make sure that your mapping files have successfully uploaded using two REST APIs.

  1. Get a list of the GUIDs for the last 50 mapping files you have uploaded.
  2. Check if a specific mapping file has been uploaded.
注: Each upload has a unique Build ID. You can also view the uploads in the Controller UI. See Upload ProGuard Files.

List of the Last 50 Mapping Files Uploaded

The proguardQuery method allows you to retrieve a list of GUIDs for up to the last 50 mapping files (ProGuard or DexGuard) that have been uploaded to your account, along with the time they were uploaded. The response is displayed as JSON, by upload time, with the most recent first.

  1. Set up your authentication as described in Upload with the API.

  2. Create a GET request of the form:

    CODE
    curl --user Example+account:Example-License-Key-4e8ec2ae6cfe https://<EUM_Cloud/EUM_Server_Host:port>/v2/account/<EUM_Account_Name>/crash-symbol-file-query/proguard

    - EUM_Cloud refers to SaaS-based EUM Cloud URLs. For a complete list, see Splunk AppDynamics SaaS Domains and IP Ranges.

    - EUM_Server_Host refers to the URL pointing to your on-premises EUM Server.

    - EUM_Account_Name is your EUM account name.

    - GUID_To_Check is the GUID of the ProGuard file in which you are interested.

Sample Request

Americas
CODE
curl --user Example+account:Example-License-Key-4e8ec2ae6cfe  https://api.eum-appdynamics.com:443/v2/account/<EUM_Account_Name>/crash-symbol-file-query/proguard
EMEA
CODE
curl --user Example+account:Example-License-Key-4e8ec2ae6cfe  https://fra-api.eum-appdynamics.com:443/v2/account/<EUM_Account_Name>/crash-symbol-file-query/proguard
APAC
CODE
curl --user Example+account:Example-License-Key-4e8ec2ae6cfe  https://syd-api.eum-appdynamics.com:443/v2/account/<EUM_Account_Name>/crash-symbol-file-query/proguard

Sample Response

JSON
{"proguardFiles": [
{"packageName":"my_package_name1", "version":"1", "uploadTime":"mm/dd/yyyy 16:09:23","GUID":"my_build_id1"}, 
{"packageName":"my_package_name2", "version":"1", "uploadTime":"mm/dd/yyyy 16:09:23","GUID":"my_build_id2"}
]}

Check for Specific Mapping File by GUID

The checkForProguardFile method allows you to check if a specific ProGuard or DexGuard file by GUID has been uploaded. The upload time is returned in the response.

  1. Set up your authentication as described in Upload with the REST API.
  2. Create a GET request of the form:

    CODE
    curl --user Example+account:Example-License-Key-4e8ec2ae6cfe https://<EUM_Cloud/EUM_Server_Host:port>/v2/account/<EUM_Account_Name>/crash-symbol-file-query/proguard/guid/<GUID_To_Check>

    - EUM_Cloud refers to SaaS-based EUM Cloud URLs. For a complete list, see Splunk AppDynamics SaaS Domains and IP Ranges.

    - EUM_Server_Host refers to the URL pointing to your on-premises EUM Server.

    - EUM_Account_Name is your EUM account name.

    - GUID_To_Check is the GUID of the ProGuard file in which you are interested.

Sample Request

Americas
CODE
curl --user Example+account:Example-License-Key-4e8ec2ae6cfe  https://api.eum-appdynamics.com:443/v2/account/<EUM_Account_Name>/crash-symbol-file-query/proguard/guid/my_build_id1
EMEA
CODE
curl --user Example+account:Example-License-Key-4e8ec2ae6cfe  https://fra-api.eum-appdynamics.com:443/v2/account/<EUM_Account_Name>/crash-symbol-file-query/proguard/guid/my_build_id1
APAC
CODE
curl --user Example+account:Example-License-Key-4e8ec2ae6cfe  https://syd-api.eum-appdynamics.com:443/v2/account/<EUM_Account_Name>/crash-symbol-file-query/proguard/guid/my_build_id1

Sample Response

JSON
{"packageName":"mypackagename","version":"1","uploadTime":"mm/dd/yyyy 16:09:23","GUID":"my_build_id1"}

トークンを使用した REST API での ProGuard マッピングのアップロード

注: トークンベースのアップロードを使用するには、次のプロパティが有効になっていることを確認します。
CODE
MAPPING_FILE_UPLOAD_API_DISABLED: True

コントローラ API は、ProGuard マッピングをアップロードするためのトークンベースの認証をサポートしています。このアップロード方法では、生成されたトークンとアプリケーション ID がログイン情報とともに必要です。

ProGuard マッピングファイルをアップロードするには、次の手順を実行します。

  1. ファイルをアップロードするためのトークンを生成します。
    CODE
    curl -L -X GET -u <username>@<accountName>:<password> '<controller base url>/controller/restui/mobileRUMConfig/fileUploadToken'
  2. アプリケーション ID を取得します。
    CODE
    curl -L -X GET -u <username>@<accountName>:<password> '<controller base url>/controller/restui/mobileRUMConfig/getApplicationId/<App key>'
  3. ProGuard マッピングファイルをアップロードします。
    CODE
    curl -L -X POST -u <username>@<accountName>:<password> '<controller base url>/controller/restui/mobileRUMConfig/uploadProGuardFile/<applicationID>?token=<token>' -F 'fileData=@"<proguard file path>"' -F 'androidPackageName="<android Package Name>"' -F 'versionCode="<code version>"'