This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@file:Suppress("UnstableApiUsage") | |
package com.orgname.samples.plugins | |
import com.android.build.api.dsl.CommonExtension | |
import org.gradle.api.Project | |
import org.gradle.kotlin.dsl.dependencies | |
import org.gradle.kotlin.dsl.withType | |
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.android.build.api.dsl.ApplicationExtension | |
import com.orgname.samples.plugins.APP_TARGET_SDK_VERSION | |
import com.orgname.samples.plugins.configureKotlinAndroid | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
import org.gradle.kotlin.dsl.configure | |
class AndroidApplicationConventionPlugin : Plugin<Project> { | |
override fun apply(target: Project) { | |
with(target) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
android { | |
compileSdkVersion 29 | |
buildToolsVersion "29.0.2" | |
defaultConfig { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SMSCode { | |
public static SMSInfo findSMSCode(String content) { | |
if (content.length() == 0) | |
return null; | |
// 去掉 URL | |
String pattern = "[a-zA-z]+://[^\\s]*"; | |
content = content.replaceAll(pattern, ""); |