V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  feilong  ›  全部回复第 3 页 / 共 3 页
回复总数  52
1  2  3  
2018-08-28 16:33:18 +08:00
回复了 feilong 创建的主题 问与答 求一个能够互换两段文本的正则表达式
@imn1 嗯,字符串不在一行的

之前是三次替换,先把 aaa 替换成别的,再把 ccc 替换成 aaa,最后再把 aaa 换回来,但是我感觉三次替换有点太蠢了,所以问一问大家这种有没有办法一次替换完成
2018-08-28 15:09:26 +08:00
回复了 feilong 创建的主题 问与答 求一个能够互换两段文本的正则表达式
补充一下,不要先把 aaa 替换成别的再替换回来这种
2018-03-23 07:37:50 +08:00
回复了 feilong 创建的主题 问与答 关于安卓 release 版本闪退的问题
@Jimjay
2 楼有 android monitor 的日志,和 logcat 一不一样我就不知道了
2018-03-22 20:09:27 +08:00
回复了 feilong 创建的主题 问与答 关于安卓 release 版本闪退的问题
我跑到 fresco 官网上,参考(抄上)这个( https://www.fresco-cn.org/docs/proguard.html)[https://www.fresco-cn.org/docs/proguard.html],然后编译可以运行了(ಥ _ ಥ)

@XinLake @zjp
感谢两位大佬指出问题
2018-03-22 19:54:11 +08:00
回复了 feilong 创建的主题 问与答 关于安卓 release 版本闪退的问题
@zjp 感谢大佬们分析
fork 别人的项目,这是我头一次看到混淆😭,看到这个文件一脸懵逼,慢慢百度中😭

proguard-rules.pro

```
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\Developer\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

-optimizationpasses 3

-keepattributes SourceFile, LineNumberTable

# fresco
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
@com.facebook.common.internal.DoNotStrip *;
}
-dontwarn okio.**
-dontwarn javax.annotation.**
-dontwarn com.facebook.infer.**

# greenDAO
-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao {
public static java.lang.String TABLENAME;
}
-keep class **$Properties
-dontwarn org.greenrobot.greendao.database.**
-dontwarn org.greenrobot.greendao.rx.**

# ButterKnife
-keep public class * implements butterknife.internal.ViewBinder { public <init>(); }
-keep class butterknife.*
-keepclasseswithmembernames class * { @butterknife.* <methods>; }
-keepclasseswithmembernames class * { @butterknife.* <fields>; }

# OkHttp3
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**

# rhino
-dontwarn org.mozilla.javascript.**
-dontwarn org.mozilla.classfile.**
-keep class org.mozilla.javascript.** { *; }

# jsoup
-keeppackagenames org.jsoup.nodes

# andrroid v4 v7
-dontwarn android.support.v4.**
-dontwarn android.support.v7.**

# rx
-dontwarn sun.misc.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
```
2018-03-22 19:28:40 +08:00
回复了 feilong 创建的主题 问与答 关于安卓 release 版本闪退的问题
@XinLake
按照你的说法,去掉了下面这四行

```
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
shrinkResources true
zipAlignEnabled true
```

然后竟然真的没问题了,但是问题的根本应该不是这里吧
2018-03-22 19:07:35 +08:00
回复了 feilong 创建的主题 问与答 关于安卓 release 版本闪退的问题
上网查了一推,看了 android monitor 的记录

错误是这么说的
> 03-22 19:02:03.516: W/System.err(4259): at com.hiroshi.cimoc.App.onCreate(App.java:59)

app.java:59 是
> Fresco.initialize(this);


log

```
03-22 19:02:03.374: I/ActivityManager(835): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.hiroshi.cimoc/.ui.activity.MainActivity bnds=[8,474][184,678]} from pid 1118
03-22 19:02:03.397: I/BufferQueue(181): [Starting com.hiroshi.cimoc](this:0xb7faf008,id:1757,api:0,p:-1,c:181) setConsumerName: Starting com.hiroshi.cimoc
03-22 19:02:03.397: I/BufferQueue(181): [Starting com.hiroshi.cimoc](this:0xb7faf008,id:1757,api:0,p:-1,c:181) setDefaultBufferSize: w=1, h=1
03-22 19:02:03.402: I/ActivityManager(835): Start proc com.hiroshi.cimoc for activity com.hiroshi.cimoc/.ui.activity.MainActivity: pid=4259 uid=10142 gids={50142, 3003, 1028, 1015}
03-22 19:02:03.409: I/BufferQueue(181): [Starting com.hiroshi.cimoc](this:0xb7faf008,id:1757,api:0,p:-1,c:181) setDefaultBufferSize: w=720, h=1280
03-22 19:02:03.427: I/BufferQueue(181): [Starting com.hiroshi.cimoc](this:0xb7faf008,id:1757,api:0,p:835,c:181) connect: api=2 producer=(835:system_server) producerControlledByApp=false
03-22 19:02:03.428: I/BufferQueue(181): [Starting com.hiroshi.cimoc](this:0xb7faf008,id:1757,api:2,p:835,c:181) new GraphicBuffer needed
03-22 19:02:03.442: I/GLConsumer(181): [Starting com.hiroshi.cimoc](this:0xb7f897b8,api:2) [void* android::GLConsumer::createImage(EGLDisplay, const android::sp<android::GraphicBuffer>&, const android::Rect&)]
03-22 19:02:03.472: D/dalvikvm(4259): open_cached_dex_file : /data/app/com.hiroshi.cimoc-1.apk /data/dalvik-cache/data@[email protected]@classes.dex
03-22 19:02:03.516: W/System.err(4259): at com.hiroshi.cimoc.App.onCreate(App.java:59)
03-22 19:02:03.519: I/dalvikvm(4259): Could not find method android.provider.DocumentsContract.getTreeDocumentId, referenced from method com.hiroshi.cimoc.k.a.a
03-22 19:02:03.555: I/ActivityManager(835): Process com.hiroshi.cimoc (pid 4259) has died.
03-22 19:02:03.578: I/ActivityManager(835): Start proc com.hiroshi.cimoc for activity com.hiroshi.cimoc/.ui.activity.MainActivity: pid=4274 uid=10142 gids={50142, 3003, 1028, 1015}
03-22 19:02:03.659: D/dalvikvm(4274): open_cached_dex_file : /data/app/com.hiroshi.cimoc-1.apk /data/dalvik-cache/data@[email protected]@classes.dex
03-22 19:02:03.681: W/System.err(4274): at com.hiroshi.cimoc.App.onCreate(App.java:59)
03-22 19:02:03.683: I/dalvikvm(4274): Could not find method android.provider.DocumentsContract.getTreeDocumentId, referenced from method com.hiroshi.cimoc.k.a.a
03-22 19:02:03.703: I/ActivityManager(835): Process com.hiroshi.cimoc (pid 4274) has died.
03-22 19:02:03.715: I/ActivityManager(835): Start proc com.hiroshi.cimoc for activity com.hiroshi.cimoc/.ui.activity.MainActivity: pid=4292 uid=10142 gids={50142, 3003, 1028, 1015}
03-22 19:02:03.766: D/dalvikvm(4292): open_cached_dex_file : /data/app/com.hiroshi.cimoc-1.apk /data/dalvik-cache/data@[email protected]@classes.dex
03-22 19:02:03.791: W/System.err(4292): at com.hiroshi.cimoc.App.onCreate(App.java:59)
03-22 19:02:03.793: I/dalvikvm(4292): Could not find method android.provider.DocumentsContract.getTreeDocumentId, referenced from method com.hiroshi.cimoc.k.a.a
03-22 19:02:03.813: I/ActivityManager(835): Process com.hiroshi.cimoc (pid 4292) has died.
03-22 19:02:03.813: W/ActivityManager(835): Force removing ActivityRecord{42d5b380 u0 com.hiroshi.cimoc/.ui.activity.MainActivity t238}: app died, no saved state
03-22 19:02:03.816: I/BufferQueue(181): [Starting com.hiroshi.cimoc](this:0xb7faf008,id:1757,api:2,p:-1,c:181) disconnect: api=2
03-22 19:02:03.816: I/BufferQueue(181): [Starting com.hiroshi.cimoc](this:0xb7faf008,id:1757,api:0,p:-1,c:181) getReleasedBuffers: returning mask 0xffffffff
03-22 19:02:03.816: I/GLConsumer(181): [Starting com.hiroshi.cimoc](this:0xb7f897b8,api:0) destroying EGLImage dpy=0x1 img=0x10000013
03-22 19:02:03.824: I/BufferQueue(181): [Starting com.hiroshi.cimoc](this:0xb7faf008,id:1757,api:0,p:-1,c:-1) consumerDisconnect
03-22 19:02:03.825: I/BufferQueue(181): [Starting com.hiroshi.cimoc](this:0xb7faf008,id:1757,api:0,p:-1,c:-1) ~BufferQueue
03-22 19:02:03.825: D/ConsumerBase(181): [Starting com.hiroshi.cimoc] onLastStrongRef

```
2018-01-08 23:05:08 +08:00
回复了 F2Sky 创建的主题 问与答 你能忍受电视开机广告吗?
幸好之前买的普通电视,加上个安卓盒子
2018-01-08 01:15:06 +08:00
回复了 dangyuluo 创建的主题 奇思妙想 ROS(Robot Operation System)有什么搭配的好玩硬件?
pixhawk 飞机挺好玩的
2017-10-14 13:53:39 +08:00
回复了 feilong 创建的主题 问与答 树莓派 ipv6 无法访问网络
刚安装了 mtr 命令还没用呢就发现能上网了
2017-10-13 21:59:13 +08:00
回复了 feilong 创建的主题 问与答 树莓派 ipv6 无法访问网络
![]( https://i.ooxx.ooo/2017/10/13/dbb4aa7380e86dc40b14bb9e475001a3.jpg)
ipconfig 是这样
2016-09-23 07:04:37 +08:00
回复了 liuxurong 创建的主题 Python 想学网页抓取,新手Python的编码问题
@clowwindy 感谢,终于明白了是终端的问题,换一个果然没问题了
1  2  3  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5495 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 20ms · UTC 07:45 · PVG 15:45 · LAX 23:45 · JFK 02:45
Developed with CodeLauncher
♥ Do have faith in what you're doing.