Asked  1 Year ago    Answers:  5   Viewed   177 times

This is my first project in Android Studio, and the code of my apps are not obfuscated. Im using this configuration in build.gradle file:

I'm using the Build > Generate Signed APK... with the Run Proguard checked. And, when I have tested using the Apk_OneClick.v4.2, my code is completly easy to read:

Please, help-me. :(

 Answers

3

You're probably not actually signing the release build of the APK via the signing wizard. You can either build the release APK from the command line with the command:

./gradlew assembleRelease

or you can choose the release variant from the Build Variants view and build it from the GUI:

Friday, June 11, 2021
 
Jauco
 
5

On the other computer you could try to import the project, instead of opening it.

Actually, you don't have to commit project specific files to your git repo. Android Studio is smart enough to import a project from many different sources.

With IntelliJ IDEA you can not only create an Android project from scratch, but also import an existing project developed using other tools. One of the most common scenarios is importing an existing Android-Gradle project. However, you can also import a Maven, Eclipse or Flash Builder project, or even build a new project from a bunch of source files.

Just like this:

And here's a nice and more detailed tutorial on how to import a project on Android Studio from source and other places.

For your .gitignore file I strongly recommend you to get one using gitignore.io website.

Also, if you already commited files that are not supposed to be there, check this question and see how you can remove them.

Here's an example of a .gitignore file that I use on one of my projects.

# Created by https://www.gitignore.io/api/android,osx,windows,linux,intellij,java

### Android ###
# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

### Android Patch ###
gen-external-apklibs


### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk


### Linux ###
*~

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*


### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear
Sunday, August 8, 2021
 
3

Try to change into -

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
Saturday, September 11, 2021
 
jvf
 
jvf
3

There's a very easy solution for this, There's a precompiled library for android, as below https://github.com/WritingMinds/ffmpeg-android-java Simply include this as a gradle project in your code and add few methods as per their documentation and you are done with FFMPEG commands in android. This library is not very updated and have some missing features but still its good to use for many simple tasks.

Monday, September 20, 2021
 
4

The solution is to add following line to the libraries build.gradle: consumerProguardFiles 'proguard-rules.pro'

So my androKnife library looks like following:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            consumerProguardFiles 'proguard-rules.pro'
        }
    }
}

dependencies {

    ...
}
Saturday, October 30, 2021
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :