# 升級至ALC V2

## 由V1升級至 V2 <a href="#id-sheng-ji-dao-alcv2-you-v1-sheng-ji-dao-v2" id="id-sheng-ji-dao-alcv2-you-v1-sheng-ji-dao-v2"></a>

### 新增ALC Library附屬項目 <a href="#id-sheng-ji-dao-alcv21.-tian-jia-alclibrary-cong-shu-xiang-mu" id="id-sheng-ji-dao-alcv21.-tian-jia-alclibrary-cong-shu-xiang-mu"></a>

從ONE store SDK ALC v2 開始，透過 maven 發布。\
透過maven套用SDK，需要套用以下內容。

<br>

#### **删除ALC AAR 文件**

删除Project内 libs 資料夾中 alc-android-library\_v1.0.0.aar檔案

#### **新增Maven附屬性**

選項頂端的 build.gradle 資料夾中，註冊ONE store maven 地址。

{% hint style="warning" %}
Android Studio (version: bumblebee)，在settings.gradle新增
{% endhint %}

```gradle

...
buildscript {
repositories {
...
    maven { url 'https://repo.onestore.net/repository/onestore-sdk-public' }
}
}
...
```

<br>

下面應用程式的 build.gradle 檔案中，新增 ONE store ALC Library附屬項目&#x20;

```gradle

...
dependencies {
def onestore_sdk_version = "2.0.0"
implementation "com.onestorecorp.sdk:sdk-licensing:$onestore_sdk_version"
}
...
```

<br>

#### **AndroidManifest.xml中新增queries**&#x20;

以下兩種情況，請參考ONE store 公告進行設定。

* [Target SDK 版本設定為 30(OS 11) 以上](https://dev.onestore.co.kr/devpoc/support/news/noticeView.omp?pageNo=4\&noticeId=32968\&viewPageNo=\&searchValue=)
* [Target SDK 版本設定為 31(OS 12) 以上](https://dev.onestore.co.kr/devpoc/support/news/noticeView.omp?pageNo=1\&noticeId=33072\&viewPageNo=\&searchValue=)

<br>

Android 11 (Target SDK 30) 以上，請新增以下内容

{% hint style="warning" %}
Android 11 以上 (Target SDK 30 以上)，請新增 queries
{% endhint %}

```xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dev.sample">
<queries>
<intent>
<action android:name="com.onestore.extern.licensing.LicensingService.ACTION" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="onestore" />
</intent>
</queries>
...
```

<br>

### 新增SDK Configuration  <a href="#id-sheng-ji-dao-alcv22.-tian-jia-sdkconfiguration" id="id-sheng-ji-dao-alcv22.-tian-jia-sdkconfiguration"></a>

在ALC v2中，為使用SDK所需的必要param，必須先套用sdk-configuration Library.\
為套用此功能，請於 build.gradle檔案中新增ONE store sdk-configuration Library附屬項目。

```gradle

...
dependencies {
def onestore_configuration_version = "1.0.0"
implementation "com.onestorecorp.sdk:sdk-configuration-kr:$onestore_configuration_version"
}
...
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://onestore-dev.gitbook.io/dev/cht/tools/alc/sheng-ji-zhi-alc-v2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
