安卓逆向 34 AndroidStudio工程目录结构

  • gradle -> wrapper -> gradle-wrapper.properties 配置项目gradle版本
  • build.gradle 描述工程整体的编译规则
  • gradle.properties gradle配置文件,一般无须改动
  • local.properties 本机环境配置,SDK、NDK路径等,一般无须改动
  • settings.gradle 配置哪些模块在一起编译 include ':app' 只编译app

APP

  • app -> build.gradle 描述当前模块的编译规则
  • app -> build -> outputs -> apk -> debug/release 生成的apk的存放位置
  • app -> build -> intermediates -> cmake -> debug/release -> obj 生成的so存放位置
  • libs 模块中使用了第三方jar的时候,会放这里
src -> main -> cpp      C/C++代码
               java     Java代码
  • src -> proguard-rules.pro Java代码混淆规则
  • src -> main -> res -> drawable 用来放图片
  • src -> main -> res -> layout 用来放布局文件
  • src -> main -> res -> mipmap-hdpi 用来放应用图片,不同屏幕的适配图标
  • src -> main -> res -> values strings.xml、public.xml
  • src -> main -> AndroidManifest.xml 清单文件,app的icon图标、四大组件的注册、权限申请、指明程序入口

build.gradle 课件版本

plugins {
    id 'com.android.application'
}

android {
    //指定编译用的SDK版本号
    compileSdkVersion 30
    //指定编译工具的版本号,开头两位数字必须与compileSdkVersion一致。具体版本号可在sdk安装目录 SDK\build-tools 下找到
    buildToolsVersion "30.0.3"

    defaultConfig {
        //app包名
        applicationId "com.xiaojianbang.hashmaptest"
        //app适合运行的最小SDK版本号
        minSdkVersion 16
        //目标设备的SDK版本号,即app希望在哪个版本下运行
        targetSdkVersion 30
        //app应用版本号
        versionCode 1
        //app应用版本名称
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            //是否开启代码混淆功能
            minifyEnabled false
            //指定代码混淆规则文件名
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
//配置app编译所需依赖
dependencies {
    
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    api 'com.squareup.okhttp3:okhttp:3.10.0'

}

build.gradle 自己复制的

plugins {
    id 'com.android.application'
}

android {
    //指定编译用的SDK版本号
    compileSdk 31

    defaultConfig {
        //app包名
        applicationId "com.hengdi.hookdemo"
        //app适合运行的最小SDK版本号
        minSdk 21
        //目标设备的SDK版本号,即app希望在哪个版本下运行
        targetSdk 31
        //app应用版本号
        versionCode 1
         //app应用版本名称
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        // c++ 项目  会有对应的c++版本
        externalNativeBuild {
            cmake {
                cppFlags '-std=c++11'
            }
        }
    }

    buildTypes {
        release {
            //是否开启代码混淆功能
            minifyEnabled false
            //指定代码混淆规则文件名
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    externalNativeBuild {
        cmake {
            // cmake 列表
            path file('src/main/cpp/CMakeLists.txt')
            version '3.10.2'
        }
    }
    buildFeatures {
        viewBinding true
    }
}
//配置app编译所需依赖
dependencies {

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

你可能感兴趣的:(android)