-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generate proguard rule file for android (#927)
* feat: generate proguard rule file for android * remove `AppCompatActivity` from `proguard-wry.pro`
- Loading branch information
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wry": "patch" | ||
--- | ||
|
||
On Android, generate a `proguard-wry.pro` file that could be used to keep the necessary symbols for wry when using minification. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2020-2023 Tauri Programme within The Commons Conservancy | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-License-Identifier: MIT | ||
|
||
-keep class {{package}}.* { | ||
native <methods>; | ||
} | ||
|
||
-keep class {{package}}.WryActivity { | ||
{{package}}.RustWebView m_webview; | ||
|
||
public <init>(...); | ||
|
||
void setM_webview({{package}}.RustWebView); | ||
{{package}}.RustWebView getM_webview(); | ||
|
||
java.lang.Class getAppClass(...); | ||
java.lang.String getVersion(); | ||
} | ||
|
||
-keep class {{package}}.Ipc { | ||
public <init>(...); | ||
|
||
@android.webkit.JavascriptInterface public <methods>; | ||
} | ||
|
||
-keep class {{package}}.RustWebView { | ||
public <init>(...); | ||
|
||
void loadUrlMainThread(...); | ||
void setAutoPlay(...); | ||
} | ||
|
||
-keep class {{package}}.RustWebChromeClient,{{package}}.RustWebViewClient { | ||
public <init>(...); | ||
} |