小编Sau*_*thi的帖子

Proguard:-混淆文件夹名称

我想在发布apk后混淆项目的所有文件夹名称。

我已经看到许多相关的问题,但是没有一个起作用。我试过了,-flattenpackagehierarchy 'myobfuscated'但是它创建了另一个myobfuscate文件,而不是重命名所有文件夹和类。我也用过-repackageclasses ''但找不到解决方案。请帮我。

proguard.pro文件看起来像:-

-ignorewarnings
-dontpreverify
-allowaccessmodification
-optimizations !code/simplification/arithmetic
-keepattributes *Annotation*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application  
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider

-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
 }

 -keepclasseswithmembers class * {
public <init>(android.content.Context, …
Run Code Online (Sandbox Code Playgroud)

obfuscation android proguard

7
推荐指数
0
解决办法
93
查看次数

如何为404错误添加自定义错误页面(找不到页面)

我正在尝试在我的网站中为“找不到页面”添加自定义404错误页面或输入错误的URL。我有app.yaml文件,并使用过Go语言。我的网站基本上位于Google App Engine中。我检查了每个我认为与我的堆栈溢出问题有关的示例。但是在某些示例中,他们用Python或Java语言解释了示例,但我想用Go语言查找。因为我的代码是用Go编写的。

静态错误404页面已加载到服务器中,但是当我输入错误的URL时,它将显示未找到错误页面而不是我的自定义页面。我已附上截图,它告诉了您一切。

当前:-https : //imgur.com/a/sGrSPyO “这是当前显示的内容”

必需:-https: //imgur.com/a/TxL7NMR “这就是我想要的”

我已经阅读了Google App Engine的app.yaml文档,并尝试放置错误处理程序,但是我没有找到任何解决方案。

app.yaml文件代码

runtime: go
api_version: go1

handlers:

-url: /

  static_files: www/index.html

  upload: www/index.html

-url: /(.*)

  static_files: www/\1

  upload: www/(.*)

error_handlers: 

  -file: www/page-not-found.html* 
Run Code Online (Sandbox Code Playgroud)

这是更新的app.yaml文件:

runtime: go

api_version: go1

error_handlers: 
  - file: /page-not-found.html

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html
- url: /(.*)
  static_files: www/\1
  upload: www/(.*)
Run Code Online (Sandbox Code Playgroud)

google-app-engine custom-error-pages go vs-web-site-project http-status-code-404

5
推荐指数
0
解决办法
145
查看次数

TextView 在相对布局中不起作用

我正面临问题Relative layout。我textviews在我的 XML 布局中设置了几个,但在运行程序后,it will not show the text on emulator/phone. 之前一直在想,这是android studio更新版本的问题。但我还检查了另一个具有较旧 android 版本的计算机系统。我正在与大家分享 XML 代码。请帮我。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/transition_profile"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:background="@android:color/white">

        <ImageView
        android:id="@+id/imgv_back"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:srcCompat="@drawable/round_arrow_back_ios_24_px"
        android:layout_marginTop="54dp"
        android:layout_marginLeft="28dp"
        android:layout_alignParentLeft="true"/>

        <ImageView
        android:id="@+id/imgv_help"
        android:layout_width="34dp"
        android:layout_height="34dp"
        android:src="@drawable/round_help_outline_24_px"
        android:layout_alignParentRight="true"
        android:layout_marginTop="54dp"
        android:layout_marginRight="28dp"/>

        <de.hdodenhof.circleimageview.CircleImageView
        android:id="@+id/imgv_boss"
        android:layout_width="126dp"
        android:layout_height="126dp"
        android:src="@drawable/boss"
        android:layout_centerInParent="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="71dp"/>

        <TextView
        android:id="@+id/tv_emp_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="24sp"
        android:textColor="#262d3d"
        android:letterSpacing="0.02"
        tools:text="Ramesh Singha"
        android:fontFamily="@font/roboto_slab_bold"
        android:layout_below="@id/imgv_boss"
        android:layout_centerInParent="true"
        android:layout_marginTop="26dp"/>

        <TextView
        android:id="@+id/tv_boss_profile_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="14sp"
        android:textColor="#6c7383"
        android:letterSpacing="0.02"
        android:layout_below="@id/tv_emp_name" …
Run Code Online (Sandbox Code Playgroud)

android textview android-layout

4
推荐指数
1
解决办法
347
查看次数

Android SSL 证书固定与改造

我想在 android 应用程序中进行证书固定。我对理解这一点感到非常沮丧。请帮我

我拥有的:-

  1. .cert 类型证书文件。
  2. .key 类型的密钥文件,其中存储了私钥。

我没有将实施此证书的域名。我只有IP地址。我在我的项目中使用 okHttp 和改造。我在堆栈溢出中看到了许多示例来实现这一点。

但我没有得到一些东西:- 1. 如果我没有域名,是否可以将 ssl 实现为 IP 地址?2. pin字段包含什么,我没有任何私钥。我在哪里可以找到私钥(sha256/XXXXXXXXXX)?

Retrofit provideRetrofit(OkHttpClient okHttpClient, Gson gson) {
    CertificatePinner certPinner = new CertificatePinner.Builder()
            .add("patternField","pins")
            .build();

       OkHttpClient okHttpClientForPinning = new OkHttpClient.Builder()
            .certificatePinner(certPinner)
            .build();
    OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
    try {
       clientBuilder.sslSocketFactory(getSSLConfig(context).getSocketFactory());
    }
    catch (Exception e) {
        e.printStackTrace();
    }

    clientBuilder.hostnameVerifier(new HostnameVerifier() {
        @Override
        public boolean verify(String hostname, SSLSession session) {
            boolean value = true;
            //TODO:Some logic to verify your host and set value
            return …
Run Code Online (Sandbox Code Playgroud)

ssl android ssl-certificate retrofit2 certificate-pinning

3
推荐指数
1
解决办法
5473
查看次数