proguard

How to stop ProGuard from stripping the Serializable interface from a class

蓝咒 提交于 2019-12-04 02:56:44
Is there an explicit way to stop ProGuard from changing a class from implementing an interface? I have a class that implements java.io.Serializable , let's call it com.my.package.name.Foo . I've found that after running through ProGuard, it no longer implements Serializable . I get null after I cast from Serializable to Foo and false if I check an instance with instanceof Serializable . I've made sure to set ProGuard to ignore this class: -keep class com.my.package.name.Foo I've also tried: -keep class com.my.package.name.Foo { *; } and I've also tried the whole package by doing this: -keep

Does proguard converts all enums to int or needs to be configured for this

戏子无情 提交于 2019-12-04 02:50:39
问题 Does proguard automatically converts enums to integer for memory optimization or I have to configure it to do this? If I do have to configure what is the configuration? 回答1: The optimization is listed on ProGuard's optimizations page. It appears to be one of the default optimizations, but it (like other optimizations) can be specified explicitly if you need more control (e.g. disabling all class/* optimizations aside from enum unboxing). class/unboxing/enum Simplifies enum types to integer

How to fix these proguard warnings

岁酱吖の 提交于 2019-12-04 02:47:43
I am using a third party library in my project, since then proguard is issuing me these warnings, which I can't relate to that library, Here is the library I am using: Lollipin . Warnings I am getting Warning:android.databinding.DataBindingUtil: can't find referenced class android.databinding.DataBinderMapper Warning:android.databinding.ViewDataBinding: can't find referenced class android.databinding.DataBinderMapper Warning:there were 43 unresolved references to classes or interfaces. Warning:Exception while processing task java.io.IOException: Please correct the above warnings first. What I

android library project obfuscation

烈酒焚心 提交于 2019-12-04 02:21:00
Hi I developed one android library and Now I want to obfuscate it for redistribution. I develop my library with eclipse and android version 4.1.2. I tried obfuscating with eclipse and pro-guard. I do export and and also put proguard.config = proguard-project.text in project-properties but it not generating any jar file. It shows me result as its not allowing to library projects. So I don't know how to obfuscating android library project. I need help regarding how to obfuscating of android library projects. Need Help Thank you. The Android SDK doesn't apply ProGuard to library projects; it only

Keep specific Annotation with proguard

北战南征 提交于 2019-12-04 02:01:48
问题 I have two types of annotation in my project: Annotation1 and Annotation2 . Both are runtime annotations. So, my question is how to keep only Annotation1 and strip Annotation2 ? I can not find is it possible. If not, I can not get - why ? Example: class Test { @Annotation1 @Annotation2 String name; } I want Annotation2 being removed from all fields and Annotation1 being kept everywhere. 回答1: ProGuard automatically removes annotations from the classes/fields/methods if the corresponding

Akka. Android. NoSuchMethodException: <init>

六眼飞鱼酱① 提交于 2019-12-04 01:54:50
问题 When I am running application that uses Akka on Android I receive the following exception: 04-29 16:13:06.235: E/AndroidRuntime(8968): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.myapp.MyActivity}: java.lang.NoSuchMethodException: <init> [interface com.typesafe.config.Config, interface akka.event.LoggingAdapter, interface java.util.concurrent.ThreadFactory] This exception is thrown during actor system creation: Props props1 = Props.create(MyActor.class);

Proguard keep parameter names for interface and abstract class

血红的双手。 提交于 2019-12-04 01:33:14
I am trying to prevent proguard from obfuscating interface (or abstract class) methods parameters. Lets say I have this interface in my lib : package com.mypackage; public interface MyLibListener { void onSomething(boolean success, String message); } And this proguard file : -keepparameternames -keep interface com.mypackage.MyLibListener { *; } Then I assemble release and I get : package com.mypackage; public interface MyLibListener { void onSomething(boolean var1, String var2); } Same thing with abstract classes or using @Keep annotations. Obfuscation option keepparameternames seems to work

Generate Signed APK: Errors while building APK Android Studio

若如初见. 提交于 2019-12-04 01:32:40
I am unable to generate Signed APK using minifyEnabled true and shrinkResources true App Level : build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' } } apply plugin: 'com.android.application' repositories { mavenCentral() } android { compileSdkVersion 23 buildToolsVersion '22.0.1' defaultConfig { applicationId "......." minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { debug { minifyEnabled true shrinkResources true

Android屏幕适配框架-(今日头条终极适配方案)

心不动则不痛 提交于 2019-12-04 01:19:18
在Android开发中,屏幕适配是一个非常头痛的问题,因而为了去进行屏幕适配,作为程序员,是呕心沥血,历经磨难,哈哈 我们之前做屏幕适配一般都会用到一下两种方式: 我们之前做屏幕适配一般都会用到一下两种方式: 第一种就是宽高限定符适配,什么是宽高限定符适配呢 ├── src/main │ ├── res │ ├── ├──values │ ├── ├──values-800x480 │ ├── ├──values-860x540 │ ├── ├──values-1024x600 │ ├── ├──values-1024x768 │ ├── ├──... │ ├── ├──values-2560x1440 就是这种,在资源文件下生成不同分辨率的资源文件,然后在布局文件中引用对应的 dimens,大家一定还有印象 第二种就是 鸿神 的AndroidAutoLayout 这两种方案都已经逐渐退出了历史的舞台,为什么想必大家都知道,不知道的建议看看 拉丁吴 老师的文章,现在最主流的两种屏幕适配方案,今日头条适配方案和 smallestWidth 限定符适配方案,下面介绍一个框架,采用的是今日头条适配方案传送门 框架使用效果 Pixel 2 XL | 1440 x 2880 | 560dpi: Pixel XL | 1440 x 2560 | 560dpi: Nexus 5X | 1080

Proguard stops Javascript in WebView from working

我的梦境 提交于 2019-12-04 01:17:25
问题 I have a class JSBridge (an inner class) which is a javascript interface: private class JsBridge implements JsCallback { /** * @param handlerName method required * @param jsonData data passed through from javascript * @param jsCallback A callback to trigger when handler specified by handlername has finished, could be null */ @JavascriptInterface public void callHandler(final String handlerName, final String jsonData, final String jsCallback) { Log.d(App.TAG, "Bridge call from JS, received " +