Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在 Android Instant App(安卓即时应用程序)中启用 ProGuard(混淆) #3362

Conversation

JayZhaoBoy
Copy link
Contributor

@JayZhaoBoy JayZhaoBoy commented Mar 2, 2018

在 Android Instant App(安卓即时应用程序)中启用 ProGuard (混淆)

译文翻译完成,resolve #3298

在 Android Instant App(安卓即时应用程序)中启用 ProGuard (混淆)
@leviding leviding changed the title 在 Android Instant App(安卓即时应用程序)中启用 ProGuard (混淆) 在 Android Instant App(安卓即时应用程序)中启用 ProGuard(混淆) Mar 2, 2018
@leviding leviding added the Google label Mar 2, 2018
@hanliuxin5
Copy link
Contributor

校对认领

@fanyijihua
Copy link
Collaborator

@hanliuxin5 好的呢 🍺

Copy link
Contributor

@hanliuxin5 hanliuxin5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leviding @JayZhaoBoy 第一次校对完毕

@@ -5,56 +5,57 @@
> * 译者:
> * 校对者:

# Enabling ProGuard in an Android Instant App
# Android Instant App(安卓即时应用程序)中启用 ProGuard (混淆)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8行和下一行之间多空了一行

@@ -5,56 +5,57 @@
> * 译者:
> * 校对者:

# Enabling ProGuard in an Android Instant App
# Android Instant App(安卓即时应用程序)中启用 ProGuard (混淆)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProGuard 不太应该简单解释成“混淆”,要注译的话“优化”这个词更合适
ProGuard is the most popular optimizer for Java bytecode. It makes your Java and Android applications up to 90% smaller and up to 20% faster. ProGuard also provides minimal protection against reverse engineering by obfuscating the names of classes, fields and methods.


### Instant Apps and the 4 Megabyte limit
**_更新于 2018–01–18:_** _指南第五步中的更新,是对非基础模块的必要补充_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中的更新 =》 中的重要更新


Converting an existing app project into an [Android Instant App](https://developer.android.com/topic/instant-apps/index.html) can be challenging, but it is also a great exercise in [modularizing and structuring your project](https://developer.android.com/topic/instant-apps/getting-started/structure.html), updating SDKs, and complying with all of the [Instant Apps sandbox restrictions](https://developer.android.com/topic/instant-apps/getting-started/prepare.html) that were put in place to keep Instant Apps secure and loading fast.
### Instant Apps(即时应用)和 4 兆字节的限制
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 兆字节
这个就直接写成 4 MB 是不是更直白一点。。
同下的所有


One of the restrictions states that for every URL handled by your instant app, the total size of the required feature module and base module delivered to the client device must not exceed 4 Megabytes.
用 [Android Instant App(安卓即时应用程序)](https://developer.android.com/topic/instant-apps/index.html)覆盖一个已经存在的应用程序是很有挑战性的,但对于[模块化并重构你的项目](https://developer.android.com/topic/instant-apps/getting-started/structure.html)而言却是一个很好的练习,更新 SDKs(开发工具包)并遵守所有的 [Instant Apps(即使应用程序)沙箱限制](https://developer.android.com/topic/instant-apps/getting-started/prepare.html)以确保即时应用程序的安全和加载速度。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

覆盖一个 =》 转换一个


* * *

Hopefully this guide gives you a better understanding of why ProGuard can be broken for your instant app. Following the steps should take you to a working build and stop your instant app from crashing.
希望本指南能够让你更好地理解为什么 ProGuard(混淆)可以使你的即时应用程序崩溃。 遵循这些步骤应该带你完成构建,并停止即时应用程序崩溃。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProGuard(混淆)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProGuard确实是混淆,这里面讲的也是混淆,混淆本身便包括优化,资源的压缩和去除无用代码。


* * *

Hopefully this guide gives you a better understanding of why ProGuard can be broken for your instant app. Following the steps should take you to a working build and stop your instant app from crashing.
希望本指南能够让你更好地理解为什么 ProGuard(混淆)可以使你的即时应用程序崩溃。 遵循这些步骤应该带你完成构建,并停止即时应用程序崩溃。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

程序崩溃。 后面多余的空格


* * *

Hopefully this guide gives you a better understanding of why ProGuard can be broken for your instant app. Following the steps should take you to a working build and stop your instant app from crashing.
希望本指南能够让你更好地理解为什么 ProGuard(混淆)可以使你的即时应用程序崩溃。 遵循这些步骤应该带你完成构建,并停止即时应用程序崩溃。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

并停止即时应用程序崩溃 =》并让你的即时应用程序不再崩溃。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直译语境不是很好。

Copy link

@hippyk hippyk Mar 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“防止即时应用崩溃” 是不是更好一点?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hippyk 多谢建议,修改完毕


You can take a look at some of the [instant app samples](https://github.com/googlesamples/android-instant-apps/blob/master/multi-feature-module/proguard.pro) on GitHub which were recently updated with ProGuard configurations to compare your setup or even practice the method I described in this article on a sample project.
你可以在 GitHub 上看看最新的一些使用 ProGuard(混淆)配置的[即时应用示例](https://github.com/googlesamples/android-instant-apps/blob/master/multi-feature-module/proguard.pro) 来和你的向比较,或者练习本文中介绍的相关示例项目的方法。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProGuard(混淆)同上理


You can take a look at some of the [instant app samples](https://github.com/googlesamples/android-instant-apps/blob/master/multi-feature-module/proguard.pro) on GitHub which were recently updated with ProGuard configurations to compare your setup or even practice the method I described in this article on a sample project.
你可以在 GitHub 上看看最新的一些使用 ProGuard(混淆)配置的[即时应用示例](https://github.com/googlesamples/android-instant-apps/blob/master/multi-feature-module/proguard.pro) 来和你的向比较,或者练习本文中介绍的相关示例项目的方法。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

向 =》相

@JayZhaoBoy
Copy link
Contributor Author

修改完毕 @leviding @hanliuxin5

@hanliuxin5
Copy link
Contributor

@JayZhaoBoy 亲,你点击一下 load more 那个按钮,还有其他 35 个校对点。。。

@JayZhaoBoy
Copy link
Contributor Author

@hanliuxin5 前面太卡没加载出来,现在好了

leviding
leviding previously approved these changes Mar 12, 2018
@JayZhaoBoy
Copy link
Contributor Author

@leviding
Copy link
Member

@hanliuxin5 校对升至 3 分

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

在 Android Instant App(安卓即时应用程序)中启用 ProGuard(混淆)
5 participants