> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/security-and-privacy/nfc-wallet-sdk-obfuscation.md).

# NFC Wallet SDK の難読化

## 概要

NFC Wallet SDK は DexGuard で難読化されています。&#x20;

このセクションでは、TSH SDK のパッケージとクラスを適切に難読化するために推奨される最小限の R8/ProGuard ルールを示します。これらのルールはアプリケーションのパッケージには影響しません。

参照してください [R8 アプリ最適化を有効にする](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization).

## R8/ProGuard ルール

{% hint style="info" %}
以下のコンシューマールールは配布される .aar ライブラリにバンドルされており、アプリでコード難読化が有効になっている場合に自動的に適用されます。
{% endhint %}

```bash
#NFC Wallet SDK
-dontwarn util.**
-dontwarn com.gemalto.mfs.mwsdk.**
-dontnote com.gemalto.mfs.mwsdk.utils.async.AbstractAsyncHandler
-keep class util.h.xz.** { *; }
-keepclasseswithmembernames class * {
native <methods>;
}
# グローバル JNA ルール
-keep,allowobfuscation interface com.sun.jna.Library
-keep,allowobfuscation interface com.sun.jna.Callback
-keep,allowobfuscation interface com.sun.jna.Function
-keep,allowobfuscation interface * implements com.sun.jna.Library
-keep,allowobfuscation interface * implements com.sun.jna.Callback
-keepclassmembers interface * implements com.sun.jna.Library {
<methods>;
}
-keepclassmembers interface * implements com.sun.jna.Callback {
<methods>;
}
-keep class com.sun.jna.CallbackReference {
void dispose();
com.sun.jna.Callback getCallback(java.lang.Class,com.sun.jna.Pointer,boolean);
com.sun.jna.Pointer getFunctionPointer(com.sun.jna.Callback,boolean);
com.sun.jna.Pointer getNativeString(java.lang.Object,boolean);
java.lang.ThreadGroup initializeThread(com.sun.jna.Callback,com.sun.jna.CallbackReference$AttachOptions);
}
-keep,includedescriptorclasses class com.sun.jna.Native {
com.sun.jna.Callback$UncaughtExceptionHandler callbackExceptionHandler;
void dispose();
java.lang.Object fromNative(com.sun.jna.FromNativeConverter,java.lang.Object,java.lang.reflect.Method);
com.sun.jna.NativeMapped fromNative(java.lang.Class,java.lang.Object);
com.sun.jna.NativeMapped fromNative(java.lang.reflect.Method,java.lang.Object);
java.lang.Class nativeType(java.lang.Class);
java.lang.Object toNative(com.sun.jna.ToNativeConverter,java.lang.Object);
int getNativeSize(java.lang.Class);
}
-keep class com.sun.jna.FromNativeConverter {
public java.lang.Class nativeType();
public java.lang.Object fromNative(java.lang.Object, com.sun.jna.FromNativeContext);
}
-keep class com.sun.jna.Native$ffi_callback {
void invoke(long,long,long);
}
-keep class com.sun.jna.Structure {
long typeInfo;
com.sun.jna.Pointer memory;
<init>(int);
void autoRead();
void autoWrite();
com.sun.jna.Pointer getTypeInfo();
com.sun.jna.Structure newInstance(java.lang.Class,long);
}
-keep class com.sun.jna.Structure$FFIType$FFITypes {
<fields>;
}
-keep class com.sun.jna.Structure$ByValue {
}
-keep class com.sun.jna.CallbackReference$AttachOptions {
<fields>;
}
-keep class com.sun.jna.Callback$UncaughtExceptionHandler {
void uncaughtException(com.sun.jna.Callback,java.lang.Throwable);
}
-keep class com.sun.jna.ToNativeConverter {
java.lang.Class nativeType();
}
-keep class com.sun.jna.NativeMapped {
java.lang.Object toNative();
}
-keep class com.sun.jna.IntegerType {
long value;
}
-keep class com.sun.jna.PointerType {
com.sun.jna.Pointer pointer;
}
-keep class com.sun.jna.LastErrorException {
<init>(int);
<init>(java.lang.String);
}
-keep class com.sun.jna.Pointer {
long peer;
<init>(long);
}
-keep class com.sun.jna.WString {
<init>(java.lang.String);
}
-keep class com.sun.jna.JNIEnv { *; }
注意

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/security-and-privacy/nfc-wallet-sdk-obfuscation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
