Skip to Content
Android Developer Tools深入精要
book

Android Developer Tools深入精要

by Mike Wolfson
July 2014
Intermediate to advanced
248 pages
5h 19m
Chinese
GoTop Information, Inc.
Content preview from Android Developer Tools深入精要
進階打包步驟
|
135
ProGuard
ProGuard
是一個免費的
Java
工具而可以將你的程式碼縮減、最佳化、混淆來準備發佈。
它透過移除沒用到的程式碼、用不同語意的名稱來取代類別及方法名稱,以及優化位
元碼(
bytecode
)來執行此操作。這會讓你的程式更小、更有效率,且更難被逆向工程;
這個過程可以防止你的程式碼被重用且保護你的機密資料。
開啟
ProGuard
執行這個工具非常容易,當你是使用程式匯出精靈(第
126
頁「簽署
App
」)來打包
APK
時,大部分是自動完成的。如果你的建置目標高於
2.3
版本,則在打包過程中會
自動執行此工具。一個預設的設置檔位於專案的根目錄,名為
proguard-project.txt
內容會像是以下的範例:
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
# # Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Android 高效能多執行緒

Android 高效能多執行緒

Anders Goransson
深入淺出 jQuery

深入淺出 jQuery

Ryan Benedetti, Ronan Cranley
HTML5 錦囊妙計

HTML5 錦囊妙計

Christopher Schmitt, Kyle Simpson

Publisher Resources

ISBN: 9789863470861